Check out our shiny new metrics engine: Feature preview: Custom metrics
We have a chunky Prometheus (well, VictoriaMetrics) cluster with all kinds of useful application metrics. It’s what powers the graphs on our web UI, but there’s a bunch more in there.
You can use these with Grafana to make neat dashboards, alert on metrics, etc.
We’re working up a prebuild Grafana dashboard with some interesting graphs, but if you want to try it out before instructions examples, you should!
API Details
- The Prometheus API is available at
https://api.fly.io/prometheus/api/v1/
- Send an
Authorization: Bearer <TOKEN>
to authenticate (you can runflyctl auth token
to get your token) - Run some queries
Grafana Cloud Setup
If you don’t have Grafana yet, the free Grafana Cloud plan will work fine for this: Grafana Cloud | Observability platform overview
Once you’re in your spiff new Grafana instance, add a Prometheus source like so (note the URL and “Custom HTTP Headers” section:
From there, you can create a Dashboard, then add a Panel. Try a query like this:
sum(rate(edge_http_responses_count{app="<APP NAME>"}[$__interval])) by (status)
Series and Labels
We’ve exposed a bunch of different series, you will need to supply an app="<NAME>"
argument to each. Here’s a quick list:
// responses from load balancer
edge_http_responses_count
edge_http_response_time_seconds_bucket
// connections to anycast IPs
edge_tcp_connects_count
edge_tcp_disconnects_count
// responses from app vms using http handler
app_http_responses_count
app_http_response_time_seconds_bucket
app_local_connect_time_seconds_bucket
// tcp connections to app vms
app_local_connects_count
app_local_disconnects_count
// data out through load balancer
anycast_data_out
anycast_data_in
// vm memory metrics
firecracker_vm_memory_buffers
firecracker_vm_memory_cached
firecracker_vm_memory_mem_free
firecracker_vm_memory_mem_available
firecracker_vm_memory_mem_total
firecracker_vm_memory_swap_cached
firecracker_vm_memory_vmalloc_used
firecracker_vm_memory_active
firecracker_vm_memory_inactive
// other vm metrics
firecracker_vm_cpu
firecracker_vm_load_average
firecracker_vm_net_sent_bytes
firecracker_vm_disk_time_io
// network interface metrics
node_network_transmit_bytes
node_network_receive_bytes
Give it a try, let us know what you think.
Known missing pieces
We’re missing a few features to really make Grafana nice:
- Support for autocomplete in queries. This will be fixed before we officially™️ ship this.
- Querying metrics for multiple apps: right now, queries need to include an app name, there’s no way to get metrics that combine apps.