fix(http): set url.uri_template only when the request has a template - #752
Merged
Vincent Biret (baywet) merged 2 commits intoSep 25, 2026
Merged
Vincent Biret (baywet) merged 2 commits into
Vincent Biret (baywet) merged 2 commits into
Conversation
A RequestInformation whose URL is set directly (PageIterator, LargeFileUploadTask) has no url_template, and the None went into the span attributes: opentelemetry-sdk up to 1.44 logged a warning for it twice per request, 1.45 exports url.uri_template: None. Fixes microsoft#751.
Vincent Biret (baywet)
approved these changes
Sep 25, 2026
Vincent Biret (baywet)
enabled auto-merge
September 25, 2026 19:32
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Overview
get_request_from_request_informationnow addsurl.uri_templateto the span attributes only when the request has a template, the same guardhttp.portgot for #430. ARequestInformationwhose URL is set directly (msgraph-core'sPageIterator,LargeFileUploadTask, any raw-URL request) hasurl_templateNone, and that None went onto both spans: opentelemetry-sdk up to 1.44 loggedInvalid type NoneType for attribute 'url.uri_template'twice per request, and 1.45 exportsurl.uri_template: None.Related Issue
Fixes #751
Notes
The span name above it already falls back to
UNKNOWNfor the same case; the attribute is left out rather than set toUNKNOWN, since the semantic convention treats it as optional.Testing Instructions
cd packages/http/httpx && pytest tests/test_httpx_request_adapter.py -k uri_template: a raw-URL request leaves nourl.uri_templateon any span and logs no OpenTelemetry warning (fails on main), and a templated request still carries its template.kiota_http.url.uri_templateabsent on both spans, no warning.