Skip to content

Fix duplicate metrics in openstack_nova_quota* and openstack_neutron_quota*#513

Open
EnDjeee wants to merge 5 commits intoopenstack-exporter:mainfrom
EnDjeee:fix/nova-neutron-quotas-metric-collection
Open

Fix duplicate metrics in openstack_nova_quota* and openstack_neutron_quota*#513
EnDjeee wants to merge 5 commits intoopenstack-exporter:mainfrom
EnDjeee:fix/nova-neutron-quotas-metric-collection

Conversation

@EnDjeee
Copy link
Copy Markdown

@EnDjeee EnDjeee commented Nov 24, 2025

This PR addresses issue #492, where the exporter failed to collect nova_quota* and neutron_quota* metrics due to duplicate metric names

The fix adds tenant_id to the metric descriptors in both the Nova and Neutron quota exporters, ensuring the metrics are uniquely identified and no longer conflict.

Tested locally and confirmed the exporter works as expected.

@Sharpz7
Copy link
Copy Markdown
Collaborator

Sharpz7 commented Nov 27, 2025

Wow @EnDjeee! This is great!

I'll get it reviewed and hopefully merged soon

@Sharpz7 Sharpz7 added the priority Priority PR or Issue to help with tracking. label Nov 27, 2025
@Sharpz7 Sharpz7 requested a review from Copilot December 2, 2025 04:48
Copy link
Copy Markdown

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 fixes a critical bug where Nova and Neutron quota metrics failed to be collected due to duplicate metric descriptor errors in Prometheus. The fix adds tenant_id as an additional label to all quota metrics, ensuring each metric is uniquely identified even when tenants share the same name across different domains.

Key Changes:

  • Added tenant_id label to all Nova quota metric descriptors (14 quota types)
  • Added tenant_id label to all Neutron quota metric descriptors (9 quota types)
  • Updated metric emission calls to include project ID alongside project name

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
exporters/nova.go Added tenant_id to quota metric label definitions and updated all quota metric emissions to include p.ID
exporters/neutron.go Added tenant_id to quota metric label definitions and updated all quota metric emissions to include p.ID
exporters/nova_test.go Updated expected test output to include tenant_id label in all quota metrics
exporters/neutron_test.go Updated expected test output to include tenant_id label in all quota metrics
README.md Updated documentation examples to show the new tenant_id label in quota metrics

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@vooon vooon mentioned this pull request Dec 2, 2025
@vooon
Copy link
Copy Markdown
Contributor

vooon commented Dec 2, 2025

Oh, i ran into the same issue on my v2 branch, so i've fixed it, but a bit different in terms of code...

@Sharpz7
Copy link
Copy Markdown
Collaborator

Sharpz7 commented Dec 3, 2025

@vooon i.e. you've fixed this in your re-write PR? I'm aware of the fact that your rewrite is getting very large. In this case, I'm not against merging it, just thinking we'll want to test it extensively before merging

@vooon
Copy link
Copy Markdown
Contributor

vooon commented Dec 4, 2025

@Sharpz7 yes. But if you wish to release 1.8.0 first, then better if you merge this PR, then i'll update v2 branch.
And yes, v2 needs to be tested on more clouds, as mine limited just to keystone-nova-neutron-glance-ironic.

@Sharpz7
Copy link
Copy Markdown
Collaborator

Sharpz7 commented Dec 4, 2025

I am happy not releasing v1.8.0 for a while while we stabilize the codebase. We can work on testing in more substacks.

@vooon
Copy link
Copy Markdown
Contributor

vooon commented Dec 5, 2025

@Sharpz7 just considering amount of changes, perhaps better to release v2 as 2.0.0, even though it remains compatible...
At the same time, go would require to do a lot of changes for major bump.

@Sharpz7
Copy link
Copy Markdown
Collaborator

Sharpz7 commented Dec 5, 2025

@vooon I am open to that. @niedbalski @mnaser ?

@Sharpz7 Sharpz7 removed the priority Priority PR or Issue to help with tracking. label Mar 3, 2026
@Sharpz7 Sharpz7 added the duplicate This issue or pull request already exists label Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

duplicate This issue or pull request already exists

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants