Skip to content

[FEATURE] Add distributed tracing with Micrometer and Zipkin TransactionMs #9

@abengl

Description

@abengl

Description
Instrument the transfer flow with distributed tracing so a single transfer request can be visualized as a full trace spanning TransactionMs and AccountMs, with timing at each hop visible in Zipkin UI.

Tasks

  • Add micrometer-tracing-bridge-brave and zipkin-reporter-brave dependencies to TransactionMs, AccountMs, and CustomerMs
  • Configure management.tracing.sampling.probability=1.0 in dev properties for all services
  • Add Zipkin as a service in docker-compose.yml on port 9411
  • Verify that WebClient calls automatically propagate trace context (B3 headers) — confirm with a test transfer that both TransactionMs and AccountMs spans appear under the same trace in Zipkin UI
  • Add traceId and spanId to the MDC configuration from the previous issue so they appear in structured log output alongside the correlationId
  • For the Generator, instrument the runGeneration flow so each generation run produces a parent span with child spans per customer creation batch

Acceptance Criteria

  • Zipkin UI at http://localhost:9411 shows traces after a POST /api/v1/transactions/transfer
  • The trace shows at minimum two spans: one for TransactionMs and one for the outgoing call to AccountMs
  • traceId appears in structured log output and matches the trace visible in Zipkin
  • Sampling is configurable via management.tracing.sampling.probability without code changes
  • Docker Compose brings up Zipkin alongside the existing services with no manual setup required

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions