-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Activity.Current is a static variable that uses AsyncLocal internally, which means that it flows into children async calls, but not back to the caller (message consumer and producer). With the previous implementation, the Activity.Current is null after the produce and consume of messages, which means that all spans created after it will generate new trace information because the context is not being propagated. This change fixes the problem firing sync events and making the OpenTelemetry handlers subscribe them.
- Loading branch information
1 parent
06fcddf
commit c48df05
Showing
7 changed files
with
111 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,8 @@ public interface IEvent | |
/// <param name="handler">The handler to be called when the event is fired.</param> | ||
/// <returns>Event subscription reference</returns> | ||
IEventSubscription Subscribe(Func<Task> handler); | ||
|
||
IEventSubscription Subscribe(Action handler); | ||
} | ||
|
||
/// <summary> | ||
|
@@ -28,5 +30,7 @@ public interface IEvent<out TArg> | |
/// <param name="handler">The handler to be called when the event is fired.</param> | ||
/// <returns>Event subscription reference</returns> | ||
IEventSubscription Subscribe(Func<TArg, Task> handler); | ||
|
||
IEventSubscription Subscribe(Action<TArg> handler); | ||
} | ||
} | ||
Check warning on line 36 in src/KafkaFlow.Abstractions/IEvent.cs GitHub Actions / Test deployment
|
12 changes: 12 additions & 0 deletions
12
src/KafkaFlow.Admin.Dashboard/Properties/launchSettings.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"profiles": { | ||
"KafkaFlow.Admin.Dashboard": { | ||
"commandName": "Project", | ||
"launchBrowser": true, | ||
"environmentVariables": { | ||
"ASPNETCORE_ENVIRONMENT": "Development" | ||
}, | ||
"applicationUrl": "https://localhost:63908;http://localhost:63909" | ||
} | ||
} | ||
} |
7 changes: 6 additions & 1 deletion
7
src/KafkaFlow.IntegrationTests/Core/Middlewares/GzipMiddleware.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters