-
Notifications
You must be signed in to change notification settings - Fork 11
WIP: Start drafting an otel opentracing plugin. #158
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
base: release-19.0-github
Are you sure you want to change the base?
WIP: Start drafting an otel opentracing plugin. #158
Conversation
Signed-off-by: Arthur Schreiber <[email protected]>
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.
Pull Request Overview
This PR adds an OpenTelemetry-based OpenTracing bridge plugin for Vitess tracing and updates module dependencies accordingly.
- Implements a new
newOtelTracer
factory that wires OTLP exporter, tracer provider, and OpenTracing bridge - Registers the plugin under
tracingBackendFactories["opentracing-otel"]
- Bumps and adds required OpenTelemetry and related dependencies in
go.mod
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
go/trace/plugin_otel.go | Introduces OTEL tracer provider, OTLP exporter, and OpenTracing bridge with cleanup logic |
go.mod | Upgrades existing dependencies and adds OpenTelemetry modules |
Comments suppressed due to low confidence (2)
go/trace/plugin_otel.go:42
- There are no tests covering the
newOtelTracer
initialization or its integration into the tracing registry. Consider adding unit tests to verify correct exporter setup, propagator configuration, and error paths.
func newOtelTracer(serviceName string) (tracingService, io.Closer, error) {
go/trace/plugin_otel.go:113
- [nitpick] The field name
bridgeTracer
mirrors its type and may be redundant. Consider renaming to something more concise (e.g.,tracerBridge
or simplytracer
) to improve readability.
bridgeTracer *otelBridge.BridgeTracer
otelTracer := otel.Tracer(serviceName) | ||
|
||
// Create a Bridge tracer that supports both OpenTracing and OpenTelemetry | ||
bridgeTracer, _ := otelBridge.NewTracerPair(otelTracer) |
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.
The error from otelBridge.NewTracerPair
is currently ignored. You should capture and handle this error to avoid silent failures during tracer initialization.
bridgeTracer, _ := otelBridge.NewTracerPair(otelTracer) | |
bridgeTracer, err := otelBridge.NewTracerPair(otelTracer) | |
if err != nil { | |
return nil, &nilCloser{}, err | |
} |
Copilot uses AI. Check for mistakes.
// TODO: Add support for specifying other protocols via a flag | ||
client := otlptracehttp.NewClient() |
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.
Leaving a TODO without a tracking issue or implementation plan may get lost. Either implement protocol selection via flags now or reference a GitHub issue to track this work.
// TODO: Add support for specifying other protocols via a flag | |
client := otlptracehttp.NewClient() | |
// Determine the protocol to use based on the flag | |
var client otlptrace.Client | |
switch protocol { | |
case "http": | |
client = otlptracehttp.NewClient() | |
case "grpc": | |
client = otlptracegrpc.NewClient() | |
default: | |
return nil, &nilCloser{}, fmt.Errorf("unsupported protocol: %s", protocol) | |
} |
Copilot uses AI. Check for mistakes.
Signed-off-by: Arthur Schreiber <[email protected]>
Description
Related Issue(s)
Checklist
Deployment Notes