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 basic prometheus metrics #624

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Thor77
Copy link

@Thor77 Thor77 commented Feb 18, 2023

This is a quick draft for adding some basic Prometheus metrics at /metrics if the -metrics flag is passed.

If you're open to adding metrics in general I would add some more metrics for the remaining error conditions and hook execution time.

In case you don't like the addition of all those dependencies I could also switch the implementation to use https://github.com/VictoriaMetrics/metrics which doesn't have as many useful features but is also a lot smaller.

Current custom metrics example:

# HELP webhook_hook_errors_total Total number of hook errors
# TYPE webhook_hook_errors_total counter
webhook_hook_errors_total{error="rules",hook="deploy"} 1
# HELP webhook_hook_requests_total Total number of hook requests
# TYPE webhook_hook_requests_total counter
webhook_hook_requests_total{hook="deploy"} 3
# HELP webhook_hook_success_total Total number of successful hook executions
# TYPE webhook_hook_success_total counter
webhook_hook_success_total{hook="deploy"} 2

Solves #527

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.

1 participant