Observability: metrics, logging, and tracing
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- go, prometheus, sqlite
- Domain
- api, backend, databases, observability
Research direction
Start by mapping the sync engine, API, store, subscriptions, node, and configuration entry points, then decide how the metrics, slog logging, and tracing requirements fit together. Verify the Prometheus endpoint, SyncStatus response, TOML configuration, and each listed metric and span; the issue names no files or tests, so test locations must be identified during research.
Written by the indexing model from the issue text.
Description
Summary
Implement observability infrastructure for apex: Prometheus metrics, structured logging, and OpenTelemetry tracing.
Metrics
Instrument all subsystems with OTel metrics exposed via Prometheus endpoint.
Sync engine
apex_sync_head(gauge) — last synced heightapex_sync_network_head(gauge) — upstream network headapex_sync_lag_seconds(gauge) — time behind network headapex_sync_backfill_duration(histogram) — per-batch backfill latencyapex_sync_errors_total(counter) — sync errors by typeapex_sync_backfill_progress_pct(gauge) — backfill completion percentage
API
apex_rpc_request_duration(histogram) — per-method latencyapex_rpc_request_total(counter) — per-method call countapex_rpc_errors_total(counter) — per-method errors
Store
apex_store_query_duration(histogram) — SQLite query latencyapex_store_insert_duration(histogram) — insert latencyapex_store_size_bytes(gauge) — DB file size
Subscriptions
apex_subscriptions_active(gauge) — active subscription countapex_subscription_deliveries(counter) — messages deliveredapex_subscription_drops(counter) — messages dropped (slow reader)
Node
apex_build_info(gauge) — with version labelsapex_uptime_seconds(counter)
Logging
- Use
slog(Go stdlib) — no heavy dependencies likeipfs/go-log - Structured key-value pairs: height, namespace, method, duration, error
- Configurable log level at startup (and ideally at runtime via admin endpoint)
Tracing
- OpenTelemetry spans for sync fetch, store operations, and RPC handlers
- Configurable exporter (stdout for dev, OTLP for production)
API endpoint
Expose a unified SyncStatus() endpoint returning current synced height, network head, sync state (backfilling/streaming), lag, and active subscriptions in one call. celestia-node spreads this across 4 separate modules.
Configuration
[observability]
metrics_address = "0.0.0.0:9090" # Prometheus endpoint
log_level = "info" # debug, info, warn, error
tracing_enabled = false
tracing_endpoint = "" # OTLP endpoint
- Dominant language
- Go
- Stars
- 4
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from evstack/apex
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
bug group: validation priority: low
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
codecheckers/chekhov#51 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100