You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The distributed event bus pipeline (publish, outbox, inbox, handler invocation) has no
application-level OpenTelemetry Activity instrumentation. The Dapr sidecar creates its
own trace context for HTTP calls, but there are no semantic spans with event name, topic,
pubsub, or handler metadata. This makes it impossible to correlate event publishing with
handler execution in trace tools, and outbox/inbox background processing is completely
invisible.
This issue covers adding Activity spans using the existing InfrastructureActivitySource
(BBT.Aether.Infrastructure) to 5 key locations in the event pipeline.
Expected Behavior
Trace tools (Jaeger, Tempo, etc.) should show a clear span hierarchy for the full event
lifecycle:
Direct publish:EventBus.Publish → EventBus.PublishToBroker → HTTP Client span
Each span should carry semantic tags (event.name, event.topic, event.pubsub_name, event.broker, event.handler, outbox.message_id, etc.) and record exceptions on failure.
Technical Context
framework/src/BBT.Aether.Infrastructure/BBT/Aether/Events/Distributed/DistributedEventBusBase.cs — PublishAsync (2 overloads) and PublishEnvelopeAsync need EventBus.Publish / EventBus.PublishEnvelope spans
framework/src/BBT.Aether.Infrastructure/BBT/Aether/Events/Distributed/DaprEventBus.cs — PublishToBrokerAsync (2 overrides) need EventBus.PublishToBroker spans with event.broker=dapr
framework/src/BBT.Aether.Infrastructure/BBT/Aether/Events/Processing/OutboxProcessor.cs — per-message Outbox.Process span in ProcessOutboxMessagesAsync
framework/src/BBT.Aether.Infrastructure/BBT/Aether/Events/Processing/InboxProcessor.cs — Inbox.Process span in ProcessSingleEventAsync
framework/src/BBT.Aether.Infrastructure/BBT/Aether/Events/Distributed/DistributedEventInvoker.cs — Inbox.Invoke span in InvokeAsync
framework/src/BBT.Aether.Infrastructure/BBT/Aether/Telemetry/InfrastructureActivitySource.cs — existing ActivitySource to reuse (already registered in telemetry setup)
framework/docs/distributed-events/README.md — needs a "Tracing" section
framework/docs/telemetry/README.md — infrastructure spans list needs event bus entries
Description
The distributed event bus pipeline (publish, outbox, inbox, handler invocation) has no
application-level OpenTelemetry Activity instrumentation. The Dapr sidecar creates its
own trace context for HTTP calls, but there are no semantic spans with event name, topic,
pubsub, or handler metadata. This makes it impossible to correlate event publishing with
handler execution in trace tools, and outbox/inbox background processing is completely
invisible.
This issue covers adding
Activityspans using the existingInfrastructureActivitySource(
BBT.Aether.Infrastructure) to 5 key locations in the event pipeline.Expected Behavior
Trace tools (Jaeger, Tempo, etc.) should show a clear span hierarchy for the full event
lifecycle:
EventBus.Publish→EventBus.PublishToBroker→ HTTP Client spanEventBus.Publish(use_outbox=true) ...Outbox.Process→EventBus.PublishEnvelope→EventBus.PublishToBrokerInbox.Process→Inbox.Invoke→ handler executionEach span should carry semantic tags (
event.name,event.topic,event.pubsub_name,event.broker,event.handler,outbox.message_id, etc.) and record exceptions on failure.Technical Context
framework/src/BBT.Aether.Infrastructure/BBT/Aether/Events/Distributed/DistributedEventBusBase.cs—PublishAsync(2 overloads) andPublishEnvelopeAsyncneedEventBus.Publish/EventBus.PublishEnvelopespansframework/src/BBT.Aether.Infrastructure/BBT/Aether/Events/Distributed/DaprEventBus.cs—PublishToBrokerAsync(2 overrides) needEventBus.PublishToBrokerspans withevent.broker=daprframework/src/BBT.Aether.Infrastructure/BBT/Aether/Events/Processing/OutboxProcessor.cs— per-messageOutbox.Processspan inProcessOutboxMessagesAsyncframework/src/BBT.Aether.Infrastructure/BBT/Aether/Events/Processing/InboxProcessor.cs—Inbox.Processspan inProcessSingleEventAsyncframework/src/BBT.Aether.Infrastructure/BBT/Aether/Events/Distributed/DistributedEventInvoker.cs—Inbox.Invokespan inInvokeAsyncframework/src/BBT.Aether.Infrastructure/BBT/Aether/Telemetry/InfrastructureActivitySource.cs— existing ActivitySource to reuse (already registered in telemetry setup)framework/docs/distributed-events/README.md— needs a "Tracing" sectionframework/docs/telemetry/README.md— infrastructure spans list needs event bus entriesAcceptance Criteria
DistributedEventBusBase.PublishAsync(both overloads) createsEventBus.Publishspan with tags:event.name,event.topic,event.use_outboxDistributedEventBusBase.PublishEnvelopeAsynccreatesEventBus.PublishEnvelopespan with tags:event.topic,event.pubsub_nameDaprEventBus.PublishToBrokerAsync(both overrides) createsEventBus.PublishToBrokerspan with tags:event.topic,event.pubsub_name,event.broker=daprOutboxProcessorcreatesOutbox.Processspan per message with tags:event.name,event.topic,event.pubsub_name,outbox.message_id,outbox.retry_countInboxProcessor.ProcessSingleEventAsynccreatesInbox.Processspan with tags:event.id,event.name,event.versionDistributedEventInvoker.InvokeAsynccreatesInbox.Invokespan with tags:event.name,event.version,event.handlerActivityStatusCode.Errorandexceptionevent on failuredistributed-events/README.mddocuments tracing spans, tags, and example trace hierarchiestelemetry/README.mdinfrastructure spans list includes event bus operations