[exporter/exporterhelper] Add DroppedItemsErr to report intentionally dropped items#15028
[exporter/exporterhelper] Add DroppedItemsErr to report intentionally dropped items#15028Krishnachaitanyakc wants to merge 1 commit intoopen-telemetry:mainfrom
Conversation
add5acf to
98359df
Compare
|
@Krishnachaitanyakc Why did I get pinged on this? I'm not involved with this project. |
my bad, i was tagging you on a different PR and got it mixed up, apologies |
|
@bogdandrutu @dmitryax could you take a look at this change when you have a chance? |
bef083f to
5695c65
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main open-telemetry/opentelemetry-collector#15028 +/- ##
========================================
Coverage 91.13% 91.13%
========================================
Files 701 701
Lines 45798 45902 +104
========================================
+ Hits 41739 41834 +95
- Misses 2845 2851 +6
- Partials 1214 1217 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
… dropped items
Exporters that intentionally discard items (e.g. the Prometheus exporter
dropping non-monotonic DELTA sums) previously had no way to signal this to
the exporterhelper observation layer. Those items were silently counted as
successfully sent, making internal telemetry misleading.
This change adds:
- experr.DroppedItemsErr / NewDroppedItemsErr: a non-failure sentinel that
an exporter's push function can return to report the number of
intentionally dropped items and an optional reason.
- Four new telemetry counters (otelcol_exporter_dropped_{spans,metric_points,
log_records,profile_samples}) emitted by the obsReportSender whenever a
DroppedItemsErr is received.
- obsReportSender adjusts the sent count so that dropped items are excluded
from "sent" and the DroppedItemsErr is not propagated as a pipeline error.
Also restore stdlib-before-third-party import ordering in
generated_package_test.go to satisfy the impi linter.
Resolves #13643
Signed-off-by: Kc Balusu <kcbalusu@meta.com>
5695c65 to
0d73dcb
Compare
Merging this PR will improve performance by 27.7%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ⚡ | BenchmarkPersistentQueue |
181.7 µs | 143.6 µs | +26.57% |
| ⚡ | BenchmarkMemoryQueueWaitForResult |
61.4 µs | 48.1 µs | +27.7% |
Comparing Krishnachaitanyakc:fix/issue-13643 (0d73dcb) with main (346b065)
Footnotes
-
76 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
|
We need #15280 to land first |
Description
Exporters that intentionally discard items (e.g. a Prometheus exporter dropping non-monotonic DELTA sums) previously had no way to signal this to the
exporterhelperobservation layer. Dropped items were silently counted as successfully sent viaotelcol_exporter_sent_metric_points, making internal telemetry misleading and difficult to use for diagnosing data loss.This PR adds a lightweight mechanism for exporters to report intentionally dropped items:
experr.DroppedItemsErr/NewDroppedItemsErr(count, reason): a non-failure sentinel that an exporter's push function can return to report how many items were intentionally dropped and why.otelcol_exporter_dropped_{spans,metric_points,log_records,profile_samples}): emitted byobsReportSenderwhen aDroppedItemsErris received.obsReportSenderadjustments: dropped items are subtracted from the "sent" count, andDroppedItemsErris not propagated as a pipeline error (the pipeline seesnil).A follow-up to the
prometheusexporterinopentelemetry-collector-contribwill be needed to actually returnDroppedItemsErrfor unsupported metric types (e.g. non-monotonic DELTA sums).Resolves open-telemetry/opentelemetry-collector-contrib#48172