-
-
Notifications
You must be signed in to change notification settings - Fork 756
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
RenameRootActivity not working anymore #6862
Comments
@glucaci but it looks like that they do not allow the rename anymore |
We are intrested in this bug. Any news coming? |
@michaelstaib yes, there is no flexibility to rename it anymore. I would in HotChocolate mark the For the current version what we did as workaround is:
public sealed class GraphQLActivityEnricher : ActivityEnricher
{
public GraphQLActivityEnricher(
ObjectPool<StringBuilder> stringBuilderPool,
InstrumentationOptions options)
: base(stringBuilderPool, options)
{
}
protected override string CreateRootActivityName(
Activity activity,
Activity root,
string operationDisplayName)
{
activity.SetCustomProperty("graphqlDisplayName", operationDisplayName);
root.SetCustomProperty("graphqlDisplayName", operationDisplayName);
return operationDisplayName;
}
}
services.AddSingleton<ActivityEnricher, GraphQLActivityEnricher>();
openTelemetryBuilder.WithTracing(tracer => tracer.AddAspNetCoreInstrumentation(o =>
{
o.EnrichWithHttpResponse = (activity, _) =>
{
var rawDisplayName = activity.GetCustomProperty("graphqlDisplayName");
if (rawDisplayName is string graphqlDisplayName &&
!string.IsNullOrEmpty(graphqlDisplayName))
{
activity.DisplayName = graphqlDisplayName;
}
};
})); |
Thank you, it's clear. |
@michaelstaib @monco83 @glucaci I opened a pr on the otel repo: |
I was trying this work-around on Azure Application Insights and it took me somewhile to realize Application Insights doesn't show the trace DisplayName if the tags |
@huysentruitw in 14 you can use the new semantic routes in Hot Chocolate. |
Product
Hot Chocolate
Version
13.7.0
Link to minimal reproduction
open-telemetry/opentelemetry-dotnet#5026
Steps to reproduce
What is expected?
The root Activity to include the graphql operation
What is actually happening?
The root Activity contains only the default AspNetCore DisplayName
Relevant log output
No response
Additional context
This happens since
OpenTelemetry.Instrumentation.AspNetCore
1.6.0-beta.3
because of this change open-telemetry/opentelemetry-dotnet#5026The text was updated successfully, but these errors were encountered: