Commit Graph

37 Commits

Author SHA1 Message Date
Jade Guiton 368cdd0425
[exporterhelper] Remove deprecated aliases for Queue/TimeoutSettings (#11264)
#### Description

Follow-up to #11132 now that 0.110 has been released.

#### Link to tracking issue

Should be the final step for #6767.
2024-09-25 09:44:44 -07:00
Damien Mathieu df3c9e38a8
[chore] split exporterhelper so a separate profiles module can use it (#11215)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

This is part of #11131, splitting the exporterhelper module with a new
`internal` submodule that holds everything shared by the signals.
This is so a new `exporterhelperprofiles` module can make use of the
shared structs.
2024-09-19 13:17:38 +02:00
Bogdan Drutu 1245955ccf
Remove obsreportconfig package, reduce dependencies (#11148)
Small issue that the `SpanNameSep` is duplicated, but is a very small
duplicate.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2024-09-11 14:07:13 -07:00
Jade Guiton 6c2697c445
[exporterhelper] Rename Timeout/QueueSettings to Config (#11132)
#### Description

This PR renames `TimeoutSettings` and `QueueSettings` (as well as the
corresponding `NewDefault` functions) to `TimeoutConfig` and
`QueueConfig`, for naming consistency reasons.

The previous struct/function names are kept as deprecated aliases of the
new ones for now.

#### Link to tracking issue

Updates #6767  (edit: reworded by @mx-psi)

#### Testing

No behavior changes were made, so no additional testing should be
necessary.

The references to the aforementioned structs/functions in existing tests
have been renamed as well. This means the deprecated function aliases
are not tested, lowering the coverage a bit.

#### Documentation

The new functions are documented identically to the previous ones.
2024-09-11 18:27:12 +02:00
Antoine Toulme c469394c52
[exporterhelper] delete deprecated `exporterhelper.ObsReport` (#10779)
#### Description
Delete deprecated `exporterhelper.ObsReport` and
`exporterhelper.NewObsReport`

#### Link to tracking issue
Relates to
https://github.com/open-telemetry/opentelemetry-collector/issues/10592
2024-08-07 10:45:13 -07:00
Dmitrii Anoshin c239e73bbb
[exporterhelper] Add data_type attribute to internal queue metrics (#10593)
Add `data_type` attribute to the internal otelcol_exporter_queue_size
metric to report the type of data being processed.

All other metrics have the data type reported as part of their names. We
could've done the same for queue metrics, but that would introduce a
significant breaking change. We want to avoid that until we have all the
metrics standardized with OpenTelemetry semantic conventions.

Fixes
https://github.com/open-telemetry/opentelemetry-collector/issues/9943
2024-07-23 14:02:54 -07:00
Dmitrii Anoshin 4d57f5e0b8
[mdatagen] Remove WithAttributes from the telemetry builder constructor (#10608)
Attribute sets for async instruments now can be set as options to
callback setters and async instruments initializers. This allows each
async instrument to have its own attribute set.

Unblocks
https://github.com/open-telemetry/opentelemetry-collector/pull/10593
2024-07-16 10:36:35 -07:00
Alex Boten 662a4c4520
[chore] update code to use WithoutCancel (#10397)
This was introduced in go 1.21 and removes the need for a custom
implementation of the context.

Fixes #9049

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-06-13 13:52:56 +02:00
Alex Boten 7704414027
[exporterhelper] move queue metrics to mdatagen (#10318)
This uses mdatagen to generate the queue metrics. This will allow users
to see the metric in the documentation for exporter helper

---------

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-06-10 12:25:57 -07:00
Alex Boten f0c8787d2b
[exporter] deprecate CreateSettings -> Settings (#10335)
This deprecates CreateSettings in favour of Settings.
NewNopCreateSettings is also being deprecated in favour of
NewNopSettings
    
Part of #9428

~Follows
https://github.com/open-telemetry/opentelemetry-collector/pull/10333~

---------

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-06-06 08:03:40 -07:00
Dmitrii Anoshin 241334609f
[exporterhelper] Introduce batching functionality (#8685)
This change introduces new experimental batching functionality to the
exporter helper. The batch sender is fully concurrent and synchronous.
It's set after the queue sender, which, if enabled, introduces the
asynchronous behavior and ensures no data loss with the permanent queue.

Follow-up TODO list:
- Add pre-built merge funcs for pdata
- Handle partial errors
- A missing part compared to the batch processor is the ability to shard
the batches by context value.

Updates
https://github.com/open-telemetry/opentelemetry-collector/issues/8122
2024-03-07 16:42:01 -08:00
Dmitrii Anoshin bdbb5f3d51
[exporterhelper] Add WithRequestQueue option to the exporter (#8853)
Introduce a way to enable queue in the new exporter helper with a
developer interface suggested in
https://github.com/open-telemetry/opentelemetry-collector/pull/8248#discussion_r1302102261.

The new configuration interface for the end users provides a new
`queue_size_items` option to limit the queue by a number of spans, log
records, or metric data points. The previous way to limit the queue by
number of requests is preserved under the same field, `queue_size,`
which will later be deprecated through a longer transition process.

Tracking issue:
https://github.com/open-telemetry/opentelemetry-collector/issues/8122
2024-02-03 09:24:05 -08:00
Alex Boten 9c7177496f
[chore] remove unused opencensus code (#9108)
Follows
https://github.com/open-telemetry/opentelemetry-collector/pull/9102

---------

Signed-off-by: Alex Boten <aboten@lightstep.com>
2024-01-30 10:19:42 -08:00
Alex Boten 834413537b
[telemetry] mark useOtelForInternalMetrics stable (#9102)
This marks the flag as stable. Leaving this as a draft until v0.92.0 is
released.

Closes https://github.com/open-telemetry/opentelemetry-collector/issues/8962
Fixes https://github.com/open-telemetry/opentelemetry-collector/issues/816

---------

Signed-off-by: Alex Boten <aboten@lightstep.com>
2024-01-16 15:38:21 -08:00
Dmitrii Anoshin 55a8c6b651
[exporterhelper] Cleanup logging for export failures (#9282)
This change makes the logging of the exported error failures cleaner.
1. Ensure an error message is logged every time and only once when data
is dropped/rejected due to export failure.
2. Update the wording. Specifically, don't use "dropped" term when an
error is reported back to the pipeline. If there is no queue configured,
the exporter doesn't drop data by itself but rather rejects it. Keep the
"dropped" wording for failures after the enabled queue.
3. Properly report any error reported by a queue. For example, a
persistent storage error must be reported as a storage error, not as
"queue overflow".

Fixes
https://github.com/open-telemetry/opentelemetry-collector/issues/9219
2024-01-12 18:18:19 -08:00
Dmitrii Anoshin 7f7b8265c0
[chore] [exporterhelper] Move queue creation parameters to structs (#9197)
Address
https://github.com/open-telemetry/opentelemetry-collector/pull/8853#discussion_r1438362242
2024-01-02 09:51:19 -08:00
Dmitrii Anoshin fe2c989e4a
[chore] [exporterhelper] Items based queue sizing with bounded channel (#9164)
Introduce an option to limit the queue size by the number of items
instead of number of requests. This is preliminary step for having the
exporter helper v2 with a batcher sender placed after the queue sender.
Otherwise, it'll be hard for the users to estimate the queue size based
on the number of requests without batch processor in front of it.

This change doesn't effect the existing functionality and the items
based queue limiting cannot be utilized yet.

Updates
https://github.com/open-telemetry/opentelemetry-collector/issues/8122

Alternative to
https://github.com/open-telemetry/opentelemetry-collector/pull/9147
2023-12-22 10:21:20 -08:00
Dmitrii Anoshin ef4a5be399
[exporterhelper] Do not re-enqueue failed requests (#9090)
The current re-enqueuing behavior is not obvious and cannot be
configured. It takes place only for persistent queue and only if
`retry_on_failure::enabled=true` even if `retry_on_failure` is a setting
for a different backoff retry strategy.

This change removes the re-enqueuing behavior in favor of the
`retry_on_failure` option. Consider increasing
`retry_on_failure::max_elapsed_time` to reduce chances of data loss.

Resolves
https://github.com/open-telemetry/opentelemetry-collector/issues/8382
2023-12-14 20:41:02 -08:00
Dmitrii Anoshin f0f93914b7
[chore] [exporterhelper] Do not requeue on shutdown (#9054)
This change unblocks adding the `enqueue_on_failure` option to the queue
sender by removing the requeue behavior on the shutdown. If we don't
remove requeue on shutdown, it's possible to run into a situation
described in
https://github.com/open-telemetry/opentelemetry-collector/issues/7388.
After the recent refactoring, the chance of running into it is pretty
small, but it's still possible.

The only reason to requeue on shutdown is to make sure there is no data
loss with the persistent queue enabled. The persistent queue captures
all the inflight requests in the persistent storage anyway, so there is
no reason to requeue an inflight request. The only downside is it
potentially can cause sending duplicate data on the collector restart in
case of a partially failed request during shutdown.

Another option would be to rework the memory queue to never close the
channel but still ensure draining.
2023-12-12 09:31:28 -08:00
Dmitrii Anoshin 1a4ed9ef16
[chore] [exporterhelper] Remove another redundant field from queueSender (#9008)
This should've been part of
https://github.com/open-telemetry/opentelemetry-collector/pull/9001.
Didn't notice it before
2023-11-28 12:25:19 -08:00
Dmitrii Anoshin 4966509246
[chore] [exporterhelper] Remove redundant queueSender field (#9001)
Not being used after the recent changes
2023-11-28 07:12:30 -08:00
Dmitrii Anoshin 575c5f5e25
[chore] [exporterheper] Fix not-started queue sender shutdown (#8995)
Do not panic on the shutdown of a not-started queue sender
2023-11-27 10:14:43 -08:00
Dmitrii Anoshin 0ae738f0c8
[chore] [exporterhelper] Fix requeuing of partially failed request (#8992)
After
https://github.com/open-telemetry/opentelemetry-collector/pull/8985, the
whole request is requeued even with the partial request error. This
change fixes it and restores the previous behavior. No changelog is
needed since the bug is not released yet.
2023-11-26 18:28:14 -08:00
Dmitrii Anoshin 8cec790c1c
[chore] [exporterhelper] Remove retry sender -> queue sender callback (#8985)
Use returned error instead to simplify the senders feedback loop. This
change preserves the behavior. Re-enqueueing of the temporary failures
depends on the enabled retry sender. This will be changed in the next
step when re-queueing becomes a configurable option
2023-11-26 16:46:30 -08:00
Dmitrii Anoshin 8c6cf78b78
[chore] [exporterhelper] Make QueueConsumer control queue start/shutdown (#8914)
Addressing
https://github.com/open-telemetry/opentelemetry-collector/pull/8898#discussion_r1393471604
2023-11-15 11:29:35 -08:00
Dmitrii Anoshin df6448b5aa
[chore] [exporterhelper] Move workers from queue to queueSender (#8898)
Move the common workers loop logic from each queue implementation to the
sender.

Based on
https://github.com/open-telemetry/opentelemetry-collector/pull/8828
2023-11-14 16:46:26 -08:00
Bogdan Drutu 6bbffee1ce
Change Queue to use generics, removes some unsafe conversions (#8896)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2023-11-14 15:49:24 -08:00
Bogdan Drutu e873023261
[chore] rename internal Queue func to Offer; return error (#8884)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2023-11-13 21:00:45 -08:00
Bogdan Drutu 6a38ea7171
Remove Queue.IsPersistent, not needed (#8875)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2023-11-13 19:21:40 -08:00
Dmitrii Anoshin a6c0bd4cba
[exporterhelper] Remove redundant request interfaces (#8867)
Pass request+context through the senders pipeline similar to what we do
in the collector's pipeline. Use a helper QueueRequest struct for
passing requests through queues

This changes also moves the experimental Request interface to a separate
package.
2023-11-13 18:37:16 -08:00
Bogdan Drutu 8e0f68261d
Avoid nil queue in queue_sender, consolidate implementation (#8862)
Also, fixes `WithRetry` called with a config that is disabled.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2023-11-13 09:59:47 -08:00
Bogdan Drutu 23500dda16
Use standard component Start/Shutdown func in exporterhelper (#8861)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2023-11-12 21:22:29 -08:00
Bogdan Drutu fd79d43c7a
Rename ProducerConsumerQueue to Queue (#8838)
* Rename Stop to Shutdown, add context and return error.
* Fix test nits.
* Return errors from Shutdown instead of log them.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2023-11-10 14:02:56 -08:00
Alex Boten f0bba0ec35
[exporterhelper] fix bug with queue size and capacity metrics (#8716)
This change ensures the queue_size and queue_capacity metrics are
available when using OpenTelemetry for the collector's internal metrics.

Fixes #8682

---------

Signed-off-by: Alex Boten <aboten@lightstep.com>
Co-authored-by: Dmitrii Anoshin <anoshindx@gmail.com>
2023-10-26 08:06:11 -07:00
Raphael Philipe Mendes da Silva ffedebe858
[chore]: Validate number of consumers in exporterhelper (#8629)
**Description:** Validate number of consumers in exporterhelper

This is a very small bug fix that does not even deserve a changelog
entry. The collector will not work if a queue with a number of consumers
<= 0 is used, so we should fail loudly instead of just hanging not
draining the data from the queue.

**Testing:** UTs were added.


_Please delete paragraphs that you did not use before submitting._
2023-10-06 09:14:11 -07:00
Dmitrii Anoshin b89b8194c1
[chore] [exporterhelper] Remove unused field from queueSender (#8626) 2023-10-05 09:52:02 -07:00
Dmitrii Anoshin 767b95e73a
[chore] [exporterhelper] Split exporter senders into different files (#8398)
This is a follow-up to
https://github.com/open-telemetry/opentelemetry-collector/pull/8369. No
functional changes, just moving the code around
2023-09-13 13:15:45 -07:00