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

Add sources reachability metrics #76

Merged
merged 1 commit into from
Apr 19, 2024
Merged

Add sources reachability metrics #76

merged 1 commit into from
Apr 19, 2024

Conversation

SuperQ
Copy link
Owner

@SuperQ SuperQ commented Apr 19, 2024

Compute two reachability metrics from the "Reachability" bitmask.

  • Count the number of 1s in the bitmask as the polling success ratio.
  • Expose the right most bit as the "last reach success"

Fixes: #75

Compute two reachability metrics from the "Reachability" bitmask.
* Count the number of 1s in the bitmask as the polling success ratio.
* Expose the right most bit as the "last reach success"

Fixes: #75

Signed-off-by: SuperQ <superq@gmail.com>
@SuperQ
Copy link
Owner Author

SuperQ commented Apr 19, 2024

👓 @hhoffstaette

@hhoffstaette
Copy link
Contributor

First of all thanks a lot 🙌
When I filed the issue I wasn't really sure if this made sense at all, but it looks like the two derived values will be useful.
Give me a minute to build & test. 🚧

@hhoffstaette
Copy link
Contributor

So this looks like it's working:

All in sync:

$curl -s http://localhost:9123/metrics | grep -v '^#' | grep reach
chrony_sources_reachability_ratio{source_address="192.168.100.200",source_name="bifrost,bifrost.applied-asynchrony.com"} 1
chrony_sources_reachability_success{source_address="192.168.100.200",source_name="bifrost,bifrost.applied-asynchrony.com"} 1

Pulled network cable and sent bursts to trigger failing updates:

$curl -s http://localhost:9123/metrics | grep -v '^#' | grep reach
chrony_sources_reachability_ratio{source_address="192.168.100.200",source_name="bifrost,bifrost.applied-asynchrony.com"} 0.625
chrony_sources_reachability_success{source_address="192.168.100.200",source_name="bifrost,bifrost.applied-asynchrony.com"} 0

Neat! 👍

Copy link
Contributor

@hhoffstaette hhoffstaette left a comment

Choose a reason for hiding this comment

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

Works for me!

@SuperQ SuperQ merged commit 5348d42 into main Apr 19, 2024
5 checks passed
@SuperQ SuperQ deleted the superq/last_reach branch April 19, 2024 20:46
SuperQ added a commit that referenced this pull request Apr 22, 2024
* [FEATURE] Add sources reachability metrics #76

Signed-off-by: SuperQ <superq@gmail.com>
@SuperQ SuperQ mentioned this pull request Apr 22, 2024
SuperQ added a commit that referenced this pull request Apr 22, 2024
* [FEATURE] Add sources reachability metrics #76

Signed-off-by: SuperQ <superq@gmail.com>
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 server reachability
2 participants