Skip to content

OTLP/HTTP Response Failures: Clarification needed for encoding used for failures #640

@psx95

Description

@psx95

Issue

The spec for OTLP/HTTP Response Failures states that the

The response body for all HTTP 4xx and HTTP 5xx responses MUST be a Protobuf-encoded Status message that describes the problem.

This contradicts the encoding text mentioned in OTLP/HTTP Response paragraph that suggests:

The server MUST use the same "Content-Type" in the response as it received in the request.

Is this just a mistake or is there a reason as to why the response body for all HTTP 4xx and 5xx responses must be protobuf-encoded?

Consequence

The OTLP http exporters used in the OpenTelemetry Collector seem to adhere to this spec and always attempt to parse the error responses (4xx - 5xx errors) using proto.Unmarshal without checking the content-type.
This parsing fails when the server sets the content type as application/json (IIUC, the exporters should use json.Unmarshal to parse content-type application/json).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions