Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions docs/user_guide/prom.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,19 @@ static MY_COUNTER: Lazy<IntGauge> = Lazy::new(|| {
```

This static metric will automatically appear in the Prometheus metric endpoint.

## Prometheus Crate Version Compatibility

**Important:** Your application must use the same version of the `prometheus` crate as Pingora. Using different versions will result in separate metric registries, causing your metrics to not appear in the Prometheus endpoint.

To ensure compatibility, either:

1. Match the exact `prometheus` version that Pingora uses (check `pingora-core`'s `Cargo.toml`)
2. Use `version = "*"` in your `Cargo.toml` to automatically match Pingora's version:

```toml
[dependencies]
prometheus = "*"
```

This is necessary because the `prometheus` crate uses semantic versioning where 0.x versions are considered incompatible (e.g., 0.13 and 0.14 maintain separate global registries).