Azure / azure-sdk-for-js

This repository is for active development of the Azure SDK for JavaScript (NodeJS & Browser). For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/javascript/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-js.
MIT License
2.07k stars 1.2k forks source link

[opentelemetry-instrumentation-azure-sdk] Adopt OpenTelemetry HTTP semconv 1.23.1 #27585

Open lmolkova opened 11 months ago

lmolkova commented 11 months ago

Update HTTP attributes to comply with HTTP semconv vTBD (likely 1.23.0 will declare them as stable):

  1. Rename attributes according to docs:
    • http.method -> http.request.method
    • http.status_code -> http.response.status_code
    • net.peer.name -> server.address
    • net.peer.port -> server.port
    • http.url -> url.full
    • http.user_agent -> user_agent.original
  2. Add new attributes:
  3. Update HTTP span names according to the new conventions
  4. Check if there is anything else in the list of changes that needs attention
maorleger commented 6 months ago

@lmolkova hi! Any concerns about breaking changes / should we populate both or just rename the existing attributes? Just wanted to double check 👍

maorleger commented 6 months ago

cc @hectorhdzg since appInsights uses our tracer - @hectorhdzg any concerns about renaming these attributes or do we need to keep both for backwards compat?

lmolkova commented 6 months ago

We did breaking change on .NET and Java - given that plugins are experimental, we can do it. Still curious what @hectorhdzg would say :)

hectorhdzg commented 6 months ago

@maorleger JS OTel is currently working on supporting new semconv, work is being tracked here, currently exporters do not support latest semantic convention, including Azure Monitor one, I will sync with Java/.NET folks but I suppose they have code to support backward compatibly attributes, so maybe it makes sense to hold this one for a few, until exporters have support for it.

lmolkova commented 6 months ago

.NET exporter supports all new semconv attributes https://github.com/Azure/azure-sdk-for-net/blob/fe7a2ec767b968f13c544e1ac902e299d0022639/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/Vendoring/Shared/SemanticConventions.cs#L106

Java too - https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/monitor/azure-monitor-opentelemetry-exporter/src/main/java/com/azure/monitor/opentelemetry/exporter/implementation/SemanticAttributes.java

@hectorhdzg is there an issue for @azure/monitor-opentelemetry-exporter we can track to know when it's done? The one you linked is for JS HTTP client instrumentations.

hectorhdzg commented 6 months ago

@lmolkova Created following issue to track on exporter side, we are waiting for @opentelemetry/semantic-conventions to have latest attributes, we will update when they are available.