opentelemetry-collector icon indicating copy to clipboard operation
opentelemetry-collector copied to clipboard

Handling GRPC errors in the OTLPHTTP receiver

Open joe-elliott opened this issue 2 years ago • 2 comments

Describe the bug This is something between a question and a bug report. While attempting to return 429 through the otlphttp receiver I came across these lines of code:

https://github.com/open-telemetry/opentelemetry-collector/blob/d7b49df5d9e922df6ce56ad4b64ee1c79f9dbdbe/receiver/otlpreceiver/otlphttp.go#L37-L40

It seems like all errors from the traces receiver is automatically translated to a 500. Should this attempt to translate GRPC error codes to http error codes? e.g. ResourceExhausted -> 429?

Steps to reproduce Return a ResourceExhausted error to the otlp http receiver.

What did you hope to see? OTLPHTTP receiver return a 429

What did you see instead? OTLPHTTP receiver returned a 500.

What version did you use? Version: 0.86.0

What config did you use? Config:

receivers:
  otlp:
    protocols:
      http:
exporters:
  otlp:
    endpoint: <some other location>:4318
service:
  pipelines:
    traces:
      receivers: [otlp]
      exporters: [otlp]

Environment Ubuntu 20.04

Additional context

joe-elliott avatar Oct 12 '23 12:10 joe-elliott