Skip to content

Commit efbbfa3

Browse files
docs: add observability page (#2315)
1 parent d26834c commit efbbfa3

File tree

4 files changed

+42
-1
lines changed

4 files changed

+42
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ Go to `https://localhost`, and enjoy!
168168
- [Create **standalone**, self-executable PHP apps](https://frankenphp.dev/docs/embed/)
169169
- [Create static binaries](https://frankenphp.dev/docs/static/)
170170
- [Compile from sources](https://frankenphp.dev/docs/compile/)
171-
- [Monitoring FrankenPHP](https://frankenphp.dev/docs/metrics/)
171+
- [Observability](https://frankenphp.dev/docs/observability/)
172172
- [WordPress integration](https://frankenphp.dev/docs/wordpress/)
173173
- [Symfony integration](https://frankenphp.dev/docs/symfony/)
174174
- [Laravel integration](https://frankenphp.dev/docs/laravel/)

docs/logging.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Logging
22

3+
> [!TIP]
4+
> Logging is one part of FrankenPHP's observability story. See the [Observability](observability.md) page for the full picture, including real-time monitoring and metrics.
5+
36
FrankenPHP integrates seamlessly with [Caddy's logging system](https://caddyserver.com/docs/logging).
47
You can log messages using standard PHP functions or leverage the dedicated `frankenphp_log()` function for advanced
58
structured logging capabilities.

docs/metrics.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Metrics
22

3+
> [!TIP]
4+
> For a complete observability setup including real-time dashboards and production monitoring, see the [Observability](observability.md) page.
5+
36
When [Caddy metrics](https://caddyserver.com/docs/metrics) are enabled, FrankenPHP exposes the following metrics:
47

58
- `frankenphp_total_threads`: The total number of PHP threads.

docs/observability.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Observability
2+
3+
FrankenPHP provides built-in observability features: [Prometheus-compatible metrics](metrics.md) and [structured logging](logging.md).
4+
These features, combined with the recommended tools below, give you full visibility into your PHP application's behavior in development and production.
5+
6+
## Ember TUI and Prometheus Exporter
7+
8+
[Ember](https://github.com/alexandre-daubois/ember) is the most user-friendly way to monitor FrankenPHP.
9+
10+
It connects to Caddy's admin API and deeply integrates with FrankenPHP, providing real-time visibility with zero configuration and no external infrastructure.
11+
12+
It is designed to be used in development and production, with a TUI dashboard for local use and a Prometheus export daemon mode for production monitoring.
13+
14+
> [!TIP]
15+
> See the [Ember documentation](https://github.com/alexandre-daubois/ember) for the full list of features and setup details.
16+
17+
## Metrics
18+
19+
FrankenPHP exposes Prometheus-compatible metrics for threads, workers, request processing, and queue depth when [Caddy metrics](https://caddyserver.com/docs/metrics) are enabled.
20+
21+
See the [Metrics](metrics.md) page for the full list of available metrics.
22+
23+
## Logging
24+
25+
FrankenPHP integrates with Caddy's logging system and provides `frankenphp_log()` for structured logging with severity levels and context data, making ingestion into platforms like Datadog, Grafana Loki, or Elastic straightforward.
26+
27+
See the [Logging](logging.md) page for usage details.
28+
29+
## Custom Prometheus/Grafana Setup
30+
31+
If you prefer a custom monitoring stack, you can scrape FrankenPHP metrics directly.
32+
There are two options:
33+
34+
1. **Scrape Caddy directly**: Caddy exposes metrics at its admin endpoint (default: `localhost:2019/metrics`)
35+
2. **Scrape via Ember**: when running Ember with `--expose`, it exposes FrankenPHP metrics along with computed metrics derived from Caddy data (RPS, latency percentiles, error rates) on a dedicated endpoint.

0 commit comments

Comments
 (0)