autometrics-dev / am

Autometrics Companion CLI app
Apache License 2.0
16 stars 2 forks source link

Forward call to /metrics to pushgateway if pushgateway is enabled #63

Closed hatchan closed 1 year ago

hatchan commented 1 year ago

The call to /metrics on the am web server should proxy this call to the pushgateway /pushgateway/metrics. This payload will contain the metrics from a component that is not able to be scraped, such as a function, batch job, or a client.

Note that we cannot redirect the request since it is a POST request. Even if we were to do a 307 I'm not sure how well that is implemented in all the different languages/packages. So it is easier just to proxy it.

Related discussion: https://github.com/autometrics-dev/am/issues/60#issuecomment-1613072606