metrics-rs / metrics

A metrics ecosystem for Rust.
MIT License
1.1k stars 151 forks source link

push-gateway does not support passing authentication information #365

Closed JasonLi-cn closed 1 year ago

JasonLi-cn commented 1 year ago

https://github.com/metrics-rs/metrics/blob/8e2e39df52c911563c7f38937b31f2f4c6e28cba/metrics-exporter-prometheus/src/builder.rs#L65

Currently, pus-gateway only supports passing uri and interval, but not username and password.

dzmitry-lahoda commented 1 year ago

yeah, better have HTTPs support and support for default format for push in grafana cloud

API_KEY="<USER>:<TOKEN>"
URL="https://influx-prod-10-prod-us-central-0.grafana.net/api/v1/push/influx/write"

curl -X  POST -H  "Authorization: Bearer $API_KEY" -H  "Content-Type: text/plain" "$URL" -d "test,bar_label=abc,source=grafana_cloud_docs metric=35.2"
tobz commented 1 year ago

Addressed via #366.