Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Otel #233

Merged
merged 2 commits into from
Oct 4, 2023
Merged

Otel #233

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Source/Events.Handling/EventHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ public async Task Handle(object @event, EventType eventType, EventContext contex
{
var time = Stopwatch.StartNew();
using var activity = context.CommittedExecutionContext.StartChildActivity($"{_activityName}{@event.GetType().Name}");
activity?
.Tag(context.EventSourceId)
.Tag(eventType);

try
{
Expand Down
5 changes: 3 additions & 2 deletions Source/Events.Processing/Internal/EventProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,11 @@ protected EventProcessor(
/// <inheritdoc/>
public async Task<TResponse> Handle(TRequest request, ExecutionContext executionContext, IServiceProvider serviceProvider, CancellationToken cancellation)
{
using var activity = executionContext.StartChildActivity("Handle " + request.GetType().Name)
using var activity = request is HandleEventRequest ? null : executionContext
.StartChildActivity("Handle " + request.GetType().Name)
?.SetTag("kind",Kind.Value);

RetryProcessingState retryProcessingState = null;
RetryProcessingState? retryProcessingState = null;
try
{
retryProcessingState = GetRetryProcessingStateFromRequest(request);
Expand Down
Loading