Skip to content

kiota should propagate client-side route information to Open Telemetry http.route tag #577

@julealgon

Description

@julealgon

When using kiota, the traces don't contain the route information in the "canonical" place: the http.route is missing from the http span.

kiota's own HttpClientRequestAdapter does generate its own internal span and places a url.uri_template, but that should be propagated as a proper OTEL attribute:

span?.SetTag("url.uri_template", decodedUriTemplate);

Without route information in the span, we only see POST/GET-like spans in observability, which is not very useful.

Image Image Image Image

One of the reasons the standard http instrumentation doesn't add this is that it doesn't really know of a low-cardinality value to use since it has zero contextual information about the url being called, so it opts to just output the http method. kiota however has full details about the route template from the generated code and should be able to put that value as the http.route attribute (it knows when a segment or querystring value is a constant or a parameter).

This is very important for us since we want to be able to track all outgoing http calls and group them based on which "resource" they affect. DataDog will use the span as the resource and generate APM metrics for those resources based on the ingested traces.

Without the route information, we cannot perform those kinds of aggregations at all.

Related:

Probably replaces:

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesttype:telemetryProject metrics, instrumentation & alerting issue

    Type

    No type

    Projects

    Status

    Needs Triage 🔍

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions