[Redis] Add schema URL to traces#4095
Conversation
Add schema URL to the `ActivitySource`. Contributes to open-telemetry#4064.
Add PR number.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4095 +/- ##
==========================================
+ Coverage 73.85% 73.86% +0.01%
==========================================
Files 459 459
Lines 18327 18335 +8
==========================================
+ Hits 13535 13543 +8
Misses 4792 4792
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
Note
Copilot was unable to run its full agentic suite in this review.
Adds OpenTelemetry schema URL (and instrumentation scope version) support to StackExchangeRedis traces by switching to an ActivitySourceFactory-created ActivitySource and updating tests/changelog accordingly.
Changes:
- Create
ActivitySourceinstances with schema URL support via sharedActivitySourceFactory. - Select between “old” and “new” semantic conventions by emitting activities from different
ActivitySources. - Add/extend tests to assert
ActivitySourcename/version and schema URL; update changelog.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/OpenTelemetry.Instrumentation.StackExchangeRedis.Tests/StackExchangeRedisCallsInstrumentationTests.cs | Adds assertions for scope name/version and schema URLs for emitted activities. |
| src/OpenTelemetry.Instrumentation.StackExchangeRedis/TracerProviderBuilderExtensions.cs | Registers the ActivitySource name from the created ActivitySource instance. |
| src/OpenTelemetry.Instrumentation.StackExchangeRedis/StackExchangeRedisConnectionInstrumentation.cs | Introduces schema-versioned ActivitySource instances via ActivitySourceFactory. |
| src/OpenTelemetry.Instrumentation.StackExchangeRedis/OpenTelemetry.Instrumentation.StackExchangeRedis.csproj | Links shared ActivitySourceFactory.cs into the project. |
| src/OpenTelemetry.Instrumentation.StackExchangeRedis/Implementation/RedisProfilerEntryToActivityConverter.cs | Chooses the appropriate ActivitySource based on EmitNewAttributes. |
| src/OpenTelemetry.Instrumentation.StackExchangeRedis/CHANGELOG.md | Documents the addition of scope version and schema URL to traces. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Move to unreleased.
Co-authored-by: Matthew Hensley <130569+matt-hensley@users.noreply.github.com>
If both conventions are enabled, do not emit a telemetry schema URL.
Contributes to #4064.
Changes
Add schema URL to the
ActivitySource.Merge requirement checklist
CHANGELOG.mdfiles updated for non-trivial changesChanges in public API reviewed (if applicable)