Skip to content

Tag OTEL spans with saga ID/type and aggregate stream ID/type#2489

Merged
jeremydmiller merged 1 commit intomainfrom
feature/2470-otel-saga-stream-tags
Apr 9, 2026
Merged

Tag OTEL spans with saga ID/type and aggregate stream ID/type#2489
jeremydmiller merged 1 commit intomainfrom
feature/2470-otel-saga-stream-tags

Conversation

@jeremydmiller
Copy link
Copy Markdown
Member

Closes #2470

Summary

  • Adds four new WolverineTracing tag name constants: wolverine.saga.id, wolverine.saga.type, wolverine.stream.id, wolverine.stream.type
  • Envelope.WriteTags() now sets wolverine.saga.id from Envelope.SagaId — covers existing-saga messages where the saga-id header is already populated
  • SetSagaIdFrame and SetSagaIdFromSagaFrame emit both wolverine.saga.id and wolverine.saga.type via code-gen — covers new and existing sagas where the ID is resolved from the command message property
  • New TagAggregateOtelFrame is injected into AggregateHandling.Apply() to emit wolverine.stream.id and wolverine.stream.type for every aggregate handler workflow

Test plan

  • WolverineTracingTests — verifies wolverine.saga.id is tagged from Envelope.SagaId (and omitted when null)
  • saga_action_discovery — verifies generated handler code contains wolverine.saga.id and wolverine.saga.type SetTag calls for both existing-saga and start-with-id flows
  • aggregate_handler_workflow — verifies generated handler code contains wolverine.stream.id and wolverine.stream.type SetTag calls

🤖 Generated with Claude Code

Adds wolverine.saga.id, wolverine.saga.type, wolverine.stream.id, and
wolverine.stream.type Activity tags so operators can query all telemetry
for a specific saga instance or aggregate stream.

- Envelope.WriteTags() now sets wolverine.saga.id from Envelope.SagaId
  (covers existing-saga messages where the header is already populated)
- SetSagaIdFrame and SetSagaIdFromSagaFrame emit wolverine.saga.id and
  wolverine.saga.type via code-gen, covering both new and existing sagas
  where the ID is resolved from the command message
- TagAggregateOtelFrame is injected into AggregateHandling.Apply() to
  emit wolverine.stream.id and wolverine.stream.type for every aggregate
  handler workflow

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jeremydmiller jeremydmiller merged commit a4068f7 into main Apr 9, 2026
12 of 19 checks passed
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.

Tag OTEL spans with saga ID and aggregate stream ID for saga and aggregate handler workflows

1 participant