Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle multiple aggregates properly #135

Merged
merged 1 commit into from
Aug 21, 2024

Conversation

pponnuvel
Copy link
Member

@pponnuvel pponnuvel commented Jul 29, 2024

Currently, if there are multiple aggregates present only the last one is displayed. So the current handling is broken.

This change lists them all so that it be grouped by hypervisors and/or individual aggregate type(s).

Fixes #38.

A different fix was proposed in #57.
But it joins all the aggreates together and they can't be queried, if needed, by aggregate types once joined.

To contrast,

WIth #57, it'd looks like:

hypervisor_vcpus_total{aggregate="aggregate1,different_aggregate,another_one",arch="x86_64",cloud="mycloud",hypervisor_hostname="hypervisor1",nova_service_status="enabled"} 4.0

whereas I am proposing:

hypervisor_vcpus_total{aggregate="aggregate1",arch="x86_64",cloud="mycloud",hypervisor_hostname="hypervisor1",nova_service_status="enabled"} 4.0
hypervisor_vcpus_total{aggregate="different_aggregate",arch="x86_64",cloud="mycloud",hypervisor_hostname="hypervisor1",nova_service_status="enabled"} 4.0
hypervisor_vcpus_total{aggregate="another_one",arch="x86_64",cloud="mycloud",hypervisor_hostname="hypervisor1",nova_service_status="enabled"} 4.0

This is better for querying and also has been requested by a user.

@pponnuvel
Copy link
Member Author

Looks like the master has been renamed to main and #134 was proposed against master because I had an older clone. So closed #134 and created this against main.

cc: @jneo8

jneo8
jneo8 previously approved these changes Jul 30, 2024
Copy link

@jneo8 jneo8 left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM.

@pponnuvel
Copy link
Member Author

Hi there, Is this good to merge?

@jneo8
Copy link

jneo8 commented Aug 16, 2024

Hi @pponnuvel , we need two 2 approving reviews to merge.

@Pjack
Copy link
Contributor

Pjack commented Aug 16, 2024

This exporter is only workable under old LMA stack.
Please consider to move to new openstack-exporter which is integrate with COS natively.

@pponnuvel
Copy link
Member Author

This exporter is only workable under old LMA stack. Please consider to move to new openstack-exporter which is integrate with COS natively.

Hi@Pjack, yes, I am aware openstack-exporter supersedes this, and that's been the case for some time. A user insisted that this is a bug and really keen to have this until they migrate to the openstack-exporter. So I am hoping we could get this in until users migrate.

@pponnuvel pponnuvel force-pushed the handle_multiple_aggregates_new branch from ca27966 to 392a75c Compare August 16, 2024 06:43
jneo8
jneo8 previously approved these changes Aug 16, 2024
prometheus-openstack-exporter Outdated Show resolved Hide resolved
Currently, if there are multiple aggregates present only the last
one is displayed. So the current handling is broken.

This change lists them all so that it be grouped by hypervisors and/or
individual aggregate type(s).

Fixes canonical#38.

Signed-off-by: Ponnuvel Palaniyappan <ponnuvel.palaniyappan@canonical.com>
@samuelallan72
Copy link
Contributor

Thanks @pponnuvel . There are currently no tests in CI, so I'm going to have a go at testing this manually.

@pponnuvel
Copy link
Member Author

Thanks @pponnuvel . There are currently no tests in CI, so I'm going to have a go at testing this manually.

I've tested in an environment both with & without aggregates and it's working. Please let me know if you'd like to use mine.

Copy link
Contributor

@samuelallan72 samuelallan72 left a comment

Choose a reason for hiding this comment

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

Thanks for confirming testing status. 👍

@Pjack Pjack merged commit cd4ffff into canonical:main Aug 21, 2024
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.

Multiple aggregates are not reflected. aggregate_map gets overwritten
4 participants