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 metric successful_config_load #413

Merged
merged 6 commits into from
Feb 4, 2019

Conversation

ev1lm0nk3y
Copy link
Contributor

No description provided.

config/config.go Outdated Show resolved Hide resolved
config/config.go Outdated Show resolved Hide resolved
config/config.go Outdated Show resolved Hide resolved
@SuperQ
Copy link
Member

SuperQ commented Feb 1, 2019

I might also introduce a counter for counting all config load errors. blackbox_exporter_config_load_errors_total.

@brian-brazil
Copy link
Contributor

I'm not sure that is useful, however Prometheus has a prometheus_config_last_reload_success_timestamp_seconds

- Adds Namespace to prometheus metric
- metric name more in line with prometheus standards
- move metric Set() into a defer block

Signed-off-by: Ryan Shatford <[email protected]>
@ev1lm0nk3y
Copy link
Contributor Author

I agree that the errors_total is not that useful, but I'm not sure about the timestamp_seconds either. I was thinking about adding that metric, but then I read https://godoc.org/github.com/prometheus/client_golang/prometheus#NewMetricWithTimestamp and decided against it.

@brian-brazil
Copy link
Contributor

timestamp_seconds would have the value of the time, not a metric timestamp.

@ev1lm0nk3y
Copy link
Contributor Author

ah, the timestamp of the last successful reload. I've added that metric and cleaned up the code a bit more

config/config.go Outdated Show resolved Hide resolved
Signed-off-by: Ryan Shatford <[email protected]>
@ev1lm0nk3y
Copy link
Contributor Author

yup, i just realized that. should be fixed now.

Signed-off-by: Ryan Shatford <[email protected]>
config/config.go Outdated Show resolved Hide resolved
config/config.go Outdated Show resolved Hide resolved
Also move the init() func to under the var block

Signed-off-by: Ryan Shatford <[email protected]>
@brian-brazil brian-brazil merged commit d47e1ee into prometheus:master Feb 4, 2019
@brian-brazil
Copy link
Contributor

Thanks!

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.

3 participants