-
Notifications
You must be signed in to change notification settings - Fork 297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Instrumentation.StackExchangeRedis] Support when IConnectionMultiplexer is added with keyed service #1885
[Instrumentation.StackExchangeRedis] Support when IConnectionMultiplexer is added with keyed service #1885
Conversation
src/OpenTelemetry.Instrumentation.StackExchangeRedis/CHANGELOG.md
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.Instrumentation.StackExchangeRedis/.publicApi/net8.0/PublicAPI.Unshipped.txt
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.Instrumentation.StackExchangeRedis/TracerProviderBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
...y.Instrumentation.StackExchangeRedis/OpenTelemetry.Instrumentation.StackExchangeRedis.csproj
Outdated
Show resolved
Hide resolved
...ation.StackExchangeRedis.Tests/OpenTelemetry.Instrumentation.StackExchangeRedis.Tests.csproj
Outdated
Show resolved
Hide resolved
@eerhardt, please check this PR, you were reviewing the first version. |
...y.Instrumentation.StackExchangeRedis/OpenTelemetry.Instrumentation.StackExchangeRedis.csproj
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Could probably use a few new tests.
public static TracerProviderBuilder AddRedisInstrumentation( | ||
this TracerProviderBuilder builder, | ||
object serviceKey) | ||
{ | ||
Guard.ThrowIfNull(serviceKey); | ||
|
||
return AddRedisInstrumentation(builder, name: null, connection: null, serviceKey, configure: null); | ||
} | ||
|
||
/// <summary> | ||
/// Enables automatic data collection of outgoing requests to Redis. | ||
/// </summary> | ||
/// <param name="builder"><see cref="TracerProviderBuilder"/> being configured.</param> | ||
/// <param name="name">Optional name which is used when retrieving options.</param> | ||
/// <param name="serviceKey">Optional service key used to retrieve the <see cref="IConnectionMultiplexer"/> to instrument from the <see cref="IServiceProvider" />.</param> | ||
/// <param name="configure">Callback to configure options.</param> | ||
/// <returns>The instance of <see cref="TracerProviderBuilder"/> to chain the calls.</returns> | ||
public static TracerProviderBuilder AddRedisInstrumentation( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do these new overloads have tests covering them?
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1885 +/- ##
==========================================
- Coverage 73.91% 69.92% -3.99%
==========================================
Files 267 5 -262
Lines 9615 276 -9339
==========================================
- Hits 7107 193 -6914
+ Misses 2508 83 -2425
Flags with carried forward coverage won't be shown. Click here to find out more.
|
src/OpenTelemetry.Instrumentation.StackExchangeRedis/TracerProviderBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
…viderBuilderExtensions.cs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fixes #1451.
Changes
Added a new overload to AddRedisInstrumentation which gets serviceKey in input and get IConnectionMultiplexer with a keyed service.
For significant contributions please make sure you have completed the following items:
CHANGELOG.md
updated for non-trivial changes