-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Endpoint diagnostics metadata #11785
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
Comments
Thinking about this more, it does kind of serve the same purpose as the hosting activity and its tags collection. Tags are already untyped string name/values. Maybe the contents of The benefit is telemetry frameworks can get this info when an endpoint is matched rather than wait for the request to end. This is useful for long lived requests (gRPC streaming, SignalR long polling) |
Can you help me understand how we can tell the difference between endpoint today? By looking into the type of From the telemetry framework standpoint Activity.Tags is the best place for any metadata. Historically, there are two kinds of instrumentation approaches with Activity
So the bottom line:
|
I think we have to made a decision about whether we want things like the controller/action name (and the equivalent for SignalR/gRPC/etc) to be part of the activity or not. I kinda expect that if we attach a loosely-typed property bag of "info" to endpoints, it's not going to be good enough for some of our scenarios. |
Brief overview of endpoints and metadata:
|
Uh oh!
There was an error while loading. Please reload this page.
We've just added an endpoint matched event to diagnostic listeners with #11685
From this event AppInsights/OpenTelemetry can get the HttpContext, and the matched endpoint via
HttpContext.GetEndpoint()
and then look at endpoint metadata. Endpoints produced by app frameworks are adding typed metadata about the endpoint toEndpoint.Metadata
. For example, gRPC addsGrpcMethodMetadata
to gRPC endpoints, MVC addsActionDescriptor
to MVC endpoints, etc. Using this metadata telemetry frameworks can figure out what the request is for.The problem with this is the metadata is all strongly typed, which means telemetry frameworks will either need complex reflection or dependencies to query it.
We could make this easier by having some generic diagnostic metadata that app frameworks set when building endpoints:
Now telemetry frameworks can simply copy name/values from the diagnostics collection.
Benefits:
@davidfowl @rynowak @lmolkova @SergeyKanzhelev
The text was updated successfully, but these errors were encountered: