open-telemetry / open-telemetry/opentelemetry-python
Enable support for data point flags
Nobody has claimed this yet.
- 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?
OpenTelemetry supports a single data point flag; see https://opentelemetry.io/docs/specs/otel/metrics/data-model/#data-point-flags . This flag, "no recorded value," can be used by an OpenTelemetry client to mitigate an undesired behavior in older versions of Prometheus:
If this flag is set on a data point, then this data point reflects explicitly missing data in a series. It serves as an indicator that a previously present timeseries was removed and that this timeseries SHOULD NOT be returned in queries after such an indicator was received. It is an equivalent of the Prometheus staleness marker.
OpenTelemetry's Go client supports this flag (see, e.g., https://github.com/open-telemetry/opentelemetry-collector/blob/main/pdata/pmetric/metric_data_point_flags.go ), and the OpenTelemetry protobuf definition supports it as well.
The Python client recently picked up the protobuf definition for "data point flags," but so far the Python client does not expose any way (that I can see) to convince the client API to set that flag.
Describe the solution you'd like
Provide a way to set the "no record value" flag, on a metric's datapoint, via the Python API.
Describe alternatives you've considered
Can't easily switch to a different OpenTelemetry client, since the host being instrumented is written in Python.
Additional Context
No response
Would you like to implement a fix?
No
Tip
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.
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
Start with the Python metrics API and its protobuf data-point definition, then compare how the referenced Go client exposes data point flags. Trace how a metric data point is created and exported. Done means the Python API provides a way to set the “no recorded value” flag and preserves it in the exported data.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, observability-sre
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100