[Geneva] Log error when buffer too small - #4027
Conversation
Log an error if a metric is too large for the buffer. Fixes open-telemetry#1152.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4027 +/- ##
==========================================
+ Coverage 75.76% 75.92% +0.16%
==========================================
Files 438 439 +1
Lines 18002 18038 +36
==========================================
+ Hits 13639 13696 +57
+ Misses 4363 4342 -21
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Add PR number.
There was a problem hiding this comment.
Pull request overview
Adds a dedicated error log path for Geneva metric TLV serialization buffer overflows, addressing #1152 by producing a clearer diagnostic event when a metric cannot fit into the fixed-size buffer.
Changes:
- Catch buffer-exhaustion exceptions during TLV metric export and emit a dedicated EventSource error event.
- Add a new ExporterEventSource event (ID 11) for “metric serialization buffer exceeded”.
- Add a unit test validating the new buffer-overflow log behavior and update Geneva exporter changelog.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| test/OpenTelemetry.Exporter.Geneva.Tests/GenevaMetricExporterTests.cs | Adds a new test that forces a serialization buffer overflow and asserts the dedicated error event is emitted. |
| src/OpenTelemetry.Exporter.Geneva/Metrics/TlvMetricExporter.cs | Adds targeted exception handling to detect buffer overflow and log the new event. |
| src/OpenTelemetry.Exporter.Geneva/Internal/ExporterEventSource.cs | Introduces a new EventSource event (ID 11) with a clearer buffer-overflow message. |
| src/OpenTelemetry.Exporter.Geneva/CHANGELOG.md | Documents the new error logging behavior in Unreleased notes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
Move to unreleased.
Expand logging for too-small buffers to all relevant call sites.
Fix missed style warning from refactor.
Fixes #1152
Changes
Log an error if a metric is too large for the buffer.
Merge requirement checklist
CHANGELOG.mdfiles updated for non-trivial changesChanges in public API reviewed (if applicable)