feat(filter): access log trace ID correlation - #960
Conversation
b22e506 to
848088f
Compare
praxis-bot
left a comment
There was a problem hiding this comment.
Review of trace ID correlation changes. 3 findings (0 critical, 0 large, 3 medium).
0f29120 to
08dd8e1
Compare
praxis-bot
left a comment
There was a problem hiding this comment.
PR Review
Access log trace ID correlation: adds trace_id and span_id fields to access log output when the otel feature is enabled and a valid OpenTelemetry context is present.
| Severity | Count |
|---|---|
| Critical | 0 |
| Large | 0 |
| Medium | 1 |
The implementation is sound: extract_otel_ids correctly reads the OTel span context from the current tracing span, validates it with is_valid(), and returns the IDs only when the context is real. Conditional compilation with #[cfg(feature = "otel")] is properly applied to both the code path and the helper function. Feature propagation through server/Cargo.toml (praxis-filter/otel) is correct. The field reordering to alphabetical in the info! macro is a good consistency improvement.
One medium finding on test coverage gap -- see inline comment.
Add trace_id and span_id fields to structured JSON access log entries for log-to-trace correlation. Fields are extracted from the current tracing span context and omitted when tracing is not active. Enables searching by trace_id in Loki and jumping to the full trace in Tempo via cross-signal correlation. Closes praxis-proxy#317 Signed-off-by: Ladislav Smola <lsmola@redhat.com>
08dd8e1 to
8fcd504
Compare
Summary
Closes #317
Dependencies
Depends on #908 (root span per request) — first commit is the #301 dependency.
Test plan