Repository navigation
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2faf075f64
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
2faf075 to
a8dace6
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a8dace6c26
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
tracing.New always created a gRPC exporter. A deployment that sets OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf and points the endpoint at an OTLP/HTTP collector had every export fail, so its spans were lost. The exporter now follows OTEL_EXPORTER_OTLP_TRACES_PROTOCOL, then OTEL_EXPORTER_OTLP_PROTOCOL, and still defaults to grpc. As the OTel specification requires, values are case-insensitive, and an unsupported value such as http/json is ignored with a warning instead of failing startup. New reports ignored values by returning an error wrapping ErrUnsupportedProtocol alongside a working stop function, and cachewd and the cachew CLI print it as a warning. Signed-off-by: Ravi Agarwal <ravi@perplexity.ai> Co-authored-by: Perplexity <noreply@perplexity.ai>
a8dace6 to
3ec5047
Compare
tracing.Newalways creates a gRPC exporter, whatever the OTLP protocol variables say. WithOTEL_EXPORTER_OTLP_PROTOCOL=http/protobufand an OTLP/HTTP endpoint such ashttp://collector:4318, every export fails and the spans are dropped. When a traces endpoint is also set, the error isdial tcp: lookup tcp/4318/v1/traces: unknown port. The metrics exporter already speaks OTLP/HTTP, so a collector that only listens for HTTP gets metrics but no traces.Change
OTEL_EXPORTER_OTLP_TRACES_PROTOCOL, thenOTEL_EXPORTER_OTLP_PROTOCOL, and usesotlptracehttpforhttp/protobuf. Endpoint, headers, TLS and timeout still come from the exporter's ownOTEL_EXPORTER_OTLP_*handling.grpcas the default for backward compatibility.http/json, which the Go SDK has no exporter for, is also ignored, so a traces-specifichttp/jsonfalls through to the general variable.Newstill installs the exporter and returns a working stop function. It also returns an error that wraps the newErrUnsupportedProtocoland names each ignored variable.cachewdlogs that error as a warning and keeps starting, and thecachewCLI prints it as a warning.Behaviour changes
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuffor other services but points cachew at a gRPC endpoint now sends OTLP/HTTP to it. Such a deployment needsOTEL_EXPORTER_OTLP_TRACES_PROTOCOL=grpc.Testing
TestNewExportsHTTPTracesruns an OTLP/HTTP receiver and checks that a span reaches/v1/tracesin four cases: the general variable, a traces-specific override, an upper-case value, and an unsupported traces-specific value that falls through to the general one. The unsupported case also expectsErrUnsupportedProtocol.TestNewFallsBackToGRPCForUnsupportedProtocolchecks thathttp/jsonalone keeps the gRPC exporter, and thatNewreturns a stop function along with anErrUnsupportedProtocolerror naming the variable.tracing.go, every HTTP case fails because the receiver gets no request.Created with Perplexity