Skip to content
This repository has been archived by the owner on Nov 29, 2022. It is now read-only.

An exporter for HetrixTools metrics to Prometheus

License

Notifications You must be signed in to change notification settings

halkyon/prometheus-hetrixtools-exporter

Repository files navigation

prometheus-hetrixtools-exporter

prometheus-hetrixtools-exporter exports HetrixTools monitoring data to Prometheus.

Currently this exports two kinds of metrics.

An uptime status for each uptime monitor target:

hetrixtools_uptime_monitor_status{id="12345",name="my check",port="123",status_text="Online",target="1.2.3.4"} 0

TODO: This metric only accounts for "Online" status as being up, and anything else as down. It doesn't check for any scheduled maintenance, for example.

Response times from each location monitoring a target:

hetrixtools_uptime_monitor_response_time_seconds{id="12345",location="Frankfurt",name="my check",port="123",target="1.2.3.4"} 0.099
hetrixtools_uptime_monitor_response_time_seconds{id="12345",location="New York",name="my check",port="123",target="1.2.3.4"} 0.018
hetrixtools_uptime_monitor_response_time_seconds{id="12345",location="San Francisco",name="my check",port="123",target="1.2.3.4"} 0.070

Usage

API_KEY must be defined in the environment for this to work, which is your HetrixTools API key.

To run the exporter with Docker:

docker run -e API_KEY=mykey halkyon/prometheus-hetrixtools-exporter

By default the exporter will listen on all interfaces on port 8080. Use -listen-address to listen on something else.

Note that the HetrixTools free account is limited to 1000 API calls per month. If you intend to have Prometheus scrape this data on a very frequent interval, you'll need to purchase a plan that includes more API calls.

Building

goreleaser is used to automate the entire build and release process.

Everything you'll need to run a build can be installed with the following:

go install github.com/goreleaser/goreleaser@latest
go install github.com/anchore/syft@latest
go install github.com/sigstore/cosign/cmd/cosign@latest

To run a development build, run goreleaser --snapshot --rm-dist.

To release a new version, create and push the tag in the format v0.0.0. Binaries and Docker images will be built and released.