StackExchange Redis: Provide 'db.system' on Span creation#1984
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1984 +/- ##
=======================================
Coverage ? 83.83%
=======================================
Files ? 192
Lines ? 6179
Branches ? 0
=======================================
Hits ? 5180
Misses ? 999
Partials ? 0
|
Austin-Tan
commented
Apr 15, 2021
| internal const string ActivityName = ActivitySourceName + ".Execute"; | ||
| internal static readonly Version Version = typeof(StackExchangeRedisCallsInstrumentation).Assembly.GetName().Version; | ||
| internal static readonly ActivitySource ActivitySource = new ActivitySource(ActivitySourceName, Version.ToString()); | ||
| internal static readonly IEnumerable<KeyValuePair<string, object>> CreationTags = new[] |
Member
Author
There was a problem hiding this comment.
This collection is in the main RedisInstrumentation.cs file, as this is where we stored other static variables,
but I believe those were all only used in the class itself. We could alternatively put it in the Converter class where it's used, which is static (Does having it in static save memory? Most people are only instantiating one copy of the RedisInstrumentation.cs class anyway)
cijothomas
approved these changes
Apr 15, 2021
utpilla
approved these changes
Apr 15, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1971 for Redis -- The issue was fixed for SQL instrumentation library by @johnduhart in #1979 , and this PR is largely based on his work.
Changes
Since we always attach the tag KeyVal ("db.system", "redis"), statically instantiating it is worth the small cost, and allows samplers to check for this tag when deciding to sample or not