-
Notifications
You must be signed in to change notification settings - Fork 478
Propagate tags from worker #11575
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
base: dev
Are you sure you want to change the base?
Propagate tags from worker #11575
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1141,6 +1141,7 @@ internal async Task InvokeResponse(InvocationResponse invokeResponse) | |
| } | ||
|
|
||
| LogSharedMemoryUsage(invokeResponse); | ||
| AddWorkerTraceAttributes(invokeResponse, context); | ||
|
|
||
| if (invokeResponse.Result.IsInvocationSuccess()) | ||
| { | ||
|
|
@@ -1738,6 +1739,29 @@ private void AddAdditionalTraceContext(InvocationRequest invocationRequest, Scri | |
| } | ||
| } | ||
|
|
||
| private void AddWorkerTraceAttributes(InvocationResponse invocationResponse, ScriptInvocationContext context) | ||
| { | ||
| var attributes = invocationResponse.TraceContext?.Attributes; | ||
| if (attributes is null) | ||
| { | ||
| return; | ||
| } | ||
|
|
||
| if (context.AsyncExecutionContext is null) | ||
| { | ||
| return; | ||
| } | ||
|
|
||
| System.Threading.ExecutionContext.Run(context.AsyncExecutionContext, static state => | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Needs to run in correct context to set the correction activity |
||
| { | ||
| var attrs = (IDictionary<string, string>)state; | ||
| foreach (var kvp in attrs) | ||
| { | ||
| Activity.Current?.AddTag(kvp.Key, kvp.Value); | ||
| } | ||
| }, attributes); | ||
| } | ||
|
|
||
| private sealed class ExecutingInvocation : IDisposable | ||
| { | ||
| public ExecutingInvocation(ScriptInvocationContext context, IInvocationMessageDispatcher dispatcher) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -442,6 +442,8 @@ message InvocationResponse { | |
|
|
||
| // Status of the invocation (success/failure/canceled) | ||
| StatusResult result = 3; | ||
|
|
||
satvu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| RpcTraceContext trace_context = 5; | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will remove this when protobuf is released and updated version is pulled into host repo |
||
| } | ||
|
|
||
| message WorkerWarmupRequest { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.