open-telemetry / open-telemetry/opentelemetry-python

Improve error logging for OTLP gRPC exporter

Open Beginner friendly
#4,393 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

feature-request
Dominant language
Python
Stars
2.6k
Forks
1k
Avg merge
4d 15h
Merged PRs (30d)
19

Description

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:

https://github.com/open-telemetry/opentelemetry-python/blob/58f2d161d4b772ce6e62d9f40ba9de16445f4193/exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/exporter.py#L341-L347

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/exporter.py around lines 341-347, where failed metric exports are logged. Compare the trace and log gRPC exporters as suggested, then verify that failed exports log the error details rather than only the status code.

Written by the indexing model from the issue text.

Assessment

Tech stack
grpc, python
Domain
observability
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.