-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
stats/opentelemetry: Introduce Tracing API #7852
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7852 +/- ##
==========================================
+ Coverage 82.09% 82.25% +0.16%
==========================================
Files 379 387 +8
Lines 38261 39041 +780
==========================================
+ Hits 31409 32114 +705
- Misses 5549 5595 +46
- Partials 1303 1332 +29
|
@aranjans please update this with latest main branch to get rid of all go.mod and go.sum changes |
378ddd3
to
8cb8222
Compare
@purnesh42H Thanks for your review, I have addressed all your comments and this PR is ready for another pass. |
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.
Some more non-test comments. Will review tests in next pass
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.
Some more non-test comments. Will review tests in next pass
@aranjans you should link the gRFC and concise your description |
@purnesh42H I have addressed all the comments, and updated the description to link the grfc proposal. |
@purnesh42H I have addressed all your comments, and updated the PR. Kindly review the 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.
Just a few more small things otherwise LGTM
case *stats.End: | ||
if rs.Error != nil { | ||
s := status.Convert(rs.Error) | ||
span.SetStatus(otelcodes.Error, s.Message()) |
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 seems there is missing coverage for this (RPC error) and PickerUpdated
- could you add test cases for them, please?
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.
@dfawley I have added the test for rpc error, PTAL.
@@ -87,6 +88,12 @@ func (h *clientStatsHandler) unaryInterceptor(ctx context.Context, method string | |||
} | |||
} | |||
|
|||
// Log an error if one of the options is missing. | |||
if (h.options.TraceOptions.TextMapPropagator == nil) != (h.options.TraceOptions.TracerProvider == nil) { |
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.
This check should happen in the constructor for the otel plugin. Not on every RPC.
stats/opentelemetry/opentelemetry.go
Outdated
) | ||
|
||
func init() { | ||
otelinternal.SetPluginOption = func(o *Options, po otelinternal.PluginOption) { | ||
o.MetricsOptions.pluginOption = po | ||
// Log an error if one of the options is missing. | ||
if (o.TraceOptions.TextMapPropagator == nil) != (o.TraceOptions.TracerProvider == nil) { | ||
logger.Error("traceOptions are not set properly: one of TextMapPropagator or TracerProvider is missing.") |
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.
This pull request adds the OpenTelemetry tracing API to the grpc-go opentelemetry plugin as outlined in proposal A72.
RELEASE NOTES:
stats/opentelemetry/experimental
. This includes the addition ofTraceOptions
in theOptions
struct to allow users to specify theTraceProvider
andTextMapPropagator
.