Skip to content

Commit 0396529

Browse files
Prepare OpenTelemetry for beta release (Azure#4320)
* Prepare OpenTelemetry for beta release * Update sdk/core/azure-core-tracing-opentelemetry/CHANGELOG.md Co-authored-by: Anton Kolesnyk <[email protected]> * Removed core changelog changes * Removed core changelog changes 2 * Updated core dependency to 1.8.0 --------- Co-authored-by: Anton Kolesnyk <[email protected]>
1 parent eeaace3 commit 0396529

File tree

4 files changed

+17
-22
lines changed

4 files changed

+17
-22
lines changed

doc/DistributedTracing.md

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -82,19 +82,9 @@ std::shared_ptr<Azure::Core::Tracing::TracerProvider> traceProvider
8282
= Azure::Core::Tracing::OpenTelemetry::OpenTelemetryProvider::Create(CreateOpenTelemetryProvider());
8383
```
8484

85-
To finish the integration with Azure clients, there are two mechanisms to integrate OpenTelemetry into a client application:
85+
To finish the integration with Azure clients, you need to associate the OpenTelemetry provider with each service client created via
86+
the `ClientOptions` structure.
8687

87-
1) `Azure::Core::Context` integration.
88-
1) Service Client Options integration.
89-
90-
### Integrate an OpenTelemetryProvider via the ApplicationContext
91-
92-
To integrate OpenTelemetry for all Azure Clients in the application, the customer can call `Azure::Core::Context::ApplicationContext.SetTracerProvider` to establish the
93-
tracer provider for the application.
94-
95-
```c++
96-
Azure::Core::Context::ApplicationContext.SetTracerProvider(provider);
97-
```
9888

9989
### Integrate an OpenTelemetryProvider via Service ClientOptions
10090

@@ -128,16 +118,19 @@ To add a new `DiagnosticTracingFactory` to the client, simply add the class as a
128118
129119
```c++
130120
Azure::Core::Tracing::_internal::TracingContextFactory m_tracingFactory;
131-
132121
```
133122

134123
And construct the new tracing factory in the service constructor:
135124

136125
```c++
137126
explicit ServiceClient(ServiceClientOptions const& clientOptions = ServiceClientOptions{})
138-
: m_tracingFactory(clientOptions, "Azure.Core.OpenTelemetry.Test.Service", PackageVersion::ToString())
127+
: m_tracingFactory(clientOptions, "Azure.Core.OpenTelemetry.Test.Service",
128+
"azure-core-opentelemetry-test-service-cpp", PackageVersion::ToString())
139129
```
140130
131+
Note that the `TracingContextFactory` constructor requires both the service name AND the package name. The package name is used when
132+
creating an opentelemetry Tracer, and the service name is used as the "az.namespace" attribute in newly created spans.
133+
141134
### Update Each Service Method
142135
143136
There are three methods of interest when updating the service method:
@@ -240,5 +233,7 @@ Generated traces have the following attributes:
240233
| `http.url`| URL being retrieved (sanitized)| HTTP Spans.
241234
| `http.status_code` | HTTP status code returned by the service | HTTP Spans.
242235
| `http.user_agent` | The value of the `User-Agent` HTTP header sent to the service | HTTP Spans.
243-
| `requestId` | The value of the `x-ms-client-request-id` header sent by the client | HTTP Spans.
244-
| `serviceRequestId` | The value of the `x-ms-request-id` sent by the server | HTTP Spans.
236+
| `net.peer.id` | The fully qualified Azure service endpoint (host name component) | HTTP Spans.
237+
| `net.peer.port` | The TCP Port of the Azure service endpoint if not 80 or 443| HTTP Spans.
238+
| `az.client_request_id` | The value of the `x-ms-client-request-id` header sent by the client | HTTP Spans.
239+
| `az.service_request_id` | The value of the `x-ms-request-id` sent by the server | HTTP Spans.

sdk/core/azure-core-tracing-opentelemetry/CHANGELOG.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Release History
22

3-
## 1.0.0-beta.4 (Unreleased)
3+
## 1.0.0-beta.4 (2023-02-02)
44

55
### Features Added
66

7-
### Breaking Changes
8-
9-
### Bugs Fixed
7+
- Aligned OpenTelemetry tracing infrastructure with OpenTelemetry 1.17.0 conventions for use with Azure Monitor.
108

119
### Other Changes
10+
- Updated test collateral to reflect Azure Core tracing changes.
11+
- Suppress several warnings from opentelemetry-cpp package.
1212

1313
## 1.0.0-beta.3 (2022-08-04)
1414

sdk/core/azure-core-tracing-opentelemetry/vcpkg/Config.cmake.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
@PACKAGE_INIT@
55

66
include(CMakeFindDependencyMacro)
7-
find_dependency(azure-core-cpp "1.7.0-beta.1")
7+
find_dependency(azure-core-cpp "1.8.0")
88
find_dependency(Threads)
99

1010
find_dependency(opentelemetry-cpp)

sdk/core/azure-core-tracing-opentelemetry/vcpkg/vcpkg.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
{
1616
"name": "azure-core-cpp",
1717
"default-features": false,
18-
"version>=": "1.7.0-beta.1"
18+
"version>=": "1.8.0"
1919
},
2020
{
2121
"name": "opentelemetry-cpp",

0 commit comments

Comments
 (0)