Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
2f734a6
feat(observability): support exporting logs via OTEL
cmacrae Jan 15, 2026
9f8cd93
feat(observability): add an otel-collector to docker-compose
cmacrae Jan 15, 2026
89341d9
feat(observability): support exporting traces via OTEL
cmacrae Jan 16, 2026
51aee8f
feat(observability): support exporting metrics via OTEL
cmacrae Jan 16, 2026
59e98cf
fix(observability): compute deltas for OTEL counter metrics
cmacrae Jan 19, 2026
4c97740
refactor(observability): use standard OTEL env vars and simplify config
cmacrae Jan 19, 2026
b495b23
refactor(metrics): use standard OTEL names for process metrics
cmacrae Jan 19, 2026
4d182c9
refactor(observability): extract shutdown logic into helper method
cmacrae Jan 19, 2026
a96cf9e
feat(observability): add configurable metrics export interval
cmacrae Jan 19, 2026
5b12e93
refactor(run): use ObservabilityGuard method for OTEL metrics check
cmacrae Jan 19, 2026
6b09f1b
refactor(observability): simplify OTEL SDK disabled check
cmacrae Jan 19, 2026
21b8246
docs(metrics): explain process metrics are backend-specific
cmacrae Jan 19, 2026
e832b6b
refactor(config): remove unused MetricsConfig.enabled field
cmacrae Jan 19, 2026
412876a
refactor(observability): use tracing::error! in shutdown
cmacrae Jan 19, 2026
9666d62
docs(observability): clarify export_timeout is on MetricExporter
cmacrae Jan 19, 2026
676ea08
fix(observability): flush providers before shutdown
cmacrae Jan 19, 2026
e476510
refactor(metrics): use tokio::sync::Mutex for OTEL process metrics
cmacrae Jan 19, 2026
f143179
feat(config): reduce default metrics export interval to 15s
cmacrae Jan 19, 2026
dec69b5
fix(observability): graceful degradation on provider init errors
cmacrae Jan 19, 2026
c8cb8bb
fix(observability): make fmt logging init idempotent for test compati…
cmacrae Jan 19, 2026
1b60de5
docs(config): mark env var example as bash to skip doctest
cmacrae Jan 19, 2026
8931795
feat(config)!: enable OTEL metrics by default when otel.enabled is true
cmacrae Jan 19, 2026
1edc1b0
fix(config): implement manual Default for OtelConfig
cmacrae Jan 19, 2026
b62d48e
test(otel): add OtelConfig unit tests
cmacrae Jan 19, 2026
016021e
test(otel): add observability unit tests
cmacrae Jan 19, 2026
cfd0eaa
test(otel): add metrics unit test
cmacrae Jan 19, 2026
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
223 changes: 221 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ sqlx = { version = "0.8", features = ["postgres", "runtime-tokio", "chrono"] }
thiserror = "2"
tracing = "0.1"
tracing-subscriber = { version = "0.3", default-features = false, features = ["env-filter", "fmt"] }
opentelemetry = { version = "0.31", default-features = false, features = ["logs", "trace", "metrics"] }
opentelemetry_sdk = { version = "0.31", default-features = false, features = ["rt-tokio", "logs", "trace", "metrics"] }
opentelemetry-otlp = { version = "0.31", default-features = false, features = ["grpc-tonic", "logs", "trace", "metrics"] }
opentelemetry-appender-tracing = "0.31"
opentelemetry-resource-detectors = "0.10"
tracing-opentelemetry = "0.32"
tokio = { version = "1.44", features = ["rt-multi-thread", "macros", "time", "signal"] }
tower-http = { version = "0.6", features = ["cors"] }
utoipa = { version = "5.3.1", features = ["chrono", "axum_extras"] }
Expand Down
30 changes: 30 additions & 0 deletions config.sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,39 @@ server:
private_key:
hex: 7c5c8d3114ac2410249ca2baae7dec86ac2950a389ac44a5fdca8941b92b6c86

# Prometheus metrics endpoint configuration.
metrics:
bind_endpoint: 127.0.0.1:30922

# OpenTelemetry configuration.
#
# Standard OTEL environment variables are supported:
# OTEL_SDK_DISABLED=true - Disable OTEL SDK, use only fmt logging
# OTEL_EXPORTER_OTLP_ENDPOINT - Global OTLP gRPC endpoint URL (default: http://localhost:4317)
# OTEL_SERVICE_NAME - Service name for telemetry (default: nilauth)
# OTEL_RESOURCE_ATTRIBUTES - Resource attributes as key=value,key=value
# Example: team.name=myteam,deployment.environment.name=prod
#
# NOTE: Only gRPC transport (port 4317) is supported.
#
# otel:
# enabled: true # default: false
# endpoint: "http://localhost:4317" # OTLP gRPC endpoint
# service_name: nilauth
# resource_attributes:
# service.instance.id: nilauth-001
# export_timeout: 30
# logs:
# enabled: true # default: true (when otel.enabled is true)
# endpoint: "http://localhost:4317" # optional, overrides global endpoint
# traces:
# enabled: true # default: true (when otel.enabled is true)
# endpoint: "http://localhost:4317" # optional, overrides global endpoint
# metrics:
# enabled: true # default: true - set to false to keep using Prometheus metrics
# endpoint: "http://localhost:4317" # optional, overrides global endpoint
# export_interval: 15 # seconds between metric exports (default: 15)

payments:
# Ethereum RPC endpoint (Anvil for local development)
ethereum_rpc_url: http://127.0.0.1:8545
Expand Down
Loading