Skip to content

[Geneva] Log error when buffer too small - #4027

Merged
martincostello merged 11 commits into
open-telemetry:mainfrom
martincostello:gh-1152
Jun 15, 2026
Merged

martincostello merged 11 commits into
open-telemetry:mainfrom
martincostello:gh-1152

Conversation

@martincostello

Copy link
Copy Markdown
Member

Fixes #1152

Changes

Log an error if a metric is too large for the buffer.

Merge requirement checklist

  • CONTRIBUTING guidelines followed (license requirements, nullable enabled, static analysis, etc.)
  • Unit tests added/updated
  • Appropriate CHANGELOG.md files updated for non-trivial changes
  • Changes in public API reviewed (if applicable)

Log an error if a metric is too large for the buffer.

Fixes open-telemetry#1152.
@github-actions github-actions Bot added the comp:exporter.geneva Things related to OpenTelemetry.Exporter.Geneva label Mar 27, 2026
@codecov

codecov Bot commented Mar 27, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 70.31250% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.92%. Comparing base (435cf5f) to head (d6978b8).
⚠️ Report is 4 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...eva/Metrics/OtlpProtobuf/OtlpProtobufSerializer.cs 8.33% 11 Missing ⚠️
...eva/Internal/EventHeader/EventHeaderLogExporter.cs 0.00% 5 Missing ⚠️
...va/Internal/GenevaBufferOverflowExceptionHelper.cs 92.00% 2 Missing ⚠️
...a/Metrics/OtlpProtobuf/ProtobufSerializerHelper.cs 88.88% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            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     
Flag Coverage Δ
unittests-Exporter.Geneva 55.42% <70.31%> (+0.70%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ry.Exporter.Geneva/Internal/ExporterEventSource.cs 62.96% <100.00%> (+32.01%) ⬆️
...emetry.Exporter.Geneva/Metrics/MetricSerializer.cs 100.00% <100.00%> (ø)
...a/Metrics/OtlpProtobuf/ProtobufSerializerHelper.cs 98.41% <88.88%> (-1.59%) ⬇️
...va/Internal/GenevaBufferOverflowExceptionHelper.cs 92.00% <92.00%> (ø)
...eva/Internal/EventHeader/EventHeaderLogExporter.cs 14.08% <0.00%> (-0.41%) ⬇️
...eva/Metrics/OtlpProtobuf/OtlpProtobufSerializer.cs 90.51% <8.33%> (+0.55%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread src/OpenTelemetry.Exporter.Geneva/CHANGELOG.md Outdated
@martincostello
martincostello marked this pull request as ready for review March 27, 2026 16:15
@martincostello
martincostello requested a review from a team as a code owner March 27, 2026 16:15
Copilot AI review requested due to automatic review settings March 27, 2026 16:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/OpenTelemetry.Exporter.Geneva/Metrics/TlvMetricExporter.cs Outdated
@github-actions

github-actions Bot commented Apr 4, 2026

Copy link
Copy Markdown
Contributor

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@github-actions github-actions Bot added the Stale label Apr 4, 2026
@martincostello martincostello added keep-open Prevents issues and pull requests being closed as stale and removed Stale labels Apr 4, 2026
@Kielek
Kielek requested a review from rajkumar-rangaraj April 7, 2026 05:57
@martincostello
martincostello enabled auto-merge May 7, 2026 19:08
Comment thread src/OpenTelemetry.Exporter.Geneva/CHANGELOG.md Outdated
Expand logging for too-small buffers to all relevant call sites.
@martincostello
martincostello requested a review from xiang17 June 5, 2026 09:02
Fix missed style warning from refactor.
This was referenced Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp:exporter.geneva Things related to OpenTelemetry.Exporter.Geneva

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GenevaExporter should log a helpful message when it runs out of buffer capacity to serialize data

7 participants