Skip to content

Distributed tracing: traceId in logs, X-Trace-Id header, Kafka traceparent - #1764

Open
andriikachur wants to merge 6 commits into
mainfrom
feature/distributed-tracing
Open

Distributed tracing: traceId in logs, X-Trace-Id header, Kafka traceparent#1764
andriikachur wants to merge 6 commits into
mainfrom
feature/distributed-tracing

Conversation

@andriikachur

Copy link
Copy Markdown

What

Foundation for distributed tracing (log correlation via W3C trace ids) across OpenFrame:

  • Logback shared patterns (openframe-config-core/logging/): added traceId=%X{traceId:-} spanId=%X{spanId:-} to the logfmt console patterns (and [%X{traceId:-}] to the plain pattern). Renders empty until services get a tracing bridge — safe no-op.
  • TraceIdResponseHeaderFilter in openframe-gateway-service-core: returns an X-Trace-Id response header so a failing request can be looked up in Loki without server access.
  • Kafka observation in openframe-data-kafka: KafkaTemplate + listener ContainerProperties observation enabled, so traceparent propagates through Kafka records.

No exporter anywhere — spans are created and dropped; this is log-correlation only.

Testing

  • TraceIdResponseHeaderFilterTest (2 tests), OssTenantKafkaAutoConfigurationTest (2 tests) — green.
  • End-to-end verification planned on a PR tenant via the openframe-saas-tenant PR that pins this build.

🤖 Generated with Claude Code

andriikachur and others added 6 commits July 27, 2026 14:52
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…arent propagation)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…racing

# Conflicts:
#	openframe-config-core/src/main/resources/logging/shared-logback-includes-logfmt-shortened.xml
#	openframe-config-core/src/main/resources/logging/shared-logback-includes-logfmt.xml
#	openframe-config-core/src/main/resources/logging/shared-logback-includes.xml
Adds TracedExecutorFactory in openframe-core and uses it for the tool-install
executor (client-core) and the notification channel executor (data-nats).
Both created plain virtual-thread executors, so traceId/spanId were lost as
soon as work crossed the @async boundary.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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