Skip to content

Expose alarms as Prometheus metrics #3312

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

Merged
merged 3 commits into from
Aug 17, 2021
Merged

Expose alarms as Prometheus metrics #3312

merged 3 commits into from
Aug 17, 2021

Conversation

deadtrickster
Copy link
Contributor

@deadtrickster deadtrickster commented Aug 16, 2021

Proposed Changes

This exposes alarms as Prometheus metrics

Types of Changes

What types of changes does your code introduce to this project?
Put an x in the boxes that apply

  • Bug fix (non-breaking change which fixes issue #NNNN)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause an observable behavior change in existing systems)
  • Documentation improvements (corrections, new content, etc)
  • Cosmetic change (whitespace, formatting, etc)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating
the PR. If you're unsure about any of them, don't hesitate to ask on the
mailing list. We're here to help! This is simply a reminder of what we are
going to look for before merging your code.

  • I have read the CONTRIBUTING.md document
  • I have signed the CA (see https://cla.pivotal.io/sign/rabbitmq)
  • All tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in related repositories

Further Comments

Closes #2653

@michaelklishin michaelklishin changed the title Add alarms prometheus collector. Expose alarms as Prometheus metrics Aug 17, 2021
Copy link
Collaborator

@michaelklishin michaelklishin left a comment

Choose a reason for hiding this comment

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

This works as expected but I think we can do better than "X_limit" for alarm names. Except for, perhaps, the file descriptor alarm, they do not represent limits but just watermarks.

Disk space can continue to decreased after the configured (low) watermark is crossed.

@deadtrickster
Copy link
Contributor Author

deadtrickster commented Aug 17, 2021

With names I was following the alarms names. Really straightforward mapping: {resource_limit, disk, _} -> rabbitmq_alarms_disk_limit.
That being said, these pages https://www.rabbitmq.com/memory.html and https://www.rabbitmq.com/disk-alarms.html point towards some inconsistency in naming - namely vm_memory_high_watermark.relative = 0.4 vs disk_free_limit.absolute = 1000000000.
Now I wonder if we should have these 3:

  • rabbitmq_alarms_file_descriptor_limit
  • rabbitmq_alarms_vm_memory_high_watermark
  • rabbitmq_alarms_disk_free_limit.

I.e. follow rabbitmqctl/config conventions?

@michaelklishin
Copy link
Collaborator

There is no convention around configuration setting names: they were introduced at different points without much focus on making them consistent.

I kept file_descriptor_limit as is because it's the most precise name I could think of and changed the other two to say "watermark" instead of "limit" because they both are watermarks/thresholds.

@michaelklishin michaelklishin merged commit ea75297 into master Aug 17, 2021
@michaelklishin michaelklishin deleted the alarms-metric1 branch August 17, 2021 19:16
@michaelklishin
Copy link
Collaborator

@Mergifyio backport v3.9.x v3.8.x

@mergify
Copy link

mergify bot commented Aug 17, 2021

Command backport v3.9.x v3.8.x: success

Backports have been created

michaelklishin added a commit that referenced this pull request Aug 17, 2021
Expose alarms as Prometheus metrics (backport #3312)
@michaelklishin
Copy link
Collaborator

Backported manually to v3.8.x for 3.8.25.

@michaelklishin michaelklishin added this to the 3.8.25 milestone Nov 11, 2021
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.

Expose resource alarms as Prometheus metrics
2 participants