-
Notifications
You must be signed in to change notification settings - Fork 454
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
Added prometheus metrics #366
Conversation
I think by default the metrics should be disabled. We should allow to enable metrics. Some example that looks like covers my comments: https://developpaper.com/add-prometheus-monitoring-indicators-for-go-applications/ |
I will refactor to make metrics optional (feature flagged) via a command line arg (and likely an environment variable as well, for easy Kubernetes compatibility). |
We might need to discuss how to integrate this a little further - I just found another instance of NewProxy() where we don't have access to the server parent struct to get the metrics config data https://github.com/Shopify/toxiproxy/blob/master/proxy_collection.go#L97-L101 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small comments left and linting errors. Overall it looks awesome.
Implements #365
Added two different collectors for Prometheus metrics that can be enabled independently of each other with CLI flags. These metrics are served from
/metrics
HTTP api endpoint when at least one of the collectors is enabled.-runtime-metrics
These runtime metrics are 'common metrics' that come from these collectors:
-proxy-metrics
These are toxiproxy-specific metrics that expose the internal state/metrics of toxiproxy. See METRICS.md for description of these metrics.
The current proxy metrics look like this: