open-telemetry / open-telemetry/opentelemetry-python
Getting exception while using PeriodicExportingMetricReader from export library
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.6k
- Forks
- 1k
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 19
Description
Hi Team,
After importing following
**from opentelemetry.sdk.metrics.export import (
ConsoleMetricExporter,
PeriodicExportingMetricReader,
metric_reader = PeriodicExportingMetricReader(OTLPMetricExporter(endpoint="http://localhost:4317/", insecure=True), export_interval_millis=60000)**
getting following exception every 60 seconds. Though its not impacting functionality and able to export metrics successfully, but still getting following error in logs.
Exception: Invalid type <class 'NoneType'> of value None
File "/usr/local/lib/python3.8/dist-packages/opentelemetry/exporter/otlp/proto/grpc/exporter.py", line 299, in _translate_attributes
Could you please help here, what could be wrong in configuration ?
Thanks.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the periodic export with PeriodicExportingMetricReader and OTLPMetricExporter, then inspect _translate_attributes in opentelemetry/exporter/otlp/proto/grpc/exporter.py around the reported exception. Compare the exporter logs with the successful metric export and trace the None value to its source. Done means periodic exports remain successful without the recurring exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- observability
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100