-
Notifications
You must be signed in to change notification settings - Fork 57
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
update opentelemetry SDK to 1.11.2 #138
Conversation
Build is broken at this point. Time to fix up the changes in OTel.
Updates all callsites and variable names to keep up with OTel.
The OTel spec does not support grpc:// or any way to deterministically demand gRPC via the endpoint URI, preferring OTEL_EXPORTER_PROTOCOL to do so. This is awkward for otel-cli so we break with the spec. otel-cli will only resolve http(s):// to HTTP protocols, defaults bare host:port to gRPC, and supports grpc:// to definitely use gRPC to connect out. This commit adds grpc:// support while working out snags around URI handling. In particular, subprocesses of otel-cli will no longer see otel-cli configuration envvars in their environment, because they are deleted at config time. This might be a little annoying when otel-cli is chained, e.g. `otel-cli exec -- otel-cli status` but that seems to be a rare usecase that can also use `otel-cli --endpoint`. It /might/ break some folks using otel-cli to execute subtasks that also want to access the OTel envvars. My guess is that this is rare to nonexistent. It might not be a bad idea to add an option to propagate envvar configs through to subprocesses, but I'm going to wait for someone to ask.
Hoping this clears an error with one of its dependencies.
This reverts commit af79dec.
// gRPC via the endpoint URI, preferring OTEL_EXPORTER_PROTOCOL to do so. This is | ||
// awkward for otel-cli so we break with the spec. otel-cli will only resolve | ||
// http(s):// to HTTP protocols, defaults bare host:port to gRPC, and supports | ||
// grpc:// to definitely use gRPC to connect out. |
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 func didn't change much except for this part. I was annoyed it was below the helpers it calls (they were added in a contributed PR a while ago) so I moved it back to the top.
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 like no functional change at all, just added the above comment and moved the function
|
||
* bare `host:port` endpoints are assumed to be gRPC | ||
* `grpc://` URIs are supported | ||
* `http://` and `https://` are assumed to be HTTP _only_ (the spec reuses them for gRPC) |
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.
Can you please confirm that it's still about OTLP/gRPC and not OTLP/HTTP protocol (see OTEL_EXPORTER_OTLP_PROTOCOL
).
I'm referring to the exporter specification https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options
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 see there is also another comment that should be addressed before merging.
@@ -65,6 +66,7 @@ func (cs *Server) ServeGPRC(listener net.Listener) error { | |||
// ListenAndServeGRPC starts a TCP listener then starts the GRPC server using | |||
// ServeGRPC for you. | |||
func (cs *Server) ListenAndServeGPRC(otlpEndpoint string) { | |||
otlpEndpoint = strings.TrimPrefix(otlpEndpoint, "grpc://") |
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.
might be worth a comment here mentioning the docs/spec
// gRPC via the endpoint URI, preferring OTEL_EXPORTER_PROTOCOL to do so. This is | ||
// awkward for otel-cli so we break with the spec. otel-cli will only resolve | ||
// http(s):// to HTTP protocols, defaults bare host:port to gRPC, and supports | ||
// grpc:// to definitely use gRPC to connect out. |
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 like no functional change at all, just added the above comment and moved the function
Updates the OTel SDK to 1.11.2.
This upgrade forced a couple changes that need thinking through.
grpc://
URI for deterministically asking for gRPC in an endpoint config (not in the spec)http://
orhttps://
URIs (spec allows this, otel-cli does not)Solves: #136
Supercedes: #113 #131 #132 #133
Beyond that, I reordered functions in plumbing.go so initTracer() is at the top again and added godoc to the helpers. Also beefed up localhost detection a touch to avoid a lookup for
localhost
,127.0.0.1
, and::1
. Also adjusted tests to not rely on config envvars showing up inotel-cli status
orotel-cli exec
's children.