Skip to content

[Geneva] Fix ETW metadata to allow .NET EventSource subscriptions#4729

Merged
martincostello merged 6 commits into
open-telemetry:mainfrom
zvorygin:main
Jul 17, 2026
Merged

[Geneva] Fix ETW metadata to allow .NET EventSource subscriptions#4729
martincostello merged 6 commits into
open-telemetry:mainfrom
zvorygin:main

Conversation

@zvorygin

@zvorygin zvorygin commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

It's impossible to subscribe to OpenTelemetry EventSource, since data published to the ETW doesn't match manifest/schema inferred from the EtwEventSource Event-annotated methods. Listeners receive errors and truncated data.

Changes

Make manifest schema match the actual data written to the ETW. Changed the internal format to have two fields - buffer size, ad raw data, as .Net EventSource expects(mayb be a breaking change). Verified that Geneva MonitringAgent can ingest the data.

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)

@zvorygin
zvorygin requested a review from a team as a code owner July 10, 2026 16:26
@linux-foundation-easycla

linux-foundation-easycla Bot commented Jul 10, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

@github-actions

Copy link
Copy Markdown
Contributor

Welcome, contributor! Thank you for your contribution to opentelemetry-dotnet-contrib.

Important reminders:

  • Read our Contributing Guidelines.
  • Sign the CLA if you haven't already.
  • Follow the OpenTelemetry Generative AI policy: disclose any AI use in your contribution, and communicate (PR descriptions, review replies) in your own words rather than AI-generated text.
  • Give reviewers at least a few days before pinging them for feedback.
  • If you need help with general setup, development process, or contributor etiquette, ask in #opentelemetry-new-contributors.

@github-actions github-actions Bot added the comp:exporter.geneva Things related to OpenTelemetry.Exporter.Geneva label Jul 10, 2026

@xiang17 xiang17 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.

Looks good to me

@martincostello martincostello left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please add a CHANGELOG entry for this fix.

@martincostello martincostello changed the title Fix ETW metadata to allow .Net EventSource subscriptions [Geneva] Fix ETW metadata to allow .NET EventSource subscriptions Jul 14, 2026
@martincostello
martincostello requested a review from Copilot July 14, 2026 20:56

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

This PR fixes the Geneva ETW transport’s EventSource/ETW metadata mismatch so that .NET EventListener/EventSource subscriptions can successfully parse the emitted payload (preventing listener errors and truncated data).

Changes:

  • Adjust ETW payload writing to match the EventSource-inferred manifest schema (length + raw data).
  • Add an ETW roundtrip test validating EventListener can receive the full byte[] payload.
  • Add an xUnit collection definition to disable parallelization for ETW tests (system-global resource).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
src/OpenTelemetry.Exporter.Geneva/Internal/Transports/EtwDataTransport.cs Updates EventSource metadata and WriteEventCore payload layout to align ETW data with the generated manifest.
test/OpenTelemetry.Exporter.Geneva.Tests/Internal/Transports/EtwDataTransportTests.cs Adds a roundtrip ETW/EventListener test to verify the payload is received and decoded correctly.
test/OpenTelemetry.Exporter.Geneva.Tests/EtwCollection.cs Adds a non-parallel xUnit collection for ETW tests to avoid cross-test interference.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/OpenTelemetry.Exporter.Geneva.Tests/EtwCollection.cs
Comment thread src/OpenTelemetry.Exporter.Geneva/Internal/Transports/EtwDataTransport.cs Outdated
@zvorygin

Copy link
Copy Markdown
Contributor Author

Please add a CHANGELOG entry for this fix.

Added

Comment thread src/OpenTelemetry.Exporter.Geneva/CHANGELOG.md Outdated
Comment thread test/OpenTelemetry.Exporter.Geneva.Tests/EtwCollection.cs Outdated
@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.43%. Comparing base (0f90170) to head (8cd3566).
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4729      +/-   ##
==========================================
+ Coverage   77.37%   77.43%   +0.05%     
==========================================
  Files         466      466              
  Lines       19764    19766       +2     
==========================================
+ Hits        15292    15305      +13     
+ Misses       4472     4461      -11     
Flag Coverage Δ
unittests-Exporter.Geneva 56.66% <100.00%> (+0.22%) ⬆️

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

Files with missing lines Coverage Δ
...ter.Geneva/Internal/Transports/EtwDataTransport.cs 86.36% <100.00%> (+1.36%) ⬆️

... and 2 files 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.

@martincostello

Copy link
Copy Markdown
Member

@zvorygin Please fix the file encoding for EtwCollection.cs and EtwDataTransportTest.cs.

@zvorygin
zvorygin force-pushed the main branch 2 times, most recently from 9144178 to cd5b151 Compare July 16, 2026 18:59
Re-apply previous suggestion that was force-pushed over and fix sorting.
Comment thread test/OpenTelemetry.Exporter.Geneva.Tests/EtwCollection.cs Outdated
This was referenced Jul 18, 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.

5 participants