-
Notifications
You must be signed in to change notification settings - Fork 894
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
36 additions
and
39 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
**Status**: [Experimental](../../../document-status.md) | ||
|
||
This document describes tracing semantic conventions adopted by Azure ClientLibraries (SDK). Instrumentations live in Azure SDK repos and are shipped along with Azure SDK artifacts. Instrumentations cover all modern (track 2) SDKs. | ||
This document describes tracing semantic conventions adopted by Azure SDK. Instrumentations live in Azure SDK repos and are shipped along with Azure SDK artifacts. Instrumentations cover all modern (track 2) Azure client libraries. | ||
|
||
- [Java](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/core/azure-core-tracing-opentelemetry) | ||
- [JavaScript](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/core-tracing) | ||
|
@@ -13,26 +13,30 @@ Azure SDK produces spans for public API calls and nested HTTP client spans. Non- | |
|
||
## Versioning | ||
|
||
Azure SDK semantic conventions pin specific versions of OpenTelemetry semantic conventions (where applicable) and are not updated regularly to the latest OpenTelemetry semantic conventions version. However OpenTelemetry-compatible changes should be expected from time to time. | ||
Azure SDK semantic conventions pin specific versions of OpenTelemetry semantic conventions (where applicable) and are not updated regularly to the latest OpenTelemetry semantic conventions version. However OpenTelemetry-compatible changes should be expected. | ||
|
||
Azure SDKs plan to fully adopt OpenTelemetry semantic conventions once they reach `Stable` status. | ||
Azure SDK plans to fully adopt OpenTelemetry semantic conventions once conventions reach `Stable` status. | ||
|
||
## Common Attributes | ||
|
||
All Azure SDKs spans have `az.namespace` attribute to uniquely identify *Azure SDK* request is made from, usually the value matches the destination Azure Service (in some cases SDK support multiple services). | ||
All Azure SDKs spans have `az.namespace` attribute to uniquely identify *Azure SDK* request is made *from*, usually the value matches the destination Azure service, but in some cases client library can support multiple services. | ||
|
||
<!-- semconv azure.sdk --> | ||
| Attribute | Type | Description | Examples | Required | | ||
|---|---|---|---|---| | ||
| `az.namespace` | string | [Namespace](https://docs.microsoft.com/azure/azure-resource-manager/management/azure-services-resource-providers) of Azure service request is made against. | `Microsoft.Storage`; `Microsoft.KeyVault`; `Microsoft.ServiceBus` | Yes | | ||
|
||
Following attributes MUST be provided **at span creation time** (when provided at all), so they can be considered for sampling decisions: | ||
|
||
* `az.namespace` | ||
<!-- endsemconv --> | ||
|
||
## Public API calls | ||
|
||
Azure SDKs create a span for public API call (that involve communication with Azure services). | ||
Azure SDKs create a span for public API call (that involves communication with Azure services). | ||
|
||
- Spans representing public APIs have names following `ClientType.Method` pattern, which is language-specific. | ||
- For HTTP-based SDKs public API spans have `INTERNAL` kind. | ||
- Spans representing public APIs have names following `client.method` pattern, which is language-specific. | ||
- For HTTP-based SDKs, public API spans have `INTERNAL` kind. | ||
|
||
[Messaging](#messaging-sdks) and [CosmosDb](#cosmosdb) sections below describe non-HTTP semantics. | ||
|
||
|
@@ -45,18 +49,21 @@ Azure SDKs implement a valid subset of [OpenTelemetry HTTP conventions v1.6.x](h | |
|---|---|---|---|---| | ||
| `request_id` | string | Value of the [x-ms-client-request-id] header (or other request-id header, depending on the service) sent by the client. | `eb178587-c05a-418c-a695-ae9466c5303c` | Yes | | ||
| `service_request_id` | string | Value of the [x-ms-request-id] header (or other request-id header, depending on the service) sent by the server in response. | `3f828ae5-ecb9-40ab-88d9-db0420af30c6` | Yes | | ||
| `http.method` | string | HTTP request method. | `GET`; `POST`; `HEAD` | Yes | | ||
| `http.url` | string | Full HTTP request URL in the form `scheme://host[:port]/path?query[#fragment]` | `https://www.foo.bar/search?q=OpenTelemetry#SemConv` | Yes | | ||
| `http.status_code` | int | [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). | `200` | If and only if one was received/sent. | | ||
| `http.user_agent` | string | Value of the [HTTP User-Agent](https://tools.ietf.org/html/rfc7231#section-5.5.3) or X-MS-UserAgent header sent by the client. | `CERN-LineMode/2.15 libwww/2.17b3` | Yes | | ||
| [`http.method`](../http.md) | string | HTTP request method. | `GET`; `POST`; `HEAD` | Yes | | ||
| [`http.status_code`](../http.md) | int | [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). | `200` | Yes | | ||
| [`http.url`](../http.md) | string | Full HTTP request URL in the form `scheme://host[:port]/path?query[#fragment]`. Usually the fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless. [1] | `https://www.foo.bar/search?q=OpenTelemetry#SemConv` | Yes | | ||
| [`http.user_agent`](../http.md) | string | Value of the [HTTP User-Agent](https://tools.ietf.org/html/rfc7231#section-5.5.3) or X-MS-UserAgent header sent by the client. | `CERN-LineMode/2.15 libwww/2.17b3` | Yes | | ||
|
||
**[1]:** `http.url` MUST NOT contain credentials passed via URL in form of `https://username:[email protected]/`. In such case the attribute's value should be `https://www.example.com/`. | ||
|
||
Following attributes MUST be provided **at span creation time** (when provided at all), so they can be considered for sampling decisions: | ||
|
||
* `http.method` | ||
* `http.url` | ||
* [`http.method`](../http.md) | ||
* [`http.url`](../http.md) | ||
* [`http.user_agent`](../http.md) | ||
<!-- endsemconv --> | ||
|
||
SDKs support [W3C Trace context](https://w3c.github.io/trace-context/) propagation and Azure Services legacy correlation protocols. | ||
Instrumentation support [W3C Trace context](https://w3c.github.io/trace-context/) propagation and Azure Services legacy correlation protocols. Propagator configuration is not supported. | ||
|
||
## Messaging SDKs | ||
|
||
|
@@ -88,20 +95,22 @@ Messaging SDKs produce three kinds of spans: | |
| `peer.address` | string | Fully qualified messaging service name. | `myEventHubNamespace.servicebus.windows.net` | Yes | | ||
<!-- endsemconv --> | ||
|
||
## CosmosDb | ||
## CosmosDB | ||
|
||
CosmosDb SDK in [Direct mode](https://docs.microsoft.com/azure/cosmos-db/sql/sql-sdk-connection-modes#available-connectivity-modes) uses TCP-based protocol and traces public API calls only. | ||
CosmosDb trace conventions pinned to [OpenTelemetry 0.5.0](https://github.com/open-telemetry/opentelemetry-specification/blob/v0.5.0/specification/trace/semantic_conventions/database.md) version. | ||
CosmosDB SDK in [Direct mode](https://docs.microsoft.com/azure/cosmos-db/sql/sql-sdk-connection-modes#available-connectivity-modes) uses TCP-based protocol and traces public API calls only. | ||
CosmosDB trace conventions pinned to OpenTelemetry [Semantic Conventions v0.5.0](https://github.com/open-telemetry/opentelemetry-specification/blob/v0.5.0/specification/trace/semantic_conventions/database.md) version. | ||
|
||
Spans have `CLIENT` kind and the name matches `db.statement` value. When CosmosDb detects an error or long operation (with configurable threshold), it adds a span event with extended `CosmosDiagnostics` information. | ||
Spans have `CLIENT` kind and the name matches `db.statement` value. When CosmosDB detects an error or long operation (with configurable threshold), it adds a span event with extended `CosmosDiagnostics` information. | ||
|
||
### CosmosDB attributes | ||
|
||
<!-- semconv azure.sdk.cosmos --> | ||
| Attribute | Type | Description | Examples | Required | | ||
|---|---|---|---|---| | ||
| `db.url` | string | Cosmos DB URI | `https://my-cosmos.documents.azure.com:443/` | Yes | | ||
| `db.statement` | string | Database statement | `createContainerIfNotExists.myContainer` | Yes | | ||
| `db.instance` | string | Database name | `mydb` | Yes | | ||
| `db.type` | string | Database type | `Cosmos` | Yes | | ||
| [`db.statement`](../database.md) | string | The database statement being executed. [1] | `createContainerIfNotExists.myContainer` | Yes | | ||
|
||
**[1]:** The value may be sanitized to exclude sensitive information. | ||
<!-- endsemconv --> |