Skip to content

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