I have Prometheus and Alertmanger (w/ Pusher) configured to monitor various platforms on which I deploy services and alert me if I leave resources deployed. I don’t use Grafana because I don’t need it for this use.
I’d like to include fly.io using the Prometheus endpoint but I’ve been unable to determine whether the API accepts federate|remote_read` requests.
If it’s not possible to remote_read metrics such as fly_instance_up from api.fly.io, should I write a Fly (org) metrics exporter that leverages Fly’s Go API?
I’m looking to enumerate the list of deployed apps so that I can alert on the number.
I wrote a very basic Prometheus Exporter to count apps.
Export a TOKEN
# HELP build_info A metric with a constant '1' value labeled by OS version, Go version, and the Git commit of the exporter
# TYPE build_info counter
build_info{git_commit="b6d8c2fd562e5f482e709e229af0910ce8502969",go_version="go1.18.2",os_version="5.15.32-v8+"} 1
# HELP fly_exporter_apps Total Number of Apps
# TYPE fly_exporter_apps counter
fly_exporter_apps{deployed="true",id="foo",name="foo",org_slug="personal",status="running"} 1
fly_exporter_apps{deployed="true",id="bar",name="bar",org_slug="personal",status="running"} 1
# HELP start_time Exporter start time in Unix epoch seconds
# TYPE start_time gauge
start_time 1.652975685e+09
Your curl federate example has a syntax error, the match[] should be passed as a URL parameter (not part of the path), and you need to either URL-encode all URL-unsafe chars or pass the param as url-encoded POST data, either: