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

Expose HTTP endpoint for metrics scraping (Prometheus) #89

Closed
edevil opened this issue Oct 15, 2020 · 1 comment · Fixed by #90
Closed

Expose HTTP endpoint for metrics scraping (Prometheus) #89

edevil opened this issue Oct 15, 2020 · 1 comment · Fixed by #90
Milestone

Comments

@edevil
Copy link
Contributor

edevil commented Oct 15, 2020

Metrics were added in #67 and a Prometheus sink is supported to collect them. However, we have no way to scrape them from the ESM application.

The usual way this is done is by configuring Prometheus to scrape an HTTP endpoint of the application that exposes these metrics on a certain path, but ESM has no such endpoint. There is also the pushgateway approach but a PrometheusPushSink is not configured and is also not the recommended approach as seen here https://prometheus.io/docs/practices/pushing/.

The telemetry lib being used is the one from Consul, but in this case the agent has an http endpoint and exposes the metrics here https://github.com/hashicorp/consul/blob/1b413b0444fe91a30bf18989fe8c668a767c9c8a/agent/agent_endpoint.go#L151. I propose that we make ESM export an http interface just for collecting metrics when Prometheus telemetry is enabled (prometheus_retention_time > 0).

@lornasong
Copy link
Member

@edevil thanks for writing this up and the helpful information around PrometheusSink and push gateway. I think your proposal of exposing a metrics endpoint when Prometheus is enabled sounds like a good idea. It'll be helpful for our community members who also use Prometheus!

@lornasong lornasong linked a pull request Nov 6, 2020 that will close this issue
@lornasong lornasong added this to the 0.5.0 milestone Dec 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants