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

Controller metrics #132

Merged
merged 6 commits into from
Jan 20, 2022
Merged

Conversation

somnusfish
Copy link
Contributor

@somnusfish somnusfish commented Dec 15, 2021

Issue number:
#128

Description of changes:
Emitting prometheus metrics for host's bottlerocket version and host's brupop state.
Adding HTTP server in the controller to vend prometheus metrics.

Testing done:
Provisioned 5 old bottlerocket hosts in the cluster and run Brupop, curled the controller endpoint to verify the metrics.

Sample metrics during brupop updating hosts.

[ec2-user@ip-192-168-53-104 ~]$ curl 10.100.135.35/metrics
# HELP brupop_hosts_state Brupop host's state
# TYPE brupop_hosts_state gauge
brupop_hosts_state{state="Idle"} 6
brupop_hosts_state{state="MonitoringUpdate"} 1
brupop_hosts_state{state="PerformedUpdate"} 1
brupop_hosts_state{state="RebootedIntoUpdate"} 1
brupop_hosts_state{state="StagedUpdate"} 1
# HELP brupop_hosts_version Brupop host's bottlerocket version
# TYPE brupop_hosts_version gauge
brupop_hosts_version{bottlerocket_version="1.2.0"} 4
brupop_hosts_version{bottlerocket_version="1.5.1"} 2

Deployed prometheus on the cluster and use port forward to get he graphic analysis locally.

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

controller/src/controller.rs Outdated Show resolved Hide resolved
controller/src/controller.rs Outdated Show resolved Hide resolved
models/src/node/mod.rs Outdated Show resolved Hide resolved
@somnusfish
Copy link
Contributor Author

As per discussion, update the metrics from controller spec change itself to monitoring the whole state for brupop cluster.

models/src/node/mod.rs Outdated Show resolved Hide resolved
controller/Cargo.toml Outdated Show resolved Hide resolved
models/src/node/mod.rs Outdated Show resolved Hide resolved
controller/src/controller.rs Outdated Show resolved Hide resolved
controller/src/main.rs Show resolved Hide resolved
controller/src/controller.rs Outdated Show resolved Hide resolved
controller/src/metrics.rs Show resolved Hide resolved
controller/src/main.rs Show resolved Hide resolved
@somnusfish somnusfish merged commit f08cdbc into bottlerocket-os:0.2.0 Jan 20, 2022
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.

4 participants