Skip to content

Commit 0008ead

Browse files
committed
more clean up
1 parent 2df996d commit 0008ead

File tree

2 files changed

+36
-39
lines changed

2 files changed

+36
-39
lines changed

semantic_conventions/trace/instrumentation/azure-sdk.yml

+8-20
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ groups:
1010
- id: az.namespace
1111
required: always
1212
type: string
13+
sampling_relevant: true
1314
brief: '[Namespace](https://docs.microsoft.com/azure/azure-resource-manager/management/azure-services-resource-providers) of Azure service request is made against.'
1415
examples: ['Microsoft.Storage', 'Microsoft.KeyVault', 'Microsoft.ServiceBus']
1516

@@ -39,29 +40,18 @@ groups:
3940
required: always
4041
brief: 'Value of the [x-ms-request-id] header (or other request-id header, depending on the service) sent by the server in response.'
4142
examples: ['3f828ae5-ecb9-40ab-88d9-db0420af30c6']
42-
- id: http.method
43-
type: string
43+
- ref: http.method
4444
required: always
4545
sampling_relevant: true
46-
brief: 'HTTP request method.'
47-
examples: ["GET", "POST", "HEAD"]
48-
- id: http.url
49-
type: string
46+
- ref: http.url
5047
required: always
5148
sampling_relevant: true
52-
brief: Full HTTP request URL in the form `scheme://host[:port]/path?query[#fragment]`
53-
examples: ['https://www.foo.bar/search?q=OpenTelemetry#SemConv']
54-
- id: http.status_code
55-
type: int
56-
required:
57-
conditional: If and only if one was received/sent.
58-
brief: '[HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6).'
59-
examples: [200]
60-
- id: http.user_agent
61-
type: string
49+
- ref: http.status_code
6250
required: always
51+
- ref: http.user_agent
52+
required: always
53+
sampling_relevant: true
6354
brief: '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.'
64-
examples: ['CERN-LineMode/2.15 libwww/2.17b3']
6555

6656
# messaging
6757
- id: azure.sdk.messaging
@@ -112,10 +102,8 @@ groups:
112102
required: always
113103
brief: 'Cosmos DB URI'
114104
examples: ['https://my-cosmos.documents.azure.com:443/']
115-
- id: db.statement
116-
type: string
105+
- ref: db.statement
117106
required: always
118-
brief: 'Database statement'
119107
examples: ['createContainerIfNotExists.myContainer']
120108
- id: db.instance
121109
type: string

specification/trace/semantic_conventions/instrumentation/azure-sdk.md

+28-19
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
**Status**: [Experimental](../../../document-status.md)
44

5-
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.
5+
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.
66

77
- [Java](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/core/azure-core-tracing-opentelemetry)
88
- [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-
1313

1414
## Versioning
1515

16-
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.
16+
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.
1717

18-
Azure SDKs plan to fully adopt OpenTelemetry semantic conventions once they reach `Stable` status.
18+
Azure SDK plans to fully adopt OpenTelemetry semantic conventions once conventions reach `Stable` status.
1919

2020
## Common Attributes
2121

22-
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).
22+
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.
2323

2424
<!-- semconv azure.sdk -->
2525
| Attribute | Type | Description | Examples | Required |
2626
|---|---|---|---|---|
2727
| `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 |
28+
29+
Following attributes MUST be provided **at span creation time** (when provided at all), so they can be considered for sampling decisions:
30+
31+
* `az.namespace`
2832
<!-- endsemconv -->
2933

3034
## Public API calls
3135

32-
Azure SDKs create a span for public API call (that involve communication with Azure services).
36+
Azure SDKs create a span for public API call (that involves communication with Azure services).
3337

34-
- Spans representing public APIs have names following `ClientType.Method` pattern, which is language-specific.
35-
- For HTTP-based SDKs public API spans have `INTERNAL` kind.
38+
- Spans representing public APIs have names following `client.method` pattern, which is language-specific.
39+
- For HTTP-based SDKs, public API spans have `INTERNAL` kind.
3640

3741
[Messaging](#messaging-sdks) and [CosmosDb](#cosmosdb) sections below describe non-HTTP semantics.
3842

@@ -45,18 +49,21 @@ Azure SDKs implement a valid subset of [OpenTelemetry HTTP conventions v1.6.x](h
4549
|---|---|---|---|---|
4650
| `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 |
4751
| `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 |
48-
| `http.method` | string | HTTP request method. | `GET`; `POST`; `HEAD` | Yes |
49-
| `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 |
50-
| `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. |
51-
| `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 |
52+
| [`http.method`](../http.md) | string | HTTP request method. | `GET`; `POST`; `HEAD` | Yes |
53+
| [`http.status_code`](../http.md) | int | [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). | `200` | Yes |
54+
| [`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 |
55+
| [`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 |
56+
57+
**[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/`.
5258

5359
Following attributes MUST be provided **at span creation time** (when provided at all), so they can be considered for sampling decisions:
5460

55-
* `http.method`
56-
* `http.url`
61+
* [`http.method`](../http.md)
62+
* [`http.url`](../http.md)
63+
* [`http.user_agent`](../http.md)
5764
<!-- endsemconv -->
5865

59-
SDKs support [W3C Trace context](https://w3c.github.io/trace-context/) propagation and Azure Services legacy correlation protocols.
66+
Instrumentation support [W3C Trace context](https://w3c.github.io/trace-context/) propagation and Azure Services legacy correlation protocols. Propagator configuration is not supported.
6067

6168
## Messaging SDKs
6269

@@ -88,20 +95,22 @@ Messaging SDKs produce three kinds of spans:
8895
| `peer.address` | string | Fully qualified messaging service name. | `myEventHubNamespace.servicebus.windows.net` | Yes |
8996
<!-- endsemconv -->
9097

91-
## CosmosDb
98+
## CosmosDB
9299

93-
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.
94-
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.
100+
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.
101+
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.
95102

96-
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.
103+
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.
97104

98105
### CosmosDB attributes
99106

100107
<!-- semconv azure.sdk.cosmos -->
101108
| Attribute | Type | Description | Examples | Required |
102109
|---|---|---|---|---|
103110
| `db.url` | string | Cosmos DB URI | `https://my-cosmos.documents.azure.com:443/` | Yes |
104-
| `db.statement` | string | Database statement | `createContainerIfNotExists.myContainer` | Yes |
105111
| `db.instance` | string | Database name | `mydb` | Yes |
106112
| `db.type` | string | Database type | `Cosmos` | Yes |
113+
| [`db.statement`](../database.md) | string | The database statement being executed. [1] | `createContainerIfNotExists.myContainer` | Yes |
114+
115+
**[1]:** The value may be sanitized to exclude sensitive information.
107116
<!-- endsemconv -->

0 commit comments

Comments
 (0)