Skip to content

Improve error logging for OTLP gRPC exporter #4393

@dashpole

Description

@dashpole

Is your feature request related to a problem?

I used the gRPC exporter, and it failed to export to my backend (this was my fault). I got the following error, even when debug logging was enabled:

ERROR:opentelemetry.exporter.otlp.proto.grpc.exporter:Failed to export metrics to <endpoint>, error code: StatusCode.INVALID_ARGUMENT

It looks like the error message is not being logged here:

logger.error(
"Failed to export %s to %s, error code: %s",
self._exporting,
self._endpoint,
error.code(),
exc_info=error.code() == StatusCode.UNKNOWN,
)

Describe the solution you'd like

I would like to log the error's details.

Describe alternatives you've considered

No response

Additional Context

This may also apply to the trace or log grpc exporter. I haven't checked

Would you like to implement a fix?

No

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions