Skip to content

Prometheus exporter for PromQL endpoints (replacing federation and remote-write)

License

Notifications You must be signed in to change notification settings

samber/promql-exporter

Repository files navigation

PromQL Exporter

tag Go Version GoDoc Build Status Go report Coverage Contributors License

A Prometheus Exporter for PromQL-compatible endpoints

Some cloud providers do not offer federation endpoint or remote write. This exporter aims to export metrics using the /query API endpoint.

🚀 Run

Using Docker:

docker run --rm -it -p 9517:9517 -e ENDPOINT=http://demo.robustperception.io:9090 samber/promql-exporter:v0.1.0

Or using a binary:

wget -O promql_exporter https://github.com/samber/promql-exporter/releases/download/v0.1.0/promql_exporter_0.1.0_linux_amd64
chmod +x promql_exporter
./promql_exporter --endpoint xxxx --header 'x-token: yyyy' --header 'x-token: zzzz'

💡 Usage

./promql_exporter
usage: promql_exporter --endpoint=http://demo.robustperception.io:9090 [<flags>]

Flags:
  -h, --help                           Show context-sensitive help (also try --help-long and --help-man).
      --endpoint                       PromQL http endpoint ($ENDPOINT)
      --header                         PromQL http header ($HEADER)
      --namespace="promql"             Namespace for metrics ($PROMQL_EXPORTER_NAMESPACE)
      --web.listen-address=":9517"     Address to listen on for web interface and telemetry. ($PROMQL_EXPORTER_WEB_LISTEN_ADDRESS)
      --web.telemetry-path="/metrics"  Path under which to expose metrics. ($PROMQL_EXPORTER_WEB_TELEMETRY_PATH)
      --log.format="txt"               Log format, valid options are txt and json ($PROMQL_EXPORTER_LOG_FORMAT)
      --version                        Show application version.

🤝 Contributing

Don't hesitate ;)

# Install some dev dependencies
make tools

# Run tests
make test
# or
make watch-test

👤 Contributors

Contributors

💫 Show your support

Give a ⭐️ if this project helped you!

GitHub Sponsors

📝 License

Copyright © 2024 Samuel Berthe.

This project is MIT licensed.