[Instana] Support configuration with code#4153
[Instana] Support configuration with code#4153martincostello merged 16 commits intoopen-telemetry:mainfrom
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4153 +/- ##
==========================================
+ Coverage 73.71% 74.31% +0.59%
==========================================
Files 467 457 -10
Lines 18362 18252 -110
==========================================
+ Hits 13536 13564 +28
+ Misses 4826 4688 -138
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR modernizes the Instana exporter by introducing an options-based configuration model, updating target frameworks, and refactoring the export pipeline/transport while updating tests to validate JSON payloads using System.Text.Json.
Changes:
- Added
InstanaExporterOptions+AddInstanaExporter(Action<InstanaExporterOptions>)configuration and updated env-var handling. - Refactored export pipeline (sync processors, new
SpanSender/Transport, removed sync-over-async and redundant helper abstractions). - Updated/expanded unit tests (new HTTP server-based tests, JSON payload assertions, migrated tests from Newtonsoft.Json).
Reviewed changes
Copilot reviewed 38 out of 38 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| test/OpenTelemetry.Exporter.Instana.Tests/TracerProviderBuilderExtensionsTests.cs | Adds end-to-end tests for builder extension + env/options configuration |
| test/OpenTelemetry.Exporter.Instana.Tests/TestSpanSender.cs | Removes old test sender abstraction |
| test/OpenTelemetry.Exporter.Instana.Tests/TestInstanaExporterHelper.cs | Removes old helper abstraction |
| test/OpenTelemetry.Exporter.Instana.Tests/TestActivityProcessor.cs | Removes old async processor stub |
| test/OpenTelemetry.Exporter.Instana.Tests/Processors/TagsActivityProcessorTests.cs | Updates tests for sync processor + assertions cleanup |
| test/OpenTelemetry.Exporter.Instana.Tests/Processors/EventsActivityProcessorTests.cs | Updates tests for sync processor + stronger assertions |
| test/OpenTelemetry.Exporter.Instana.Tests/Processors/ErrorActivityProcessorTests.cs | Updates tests for sync processor + updated data model |
| test/OpenTelemetry.Exporter.Instana.Tests/Processors/DefaultActivityProcessorTests.cs | Updates tests for sync processor and new data model |
| test/OpenTelemetry.Exporter.Instana.Tests/OpenTelemetry.Exporter.Instana.Tests.csproj | Swaps test JSON dependency + links shared test infra |
| test/OpenTelemetry.Exporter.Instana.Tests/InstanaSpanTest.cs | Migrates test JSON model to System.Text.Json attributes |
| test/OpenTelemetry.Exporter.Instana.Tests/InstanaSpanSerializerTests.cs | Uses System.Text.Json to validate serialized payload |
| test/OpenTelemetry.Exporter.Instana.Tests/InstanaSpanFactoryTests.cs | Updates for new span data shape (Values) |
| test/OpenTelemetry.Exporter.Instana.Tests/InstanaExporterTests.cs | Reworks exporter tests to validate actual HTTP payload/headers |
| src/OpenTelemetry.Exporter.Instana/TracerProviderBuilderExtensions.cs | Adds options-based exporter registration + env var config |
| src/OpenTelemetry.Exporter.Instana/README.md | Updates docs to mention options-based configuration |
| src/OpenTelemetry.Exporter.Instana/OpenTelemetry.Exporter.Instana.csproj | Switches to TargetFrameworksForLibraries (+ netfx on Windows) |
| src/OpenTelemetry.Exporter.Instana/InstanaExporterOptions.cs | Introduces public options type |
| src/OpenTelemetry.Exporter.Instana/InstanaExporterHelper.cs | Removes old helper implementation |
| src/OpenTelemetry.Exporter.Instana/InstanaExporterConstants.cs | Renames constants + trims unused env var constants |
| src/OpenTelemetry.Exporter.Instana/InstanaExporter.cs | Refactors exporter to use options + new sender/transport |
| src/OpenTelemetry.Exporter.Instana/Implementation/Transport.cs | Refactors HTTP transport and batching |
| src/OpenTelemetry.Exporter.Instana/Implementation/SpanSender.cs | New background sender loop + queue limiting |
| src/OpenTelemetry.Exporter.Instana/Implementation/Processors/*.cs | Converts processors from async to sync + updates constants/data model usage |
| src/OpenTelemetry.Exporter.Instana/Implementation/Processors/IActivityProcessor.cs | Changes processor contract from async to sync |
| src/OpenTelemetry.Exporter.Instana/Implementation/Processors/ActivityProcessorBase.cs | Updates chaining logic + initializes Values |
| src/OpenTelemetry.Exporter.Instana/Implementation/InstanaSpanTransformInfo.cs | Modernizes transform info type |
| src/OpenTelemetry.Exporter.Instana/Implementation/InstanaSpanSerializer.cs | Refactors manual JSON serialization internals |
| src/OpenTelemetry.Exporter.Instana/Implementation/InstanaSpanFactory.cs | Makes factory static and updates initialization |
| src/OpenTelemetry.Exporter.Instana/Implementation/InstanaSpan.cs | Updates span/data model (Values) + modern C# |
| src/OpenTelemetry.Exporter.Instana/Implementation/InstanaExporterEventSource.cs | Minor modernization |
| src/OpenTelemetry.Exporter.Instana/Implementation/ISpanSender.cs | Removes old interface |
| src/OpenTelemetry.Exporter.Instana/IInstanaExporterHelper.cs | Removes old interface |
| src/OpenTelemetry.Exporter.Instana/CHANGELOG.md | Documents new TFMs, options support, and behavior change |
| src/OpenTelemetry.Exporter.Instana/.publicApi/PublicAPI.Unshipped.txt | Adds new public API surface for options + builder overload |
| src/OpenTelemetry.Exporter.InfluxDB/InfluxDBExporterExtensions.cs | Minor expression-bodied refactor |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Add support for configuring with options class. - Add `net8.0` and `net10.0` TFMs. - Use modern C# features. - Support batch export limit configuration and apply limits. - Remove sync-over-async. - Add support for custom `HttpClient` creation. - Remove redundant code.
- Fix InstanaExporterTests. - Update README. - Extend assertions to verify JSON payloads. - Remove redundant code. - Remove redundant mocks. - Fix some StyleCop warnings.
Fix most StyleCop warnings and remove unused constants.
Add tests for TracerProviderBuilder extensions.
- Write literal `true` string instead of computing it. - Fix-up comments. - Add TODO to remove manual JSON serialization.
Use System.Text.Json in tests instead.
Add CHANGELOG entry for TFM additions.
- Suppress `CA5399`. - Update CHANGELOG with PR number. - Tweak some XML documentation.
Move the suppression to the right place.
Address most Copilot code review comments.
Address more Copilot feedback.
Address final piece of Copilot review feedback.
The batch exporter already runs a background task to export, so use that rather than have another one just to use async.
9740098 to
91977f6
Compare
|
|
||
| namespace OpenTelemetry.Exporter.Instana.Implementation; | ||
|
|
||
| // TODO Use a proper JSON serializer that encodes strings safely. |
There was a problem hiding this comment.
I've already done the changes to resolve this in a different branch - I'll open a PR with the changes once this is merged.
|
@kirrg001, could you please take a look or find better Instana-go-to person? |
Move entry to Unreleased.
Changes
net8.0andnet10.0TFMs.HttpClientcreation.Merge requirement checklist
CHANGELOG.mdfiles updated for non-trivial changes