Skip to content

Error metrics#26

Merged
dwerner merged 3 commits intomainfrom
error-metrics
Nov 7, 2025
Merged

Error metrics#26
dwerner merged 3 commits intomainfrom
error-metrics

Conversation

@dwerner
Copy link
Collaborator

@dwerner dwerner commented Nov 7, 2025

The idea with this PR is to inject a layer into tracing config that allows us to export log lines (configurable level) with module to our metrics. This provides another layer of observability where we have not yet put a "real metric" in place yet.

- Implement tracing subscriber layer that captures log events as Prometheus metrics
- Expose phaser_log_events_total{level, service, module} counter
- Track ERROR, WARN, INFO by default (skip DEBUG/TRACE for cardinality control)
- Use global OnceCell for single metric registration
- Add dependencies: tracing, tracing-subscriber, once_cell

Cardinality: ~210-350 time series (3 levels × 2 services × 35-50 modules)
- Re-export MetricsLayer from phaser-metrics
- Initialize tracing with MetricsLayer using layered subscriber pattern
- Service label: "erigon-bridge"
- Metrics exposed on existing /metrics endpoint (port 9091)
- Re-export MetricsLayer from phaser-metrics
- Initialize tracing with MetricsLayer using layered subscriber pattern
- Service label: "phaser-query"
- Metrics exposed on existing /metrics endpoint (port 9092)
@dwerner dwerner merged commit 4702902 into main Nov 7, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant