Skip to content

[chore] Non-normative guidance for status metrics#2472

Merged
lmolkova merged 6 commits intoopen-telemetry:mainfrom
braydonk:status_metrics
Sep 29, 2025
Merged

[chore] Non-normative guidance for status metrics#2472
lmolkova merged 6 commits intoopen-telemetry:mainfrom
braydonk:status_metrics

Conversation

@braydonk
Copy link
Copy Markdown
Contributor

@braydonk braydonk commented Jul 3, 2025

Fixes #1554

Changes

This PR adds non-normative guidance for designing status metrics. This is a common metric pattern that has confused contributors in the past, so this document exists to clear up some misconceptions and outline a unified design plan.

Merge requirement checklist

This PR adds non-normative guidance for designing status metrics. This
is a common metric pattern that has confused contributors in the past,
so this document exists to clear up some misconceptions and outline a
unified design plan.
Copy link
Copy Markdown
Member

@joaopgrassi joaopgrassi left a comment

Choose a reason for hiding this comment

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

Thank you for putting this together!

Comment thread docs/non-normative/status-metrics.md Outdated
Comment thread docs/non-normative/status-metrics.md Outdated
@joaopgrassi
Copy link
Copy Markdown
Member

This can also close this old issue #199. CC @riverar

Comment thread docs/non-normative/status-metrics.md Outdated
Comment thread docs/non-normative/status-metrics.md Outdated
Comment thread docs/non-normative/status-metrics.md Outdated
Comment thread docs/non-normative/status-metrics.md Outdated
Comment thread docs/non-normative/status-metrics.md Outdated
@riverar
Copy link
Copy Markdown

riverar commented Jul 15, 2025

This can also close this old issue #199. CC @riverar

Can you elaborate on this? I read the document and didn't really come away with any clarity with regards to my very specific desktop app monitoring scenario. Maybe I missed something?

@ChrsMark
Copy link
Copy Markdown
Member

Hey @braydonk, any updates on this? It's currently blocking related progress i.e. #2488, so it'd be nice to move this guidance forward.

@joaopgrassi
Copy link
Copy Markdown
Member

joaopgrassi commented Aug 28, 2025

This can also close this old issue #199. CC @riverar

Can you elaborate on this? I read the document and didn't really come away with any clarity with regards to my very specific desktop app monitoring scenario. Maybe I missed something?

Well, in your original issue you described the need to observe/monitor the state/heartbeat of an app. This now described a state metric which basically can be used to report a boolean state 1/0/on/off using an UpDownCounter.

@riverar
Copy link
Copy Markdown

riverar commented Aug 28, 2025

@joaopgrassi Agreed. Took a look at it again this morning with fresh eyes and it makes sense to me. Thank you!

@braydonk
Copy link
Copy Markdown
Contributor Author

Summer busy-ness and other fires to put out has forced me to push this off for longer than I meant to. I still intend to come back and clean this up based on review comments.

Comment thread docs/non-normative/how-to-write-conventions/status-metrics.md
Copy link
Copy Markdown
Member

@ChrsMark ChrsMark left a comment

Choose a reason for hiding this comment

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

Thank's for putting this together!

@joaopgrassi joaopgrassi moved this from Untriaged to Awaiting codeowners approval in Semantic Conventions Triage Sep 15, 2025
Copy link
Copy Markdown
Member

@joaopgrassi joaopgrassi left a comment

Choose a reason for hiding this comment

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

non blocking comment

Comment thread docs/non-normative/how-to-write-conventions/status-metrics.md Outdated
@github-project-automation github-project-automation Bot moved this from Awaiting codeowners approval to Needs More Approval in Semantic Conventions Triage Sep 15, 2025
Comment thread docs/non-normative/how-to-write-conventions/status-metrics.md Outdated
@lmolkova lmolkova requested a review from Copilot September 15, 2025 11:22
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces non-normative guidance for designing status metrics in the OpenTelemetry semantic conventions. The document aims to clarify common misconceptions and provide a unified design approach for metrics that represent entities in specific states.

Key changes:

  • Creates a new guidance document defining "status metrics" and their design patterns
  • Establishes conventions for instrument type, naming, and attribute usage
  • Provides clarification on when to use entity attributes vs. status metrics

Comment thread docs/non-normative/how-to-write-conventions/status-metrics.md Outdated
Comment thread docs/non-normative/how-to-write-conventions/status-metrics.md
Comment thread docs/non-normative/how-to-write-conventions/status-metrics.md Outdated
Comment thread docs/non-normative/how-to-write-conventions/status-metrics.md
Comment thread docs/non-normative/how-to-write-conventions/status-metrics.md
Comment thread docs/non-normative/how-to-write-conventions/status-metrics.md Outdated
Comment thread docs/non-normative/how-to-write-conventions/status-metrics.md
@lmolkova lmolkova moved this from Needs More Approval to Ready to be Merged in Semantic Conventions Triage Sep 22, 2025
@github-project-automation github-project-automation Bot moved this from Ready to be Merged to Needs More Approval in Semantic Conventions Triage Sep 22, 2025
@kamphaus kamphaus moved this from Needs More Approval to Ready to be Merged in Semantic Conventions Triage Sep 22, 2025
@lmolkova lmolkova enabled auto-merge September 22, 2025 15:25
@SylvainJuge
Copy link
Copy Markdown
Contributor

When building "JMX state metrics" in Java instrumentation we took inspiration from the hw.status metric defined in hardware semantic conventions, once this recommendation is merged it would be beneficial to also rename hw.status to hw.state to prevent future inconsistencies.

I am not aware of any other similar status metric elsewhere, but my knowledge is quite limited here so maybe an exhaustive review would be needed to identify other candidates for alignment.

@braydonk
Copy link
Copy Markdown
Contributor Author

Once this recommendation is merged it would be beneficial to also rename hw.status to hw.state to prevent future inconsistencies.

*.status as the metric name and *.state as the attribute name is actually what is written as the guidance here; hw.status is matching the written guidance here. The upcoming metric process.status will use this as well. Other examples of this metric pattern exist in k8s.* but there is lots of existing verbiage there that is used instead.

@SylvainJuge
Copy link
Copy Markdown
Contributor

*.status as the metric name and *.state as the attribute name is actually what is written as the guidance here; hw.status is matching the written guidance here. The upcoming metric process.status will use this as well. Other examples of this metric pattern exist in k8s.* but there is lots of existing verbiage there that is used instead.

My bad, I should have paid more attention while reading it. The good news is that there is nothing to change then, maybe as a follow-up adding a link from hw.status metric to this recommendation would be beneficial.

@jsuereth jsuereth moved this from Needs More Approval to Ready to be Merged in Semantic Conventions Triage Sep 25, 2025
@lmolkova lmolkova added this pull request to the merge queue Sep 29, 2025
Merged via the queue into open-telemetry:main with commit 98de3da Sep 29, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Create guideline for modeling state and phase as metrics