-
Notifications
You must be signed in to change notification settings - Fork 775
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 raw objects should be sent as custom properties #1099
Instrumentation raw objects should be sent as custom properties #1099
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1099 +/- ##
=======================================
Coverage 74.48% 74.48%
=======================================
Files 223 223
Lines 6345 6350 +5
=======================================
+ Hits 4726 4730 +4
- Misses 1619 1620 +1
|
@@ -48,6 +48,7 @@ public override void OnStartActivity(Activity activity, object payload) | |||
|
|||
activity.SetKind(ActivityKind.Client); | |||
activity.DisplayName = grpcMethod?.Trim('/'); | |||
activity.SetCustomProperty("GrpcHandler.Request", request); |
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.
Curious - do we want this to be OTel.GrpcHandler.Request
? For example, if someone is debugging a crash dump, they would get some hint that it was added by OpenTelemetry.
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.
I also think we should expose these strings as public constants in someway, part of the respective instrumentation projects, so that users dont have to remember the string property name.
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.
Agree to prefix "Otel."
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.
I added the "OTel" prefix everywhere we were calling SetCustomProperty. Moved most things to constants. But didn't tackle exposing them right now. Looked around Grpc, it doesn't have really anything that is public other than the builder extension. So we need to figure out how we want that to work. Have a constants class in each project or something? Future PR 😄
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.
It is unclear to me who is going to benefit from these constants. My take is that if the string literal is only going to show up in the repo once, twice or three times, literal string seems to provide better readability.
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.
…Blanch/opentelemetry-dotnet into instrumentation-raw-objects
We talked about this on the SIG today. Instrumentation should make the raw objects available.