# OpenTelemetry Collector configuration for xrpld development. # # Pipelines: # traces: OTLP receiver -> batch processor -> debug + Tempo + spanmetrics # metrics: OTLP receiver + spanmetrics connector -> Prometheus exporter # logs: filelog receiver -> batch processor -> otlphttp/Loki (Phase 8) # # xrpld sends traces via OTLP/HTTP to port 4318. The collector batches # them, forwards to Tempo, and derives RED metrics via the spanmetrics # connector, which Prometheus scrapes on port 8889. # # xrpld sends beast::insight metrics natively via OTLP/HTTP to port 4318 # (same endpoint as traces). The OTLP receiver feeds both the traces and # metrics pipelines. Metrics are exported to Prometheus alongside # span-derived metrics. # # Phase 8: The filelog receiver tails xrpld's debug.log files under # /var/log/rippled/ (mounted from the host). A regex_parser operator # extracts timestamp, partition, severity, and optional trace_id/span_id # fields injected by Logs::format(). Parsed logs are exported to Grafana # Loki for log-trace correlation. extensions: health_check: endpoint: 0.0.0.0:13133 receivers: otlp: protocols: grpc: endpoint: 0.0.0.0:4317 http: endpoint: 0.0.0.0:4318 # Phase 8: Filelog receiver tails xrpld debug.log files for log-trace # correlation. Extracts structured fields (timestamp, partition, severity, # trace_id, span_id, message) via regex. The trace_id and span_id are # optional — only present when the log was emitted within an active span. filelog: include: [/var/log/rippled/*/debug.log] operators: - type: regex_parser regex: '^(?P\S+\s+\S+)\s+\S+\s+(?P\S+):(?P\S+)\s+(?:trace_id=(?P[a-f0-9]+)\s+span_id=(?P[a-f0-9]+)\s+)?(?P.*)$' timestamp: parse_from: attributes.timestamp layout: "%Y-%b-%d %H:%M:%S" processors: batch: timeout: 1s send_batch_size: 100 resource/logs: attributes: - key: service.name value: xrpld action: upsert connectors: spanmetrics: # Expose service.instance.id (node public key) as a Prometheus label so # Grafana dashboards can filter metrics by individual node. resource_metrics_key_attributes: - service.instance.id histogram: explicit: buckets: [1ms, 5ms, 10ms, 25ms, 50ms, 100ms, 250ms, 500ms, 1s, 5s] dimensions: - name: xrpl.rpc.command - name: xrpl.rpc.status - name: xrpl.consensus.mode - name: xrpl.tx.local - name: xrpl.peer.proposal.trusted - name: xrpl.peer.validation.trusted exporters: debug: verbosity: detailed otlp/tempo: endpoint: tempo:4317 tls: insecure: true # Phase 8: Export logs to Grafana Loki via OTLP/HTTP. Loki 3.x supports # native OTLP ingestion on its /otlp endpoint, replacing the removed # loki exporter (dropped in otel-collector-contrib v0.147.0). otlphttp/loki: endpoint: http://loki:3100/otlp prometheus: endpoint: 0.0.0.0:8889 service: extensions: [health_check] pipelines: traces: receivers: [otlp] processors: [batch] exporters: [debug, otlp/tempo, spanmetrics] metrics: receivers: [otlp, spanmetrics] processors: [batch] exporters: [prometheus] # Phase 8: Log pipeline ingests xrpld debug.log via filelog receiver, # batches entries, and exports to Loki for log-trace correlation. logs: receivers: [filelog] processors: [resource/logs, batch] exporters: [otlphttp/loki]