Skip to content

Commit

Permalink
Skipped pipelines if CloudEvent (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
DArdouin authored Dec 27, 2023
1 parent 7aab8f2 commit 83942d8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public ApplicationInsightsPublishingDomainEventBehavior(TelemetryClient? telemet

public Task HandleAsync(DomainEventWrapperCollection domainEventWrappers, DomainEventsHandlerDelegate next, CancellationToken cancellationToken)
{
return this._telemetryClient == null
return this._telemetryClient == null || domainEventWrappers.DomainSchema == EventSchema.CloudEvent
? next(domainEventWrappers, cancellationToken)
: this.HandleWithTelemetry(domainEventWrappers, next, cancellationToken);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ internal sealed class TracingPublishingDomainEventBehavior : IPublishingDomainEv
{
public async Task HandleAsync(DomainEventWrapperCollection domainEventWrappers, DomainEventsHandlerDelegate next, CancellationToken cancellationToken)
{
if (domainEventWrappers.DomainSchema == EventSchema.CloudEvent)
{
await next(domainEventWrappers, cancellationToken).ConfigureAwait(false);
return;
}

var activityName = TracingHelper.GetEventGridEventsPublisherActivityName(domainEventWrappers.DomainEventName);

using var activity = TracingHelper.StartProducerActivity(activityName);
Expand Down

0 comments on commit 83942d8

Please sign in to comment.