32 lines
562 B
Markdown
32 lines
562 B
Markdown
# Prometheus & Grafana
|
|
|
|
Export metrics to Prometheus and visualize in Grafana.
|
|
|
|
## Prometheus Configuration
|
|
|
|
```yaml
|
|
scrape_configs:
|
|
- job_name: 'event-processor'
|
|
static_configs:
|
|
- targets: ['localhost:5000']
|
|
metrics_path: '/metrics'
|
|
scrape_interval: 15s
|
|
```
|
|
|
|
## Grafana Queries
|
|
|
|
```promql
|
|
# Events per second
|
|
rate(svrnty_cqrs_events_published_total[1m])
|
|
|
|
# Consumer lag
|
|
svrnty_cqrs_consumer_lag
|
|
|
|
# P95 latency
|
|
histogram_quantile(0.95, rate(svrnty_cqrs_events_processing_latency_bucket[5m]))
|
|
```
|
|
|
|
## See Also
|
|
|
|
- [Metrics Overview](README.md)
|