Skip to content

Update service.json for new agent metrics names - #193

Open
mathmarchand wants to merge 2 commits into
canonical:mainfrom
mathmarchand:main
Open

mathmarchand wants to merge 2 commits into
canonical:mainfrom
mathmarchand:main

Conversation

@mathmarchand

Copy link
Copy Markdown

Nova, Cinder and Neutron agent metric names changed to openstack_agent_total from openstack_agent.

Nova, Cinder and Neutron agent metric names changed to openstack_<service>_agent_total.
@mathmarchand

Copy link
Copy Markdown
Author

Related to this issue .

@gabrielcocenza gabrielcocenza left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for this patch @mathmarchand. May I ask you some things?
1 - Contribute to the upstream to fix the Readme
2 - Share a print in the PR with the prometheus metrics or the dashboard properly
3 - Update the Prometheus alert rules in sunbeam. (We sync the alert rules from there)

@mathmarchand

Copy link
Copy Markdown
Author

Hi @gabrielcocenza,

Some more context, it seems that addition of _total is not from upstream openstack-exporter code.:

The Prometheus Go client library enforces the OpenMetrics specification, which requires that all counter-type metrics must end in _total. So when the metric type is declared as CounterValue, the Go client automatically appends _total to the metric name at scrape time.

This means:

The metric is defined in code as agent_state
The exporter registers it as openstack_nova_agent_state
Prometheus scrapes it as openstack_nova_agent_state_total

Basically if prometheus is on version 2.x+, the _total metric need to be used, if not the old metric need to be used. Since, the COS Lite 1/stable is EOL and we should be using 2/stable until the new LTS version is released, this _metrics is needed.

I will update the query so that it could work in both situations.

…theus

In newer version version of prometheus counter-type must end in _total.
@mathmarchand mathmarchand reopened this Apr 1, 2026
@mathmarchand

Copy link
Copy Markdown
Author

As requested, here's a output of the adjusted query in Grafana.
Screenshot from 2026-04-01 09-23-33

@Deezzir

Deezzir commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

@mathmarchand The addition of _total suffix is coming from opentelemetry-collector. We pushed the change to the collector to disable the normalization for now. Please see canonical/opentelemetry-collector-k8s-operator#238 and canonical/opentelemetry-collector-k8s-operator#232. The change you're proposing shouldn't be needed anymore.

P.S. If we merge the PR, the backward compatibility with grafana-agent will be broken.

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.

3 participants