microsoft / kiota-java

Java libraries for Kiota-generated API clients.
https://aka.ms/kiota/docs
MIT License
25 stars 27 forks source link

http - align OTEL http attributes with latest standard #1540

Open baywet opened 1 month ago

baywet commented 1 month ago

to maintain compatibility with external tooling we should make sure our attribute respect the latest (stable) semantic conventions. When we initially implemented things, the spec was still in draft. The following attributes need to be renamed in the middleware handlers and in the request adapter: htttp.status_code => http.response.status_code http.response_content_length => http.response.body.size http.request_content_length => http.request.body.size http.flavor => network.protocol.name http.response_content_type => http.response.header.content-type http.request_content_type => http.request.header.content-type http.method => http.request.method http.host => url.scheme http.scheme => server.address http.uri => url.full http.uri_template => url.uri_template

link to the spec for more information https://opentelemetry.io/docs/specs/semconv/attributes-registry/http/ related https://github.com/microsoftgraph/msgraph-sdk-design/pull/108

Strazz1337 commented 1 week ago

I wonder what the preferred way is for implementing the updated OTEL attributes:

baywet commented 1 week ago

Hi @Strazz1337 Thanks for all the pull requests and for inquiring on this one. We'd probably go the route of expanding the constants, here is some more context on why #1232 Let us know if you have any additional comments or questions.