---
title: "Monitoring Elixir Apps on Fly.io With Prometheus and PromEx"
description: "Monitoring Elixir applications on Fly.io, the post presents a way to add production visibility without administering a Prometheus instance. Fly.io’s managed service scrapes an application’s metrics endpoint at a configured interval, with fly.toml specifying the port and path; Prometheus stores the resulting time-series snapshots and Grafana queries them with PromQL. PromEx supplies Elixir instrumentation through plugins for components such as the application, BEAM, Phoenix, Ecto, and Phoenix LiveView, while optionally uploading dashboards and annotating application lifecycle events through Grafana’s HTTP API. The example enables Fly.io metrics on port 4000 at /metrics and configures PromEx dashboards for a Todo List application. The stated result is an instrumented application with dashboards and annotations in minutes, while monitoring can also support rollback decisions, stress-test analysis, prioritization, and capacity planning."
---

# Monitoring Elixir Apps on Fly.io With Prometheus and PromEx

[Fly.io](https://yomu.fyi/company/fly-io) · Jun 28, 2021

**Type:** Tutorial

## Summary

Monitoring Elixir applications on Fly.io, the post presents a way to add production visibility without administering a Prometheus instance. Fly.io’s managed service scrapes an application’s metrics endpoint at a configured interval, with fly.toml specifying the port and path; Prometheus stores the resulting time-series snapshots and Grafana queries them with PromQL. PromEx supplies Elixir instrumentation through plugins for components such as the application, BEAM, Phoenix, Ecto, and Phoenix LiveView, while optionally uploading dashboards and annotating application lifecycle events through Grafana’s HTTP API. The example enables Fly.io metrics on port 4000 at /metrics and configures PromEx dashboards for a Todo List application. The stated result is an instrumented application with dashboards and annotations in minutes, while monitoring can also support rollback decisions, stress-test analysis, prioritization, and capacity planning.

## Context

The post addresses the need to detect production application errors and suboptimal behavior without exhaustively testing every API route and input permutation after each deployment. It also frames monitoring as useful for quantifying stress tests, planning business priorities from real usage data, and assessing system performance and capacity.

## Approach / What changed

Enable Fly.io’s managed Prometheus integration by declaring the metrics port and path in fly.toml, then use PromEx in the Elixir application to collect metrics through configurable plugins. PromEx can also upload selected Grafana dashboards through the Grafana HTTP API and annotate application lifecycle events when configured with Grafana host and authentication details.

## Takeaways

- Prometheus scrapes each application instance through a GET request to /metrics or another configured endpoint, so time-series resolution is limited by the scrape interval.
- PromEx uses plugins to instrument Elixir components, including the BEAM, Phoenix, Ecto, and Phoenix LiveView, and provides corresponding Grafana dashboards.
- The example exposes metrics on port 4000, configures PromEx dashboards for a Todo List application, and enables dashboard upload and lifecycle annotations at startup.

**Tags:** [Elixir](https://yomu.fyi/topic/elixir), [Fly.io](https://yomu.fyi/topic/fly-io), [Grafana](https://yomu.fyi/topic/grafana), [Monitoring](https://yomu.fyi/topic/monitoring), [Prometheus](https://yomu.fyi/topic/prometheus)

- Source: [Fly.io](https://fly.io/blog/monitoring-your-fly-io-apps-with-prometheus)
- Source URL: https://fly.io/blog/monitoring-your-fly-io-apps-with-prometheus
- Ingested by Yomu: 2026-09-03T12:00:43.354Z

[Read original post](https://fly.io/blog/monitoring-your-fly-io-apps-with-prometheus)
