Skip to content

feat: add support for metric data-point flags#4916

Open
herin049 wants to merge 2 commits intoopen-telemetry:mainfrom
herin049:feat/datapoint-flags
Open

feat: add support for metric data-point flags#4916
herin049 wants to merge 2 commits intoopen-telemetry:mainfrom
herin049:feat/datapoint-flags

Conversation

@herin049
Copy link

Description

Adds support for metric data-point flags per the OpenTelemetry metric data model: https://opentelemetry.io/docs/specs/otel/metrics/data-model/#data-point-flags

Fixes #4726

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Relevant unit tests have been added/updated to test the added features.

Does This PR Require a Contrib Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@herin049 herin049 requested a review from a team as a code owner February 17, 2026 04:10
min: float
max: float
exemplars: Sequence[Exemplar] = field(default_factory=list)
flags: DataPointFlags = DEFAULT_DATA_POINT_FLAGS
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is why the public-symbols-check fails but it should be fine with the defined default.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is complaining because specifically the order of these fields are changing (which I've opted to do for consistency). I can move it back, but then the argument order will be inconsistent between the different data-point types. Do we want to just label this as a breaking change?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

label this as a breaking change?

I say do it!

flags=0,
min=min_,
max=max_,
# FIXME: Find the right value for flags
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the new get_default, are the Fixme still needed?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if there is additional work to be done here for determining what exactly the flags should be set to, so I have opted to leave the comment here.

Copy link
Member

@MikeGoldsmith MikeGoldsmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍🏻

positive=Buckets(offset=6, bucket_counts=[7, 8]),
negative=Buckets(offset=9, bucket_counts=[10, 11]),
flags=12,
flags=DataPointFlags.get_default(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a mixture of DataPointFlags.DEFAULT and DataPointFlags.get_default() in this file, can we consolidate onto the new version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable support for data point flags

3 participants

Comments