From 9e9951bc406cc0152e6b8ed0c46664b42b144c55 Mon Sep 17 00:00:00 2001 From: Sameeksha Vaity Date: Fri, 22 Nov 2019 10:56:31 -0800 Subject: [PATCH 1/4] update samples and package versions --- .../CHANGELOG.md | 8 ++++ .../azure-core-tracing-opencensus/README.md | 19 +++++---- .../src/samples/AsyncListKeyVaultSecrets.md | 4 +- .../AsyncQueueClientEnqueueMessages.md | 4 +- .../src/samples/ListeKeyVaultSecrets.md | 4 +- .../src/samples/PublishEvents.md | 38 ++++++++++-------- .../src/samples/QueueClientEnqueueMessages.md | 4 +- .../CHANGELOG.md | 11 +++++- .../README.md | 14 +++++-- .../samples/AsyncListKeyVaultSecretsSample.md | 6 +-- ...CreateConfigurationSettingTracingSample.md | 4 +- .../ListKeyVaultSecretsTracingSample.md | 6 +-- .../src/samples/PublishEventsTracingSample.md | 39 ++++++++++++------- 13 files changed, 103 insertions(+), 58 deletions(-) diff --git a/sdk/core/azure-core-tracing-opencensus/CHANGELOG.md b/sdk/core/azure-core-tracing-opencensus/CHANGELOG.md index 7e9f54f15c0f..79f75dd6b48b 100644 --- a/sdk/core/azure-core-tracing-opencensus/CHANGELOG.md +++ b/sdk/core/azure-core-tracing-opencensus/CHANGELOG.md @@ -1,4 +1,12 @@ # Release History +## Version 1.0.0-beta.5 (2019-11-25) +For details on the Azure SDK for Java (December 2019 Preview) release refer to the [release announcement](https://aka.ms/azure-sdk-preview6-java). +Version 1.0.0-beta.5 extended support for 0.24.0 opencensus-api package version. + +This package's +[documentation](https://github.com/Azure/azure-sdk-for-java/blob/azure-core-tracing-opencensus_1.0.0-beta.5/sdk/core/azure-core-tracing-opencensus/README.md) +and +[samples](https://github.com/Azure/azure-sdk-for-java/blob/azure-core-tracing-opencensus_1.0.0-beta.5/sdk/core/azure-core-tracing-opencensus/src/samples). ## Version 1.0.0-preview.4 (2019-10-31) diff --git a/sdk/core/azure-core-tracing-opencensus/README.md b/sdk/core/azure-core-tracing-opencensus/README.md index abdc816c6205..f5c87194e4b5 100644 --- a/sdk/core/azure-core-tracing-opencensus/README.md +++ b/sdk/core/azure-core-tracing-opencensus/README.md @@ -19,7 +19,7 @@ documentation][api_documentation] | [Samples][samples] com.azure azure-core-tracing-opencensus - 1.0.0-beta.4 + 1.0.0-beta.5 ``` [//]: # ({x-version-update-end}) @@ -38,7 +38,7 @@ Netty and include OkHTTP client in your pom.xml. com.azure azure-core-tracing-opencensus - 1.0.0-beta.4 + 1.0.0-beta.5 com.azure @@ -54,7 +54,7 @@ Netty and include OkHTTP client in your pom.xml. com.azure azure-core-http-okhttp - 1.0.0 + 1.1.0-beta.1 ``` [//]: # ({x-version-update-end}) @@ -137,10 +137,15 @@ private static final Tracer TRACER; .buildProducer(); try (Scope scope = TRACER.spanBuilder("tracing-user-span").startScopedSpan()) { - Context tracingContext = new Context(PARENT_SPAN_KEY, TRACER.getCurrentSpan()); - // Create an event to send - final EventData eventData = new EventData("Hello world!".getBytes(UTF_8), traceContext); - producer.send(eventData); + EventData event1 = new EventData("1".getBytes(UTF_8)); + event1.addContext(PARENT_SPAN_KEY, span); + + EventDataBatch eventDataBatch = producer.createBatch(); + + if (!eventDataBatch.tryAdd(eventData)) { + producer.send(eventDataBatch); + eventDataBatch = producer.createBatch(); + } } finally { Tracing.getExportComponent().shutdown(); } diff --git a/sdk/core/azure-core-tracing-opencensus/src/samples/AsyncListKeyVaultSecrets.md b/sdk/core/azure-core-tracing-opencensus/src/samples/AsyncListKeyVaultSecrets.md index 01aa2ddd62fd..90759410b3d0 100644 --- a/sdk/core/azure-core-tracing-opencensus/src/samples/AsyncListKeyVaultSecrets.md +++ b/sdk/core/azure-core-tracing-opencensus/src/samples/AsyncListKeyVaultSecrets.md @@ -12,7 +12,7 @@ Sample uses **[opencensus-impl][opencensus_impl]** as implementation package and com.azure azure-security-keyvault-secrets - 4.0.0 + 4.1.0-beta.1 ``` [//]: # ({x-version-update-end}) @@ -22,7 +22,7 @@ Sample uses **[opencensus-impl][opencensus_impl]** as implementation package and com.azure azure-core-tracing-opencensus - 1.0.0-beta.4 + 1.0.0-beta.5 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/core/azure-core-tracing-opencensus/src/samples/AsyncQueueClientEnqueueMessages.md b/sdk/core/azure-core-tracing-opencensus/src/samples/AsyncQueueClientEnqueueMessages.md index b8aaf0a1fb9c..8481c64bf0f1 100644 --- a/sdk/core/azure-core-tracing-opencensus/src/samples/AsyncQueueClientEnqueueMessages.md +++ b/sdk/core/azure-core-tracing-opencensus/src/samples/AsyncQueueClientEnqueueMessages.md @@ -13,7 +13,7 @@ Sample uses **[opencensus-impl][opencensus_impl]** as implementation package and com.azure azure-storage-queue - 12.0.0 + 12.1.0-beta.1 ``` [//]: # ({x-version-update-end}) @@ -23,7 +23,7 @@ Sample uses **[opencensus-impl][opencensus_impl]** as implementation package and com.azure azure-core-tracing-opencensus - 1.0.0-beta.4 + 1.0.0-beta.5 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/core/azure-core-tracing-opencensus/src/samples/ListeKeyVaultSecrets.md b/sdk/core/azure-core-tracing-opencensus/src/samples/ListeKeyVaultSecrets.md index 6e1339b6d01b..3f3a2e7f0a06 100644 --- a/sdk/core/azure-core-tracing-opencensus/src/samples/ListeKeyVaultSecrets.md +++ b/sdk/core/azure-core-tracing-opencensus/src/samples/ListeKeyVaultSecrets.md @@ -12,7 +12,7 @@ Sample uses **[opencensus-impl][opencensus_impl]** as implementation package and com.azure azure-security-keyvault-secrets - 4.0.0 + 4.1.0-beta.1 ``` [//]: # ({x-version-update-end}) @@ -22,7 +22,7 @@ Sample uses **[opencensus-impl][opencensus_impl]** as implementation package and com.azure azure-core-tracing-opencensus - 1.0.0-beta.4 + 1.0.0-beta.5 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/core/azure-core-tracing-opencensus/src/samples/PublishEvents.md b/sdk/core/azure-core-tracing-opencensus/src/samples/PublishEvents.md index fb48bd0bd601..9e1d65e57f45 100644 --- a/sdk/core/azure-core-tracing-opencensus/src/samples/PublishEvents.md +++ b/sdk/core/azure-core-tracing-opencensus/src/samples/PublishEvents.md @@ -13,7 +13,7 @@ Sample uses **[opencensus-impl][opencensus_impl]** as implementation package and com.azure azure-messaging-eventhubs - 5.0.0-beta.5 + 5.0.0-beta.6 ``` [//]: # ({x-version-update-end}) @@ -66,25 +66,31 @@ public class PublishEvents { } public static void main(String[] args) { - final int count = 2; - final byte[] body = "Hello World!".getBytes(UTF_8); + EventHubProducerClient producer = new EventHubClientBuilder() + .connectionString(connectionString) + .buildProducerClient(); try(Scope scope = TRACER.spanBuilder("user-parent-span").startScopedSpan()) { + final EventData event1 = new EventData("1".getBytes(UTF_8)); + event1.addContext(PARENT_SPAN_KEY, TRACER.getCurrentSpan()); + + final EventData event2 = new EventData("2".getBytes(UTF_8)); + event2.addContext(PARENT_SPAN_KEY, TRACER.getCurrentSpan()); - Context traceContext = new Context(PARENT_SPAN_KEY, TRACER.getCurrentSpan()); - - EventHubProducerClient producer = new EventHubClientBuilder() - .connectionString(CONNECTION_STRING) - .buildProducer(); + final List telemetryEvents = Arrays.asList(event1, event2); + final CreateBatchOptions options = new CreateBatchOptions() + .setPartitionKey("telemetry") + .setMaximumSizeInBytes(256); + + EventDataBatch currentBatch = producer.createBatch(options); - final Context traceContext = new Context(PARENT_SPAN_KEY, TRACER.getCurrentSpan()); - final Flux testData = Flux.range(0, count) - .flatMap(number -> { - final EventData data = new EventData(body, traceContext); - return Flux.just(data); - }); - - producer.send(testData.toIterable(1)); + // For each telemetry event, we try to add it to the current batch. + for (EventData event : telemetryEvents) { + if (!currentBatch.tryAdd(event)) { + producer.send(currentBatch); + currentBatch = producer.createBatch(options); + } + } } finally { producer.close(); Tracing.getExportComponent().shutdown(); diff --git a/sdk/core/azure-core-tracing-opencensus/src/samples/QueueClientEnqueueMessages.md b/sdk/core/azure-core-tracing-opencensus/src/samples/QueueClientEnqueueMessages.md index 8420f1e8e250..e85fb6668396 100644 --- a/sdk/core/azure-core-tracing-opencensus/src/samples/QueueClientEnqueueMessages.md +++ b/sdk/core/azure-core-tracing-opencensus/src/samples/QueueClientEnqueueMessages.md @@ -13,7 +13,7 @@ Sample uses **[opencensus-impl][opencensus_impl]** as implementation package and com.azure azure-storage-queue - 12.0.0 + 12.1.0-beta.1 ``` [//]: # ({x-version-update-end}) @@ -23,7 +23,7 @@ Sample uses **[opencensus-impl][opencensus_impl]** as implementation package and com.azure azure-core-tracing-opencensus - 1.0.0-beta.4 + 1.0.0-beta.5 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/core/azure-core-tracing-opentelemetry/CHANGELOG.md b/sdk/core/azure-core-tracing-opentelemetry/CHANGELOG.md index 4239c9da32e7..9a44e2ec7468 100644 --- a/sdk/core/azure-core-tracing-opentelemetry/CHANGELOG.md +++ b/sdk/core/azure-core-tracing-opentelemetry/CHANGELOG.md @@ -1,5 +1,14 @@ # Release History -## Version 1.0.0-beta.1 (-12-) +## Version 1.0.0-beta.1 (2019-11-25) For details on the Azure SDK for Java (Decemeber 2019 Preview) release refer to the [release announcement](https://aka.ms/azure-sdk-preview5-java). +Version 1.0.0-beta.1 is the first preview of our efforts to provide low level interfaces and helper methods to support tracing for Java client libraries. +This library includes [OpenTelemetry](https://opentelemetry.io/) implementation of the interface. +This library added tracing instrumentation for AMQP and HTTP Java SDK client libraries across different languages and platforms. + +This package's +[documentation](https://github.com/Azure/azure-sdk-for-java/blob/azure-core-tracing-opentelemetry_1.0.0-beta.1/sdk/core/azure-core-tracing-opentelemetry/README.md) +and +[samples](https://github.com/Azure/azure-sdk-for-java/blob/azure-core-tracing-opentelemetry_1.0.0-beta.1/sdk/core/azure-core-tracing-opentelemetry/src/samples). + diff --git a/sdk/core/azure-core-tracing-opentelemetry/README.md b/sdk/core/azure-core-tracing-opentelemetry/README.md index 11ecbb277759..807b1e8245fd 100644 --- a/sdk/core/azure-core-tracing-opentelemetry/README.md +++ b/sdk/core/azure-core-tracing-opentelemetry/README.md @@ -53,7 +53,7 @@ Netty and include OkHTTP client in your pom.xml. com.azure azure-core-http-okhttp - 1.0.0 + 1.1.0-beta.1 ``` [//]: # ({x-version-update-end}) @@ -140,9 +140,15 @@ private static final TracerSdkFactory TRACER_SDK_FACTORY; Span span = TRACER.spanBuilder("user-parent-span").startSpan(); try (Scope scope = TRACER.withSpan(span)) { - Context traceContext = new Context(PARENT_SPAN_KEY, span); - EventData eventData = new EventData("Hello world!".getBytes(UTF_8), traceContext); - producer.send(eventData); + EventData event1 = new EventData("1".getBytes(UTF_8)); + event1.addContext(PARENT_SPAN_KEY, span); + + EventDataBatch eventDataBatch = producer.createBatch(); + + if (!eventDataBatch.tryAdd(eventData)) { + producer.send(eventDataBatch); + eventDataBatch = producer.createBatch(); + } } finally { span.end(); } diff --git a/sdk/core/azure-core-tracing-opentelemetry/src/samples/AsyncListKeyVaultSecretsSample.md b/sdk/core/azure-core-tracing-opentelemetry/src/samples/AsyncListKeyVaultSecretsSample.md index 93fcda73a2c4..229fab212fc5 100644 --- a/sdk/core/azure-core-tracing-opentelemetry/src/samples/AsyncListKeyVaultSecretsSample.md +++ b/sdk/core/azure-core-tracing-opentelemetry/src/samples/AsyncListKeyVaultSecretsSample.md @@ -10,12 +10,12 @@ Sample uses **[opentelemetry-sdk][opentelemetry_sdk]** as implementation package io.opentelemetry opentelemetry-sdk - 0.2.0-SNAPSHOT + 0.2.0 com.azure azure-security-keyvault-secrets - 4.0.0 + 4.1.0-beta.1 com.azure @@ -25,7 +25,7 @@ Sample uses **[opentelemetry-sdk][opentelemetry_sdk]** as implementation package io.opentelemetry opentelemetry-exporters-logging - 0.2.0-SNAPSHOT + 0.2.0 ``` diff --git a/sdk/core/azure-core-tracing-opentelemetry/src/samples/CreateConfigurationSettingTracingSample.md b/sdk/core/azure-core-tracing-opentelemetry/src/samples/CreateConfigurationSettingTracingSample.md index 17e8ae375d8d..a37ca0127df9 100644 --- a/sdk/core/azure-core-tracing-opentelemetry/src/samples/CreateConfigurationSettingTracingSample.md +++ b/sdk/core/azure-core-tracing-opentelemetry/src/samples/CreateConfigurationSettingTracingSample.md @@ -10,7 +10,7 @@ Sample uses **[opentelemetry-sdk][opentelemetry_sdk]** as implementation package io.opentelemetry opentelemetry-sdk - 0.2.0-SNAPSHOT + 0.2.0 com.azure @@ -25,7 +25,7 @@ Sample uses **[opentelemetry-sdk][opentelemetry_sdk]** as implementation package io.opentelemetry opentelemetry-exporters-logging - 0.2.0-SNAPSHOT + 0.2.0 diff --git a/sdk/core/azure-core-tracing-opentelemetry/src/samples/ListKeyVaultSecretsTracingSample.md b/sdk/core/azure-core-tracing-opentelemetry/src/samples/ListKeyVaultSecretsTracingSample.md index e06422cc0542..40c689588d98 100644 --- a/sdk/core/azure-core-tracing-opentelemetry/src/samples/ListKeyVaultSecretsTracingSample.md +++ b/sdk/core/azure-core-tracing-opentelemetry/src/samples/ListKeyVaultSecretsTracingSample.md @@ -10,12 +10,12 @@ Sample uses **[opentelemetry-sdk][opentelemetry_sdk]** as implementation package io.opentelemetry opentelemetry-sdk - 0.2.0-SNAPSHOT + 0.2.0 com.azure azure-security-keyvault-secrets - 4.0.0 + 4.1.0-beta.1 com.azure @@ -25,7 +25,7 @@ Sample uses **[opentelemetry-sdk][opentelemetry_sdk]** as implementation package io.opentelemetry opentelemetry-exporters-logging - 0.2.0-SNAPSHOT + 0.2.0 ``` diff --git a/sdk/core/azure-core-tracing-opentelemetry/src/samples/PublishEventsTracingSample.md b/sdk/core/azure-core-tracing-opentelemetry/src/samples/PublishEventsTracingSample.md index d1953f3f277c..2917f57a9121 100644 --- a/sdk/core/azure-core-tracing-opentelemetry/src/samples/PublishEventsTracingSample.md +++ b/sdk/core/azure-core-tracing-opentelemetry/src/samples/PublishEventsTracingSample.md @@ -10,12 +10,12 @@ Sample uses **[opentelemetry-sdk][opentelemetry_sdk]** for implementation and ** io.opentelemetry opentelemetry-sdk - 0.2.0-SNAPSHOT + 0.2.0 com.azure azure-messaging-eventhubs - 5.0.0-beta.5 + 5.0.0-beta.6 com.azure @@ -25,7 +25,7 @@ Sample uses **[opentelemetry-sdk][opentelemetry_sdk]** for implementation and ** io.opentelemetry opentelemetry-exporters-logging - 0.2.0-SNAPSHOT + 0.2.0 @@ -74,20 +74,31 @@ public class Sample { private static void doClientWork() { EventHubProducerClient producer = new EventHubClientBuilder() - .connectionString(CONNECTION_STRING) - .buildProducer(); - - final int count = 2; - final byte[] body = "Hello World!".getBytes(UTF_8); + .connectionString(connectionString) + .buildProducerClient(); Span span = TRACER.spanBuilder("user-parent-span").startSpan(); try (final Scope scope = TRACER.withSpan(span)) { - final Context traceContext = new Context(PARENT_SPAN_KEY, span); - final Flux testData = Flux.range(0, count).flatMap(number -> { - final EventData data = new EventData(body, traceContext); - return Flux.just(data); - }); - producer.send(testData.toIterable(1)); + final EventData event1 = new EventData("1".getBytes(UTF_8)); + event1.addContext(PARENT_SPAN_KEY, span); + + final EventData event2 = new EventData("2".getBytes(UTF_8)); + event2.addContext(PARENT_SPAN_KEY, span); + + final List telemetryEvents = Arrays.asList(event1, event2); + final CreateBatchOptions options = new CreateBatchOptions() + .setPartitionKey("telemetry") + .setMaximumSizeInBytes(256); + + EventDataBatch currentBatch = producer.createBatch(options); + + // For each telemetry event, we try to add it to the current batch. + for (EventData event : telemetryEvents) { + if (!currentBatch.tryAdd(event)) { + producer.send(currentBatch); + currentBatch = producer.createBatch(options); + } + } } finally { span.end(); producer.close(); From c07f9cc5690fc7d149a23c91ba6cd0187234f5f2 Mon Sep 17 00:00:00 2001 From: Sameeksha Vaity Date: Fri, 22 Nov 2019 11:01:11 -0800 Subject: [PATCH 2/4] Revert "update samples and package versions" This reverts commit 9e9951bc406cc0152e6b8ed0c46664b42b144c55. --- .../CHANGELOG.md | 8 ---- .../azure-core-tracing-opencensus/README.md | 19 ++++----- .../src/samples/AsyncListKeyVaultSecrets.md | 4 +- .../AsyncQueueClientEnqueueMessages.md | 4 +- .../src/samples/ListeKeyVaultSecrets.md | 4 +- .../src/samples/PublishEvents.md | 38 ++++++++---------- .../src/samples/QueueClientEnqueueMessages.md | 4 +- .../CHANGELOG.md | 11 +----- .../README.md | 14 ++----- .../samples/AsyncListKeyVaultSecretsSample.md | 6 +-- ...CreateConfigurationSettingTracingSample.md | 4 +- .../ListKeyVaultSecretsTracingSample.md | 6 +-- .../src/samples/PublishEventsTracingSample.md | 39 +++++++------------ 13 files changed, 58 insertions(+), 103 deletions(-) diff --git a/sdk/core/azure-core-tracing-opencensus/CHANGELOG.md b/sdk/core/azure-core-tracing-opencensus/CHANGELOG.md index 79f75dd6b48b..7e9f54f15c0f 100644 --- a/sdk/core/azure-core-tracing-opencensus/CHANGELOG.md +++ b/sdk/core/azure-core-tracing-opencensus/CHANGELOG.md @@ -1,12 +1,4 @@ # Release History -## Version 1.0.0-beta.5 (2019-11-25) -For details on the Azure SDK for Java (December 2019 Preview) release refer to the [release announcement](https://aka.ms/azure-sdk-preview6-java). -Version 1.0.0-beta.5 extended support for 0.24.0 opencensus-api package version. - -This package's -[documentation](https://github.com/Azure/azure-sdk-for-java/blob/azure-core-tracing-opencensus_1.0.0-beta.5/sdk/core/azure-core-tracing-opencensus/README.md) -and -[samples](https://github.com/Azure/azure-sdk-for-java/blob/azure-core-tracing-opencensus_1.0.0-beta.5/sdk/core/azure-core-tracing-opencensus/src/samples). ## Version 1.0.0-preview.4 (2019-10-31) diff --git a/sdk/core/azure-core-tracing-opencensus/README.md b/sdk/core/azure-core-tracing-opencensus/README.md index f5c87194e4b5..abdc816c6205 100644 --- a/sdk/core/azure-core-tracing-opencensus/README.md +++ b/sdk/core/azure-core-tracing-opencensus/README.md @@ -19,7 +19,7 @@ documentation][api_documentation] | [Samples][samples] com.azure azure-core-tracing-opencensus - 1.0.0-beta.5 + 1.0.0-beta.4 ``` [//]: # ({x-version-update-end}) @@ -38,7 +38,7 @@ Netty and include OkHTTP client in your pom.xml. com.azure azure-core-tracing-opencensus - 1.0.0-beta.5 + 1.0.0-beta.4 com.azure @@ -54,7 +54,7 @@ Netty and include OkHTTP client in your pom.xml. com.azure azure-core-http-okhttp - 1.1.0-beta.1 + 1.0.0 ``` [//]: # ({x-version-update-end}) @@ -137,15 +137,10 @@ private static final Tracer TRACER; .buildProducer(); try (Scope scope = TRACER.spanBuilder("tracing-user-span").startScopedSpan()) { - EventData event1 = new EventData("1".getBytes(UTF_8)); - event1.addContext(PARENT_SPAN_KEY, span); - - EventDataBatch eventDataBatch = producer.createBatch(); - - if (!eventDataBatch.tryAdd(eventData)) { - producer.send(eventDataBatch); - eventDataBatch = producer.createBatch(); - } + Context tracingContext = new Context(PARENT_SPAN_KEY, TRACER.getCurrentSpan()); + // Create an event to send + final EventData eventData = new EventData("Hello world!".getBytes(UTF_8), traceContext); + producer.send(eventData); } finally { Tracing.getExportComponent().shutdown(); } diff --git a/sdk/core/azure-core-tracing-opencensus/src/samples/AsyncListKeyVaultSecrets.md b/sdk/core/azure-core-tracing-opencensus/src/samples/AsyncListKeyVaultSecrets.md index 90759410b3d0..01aa2ddd62fd 100644 --- a/sdk/core/azure-core-tracing-opencensus/src/samples/AsyncListKeyVaultSecrets.md +++ b/sdk/core/azure-core-tracing-opencensus/src/samples/AsyncListKeyVaultSecrets.md @@ -12,7 +12,7 @@ Sample uses **[opencensus-impl][opencensus_impl]** as implementation package and com.azure azure-security-keyvault-secrets - 4.1.0-beta.1 + 4.0.0 ``` [//]: # ({x-version-update-end}) @@ -22,7 +22,7 @@ Sample uses **[opencensus-impl][opencensus_impl]** as implementation package and com.azure azure-core-tracing-opencensus - 1.0.0-beta.5 + 1.0.0-beta.4 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/core/azure-core-tracing-opencensus/src/samples/AsyncQueueClientEnqueueMessages.md b/sdk/core/azure-core-tracing-opencensus/src/samples/AsyncQueueClientEnqueueMessages.md index 8481c64bf0f1..b8aaf0a1fb9c 100644 --- a/sdk/core/azure-core-tracing-opencensus/src/samples/AsyncQueueClientEnqueueMessages.md +++ b/sdk/core/azure-core-tracing-opencensus/src/samples/AsyncQueueClientEnqueueMessages.md @@ -13,7 +13,7 @@ Sample uses **[opencensus-impl][opencensus_impl]** as implementation package and com.azure azure-storage-queue - 12.1.0-beta.1 + 12.0.0 ``` [//]: # ({x-version-update-end}) @@ -23,7 +23,7 @@ Sample uses **[opencensus-impl][opencensus_impl]** as implementation package and com.azure azure-core-tracing-opencensus - 1.0.0-beta.5 + 1.0.0-beta.4 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/core/azure-core-tracing-opencensus/src/samples/ListeKeyVaultSecrets.md b/sdk/core/azure-core-tracing-opencensus/src/samples/ListeKeyVaultSecrets.md index 3f3a2e7f0a06..6e1339b6d01b 100644 --- a/sdk/core/azure-core-tracing-opencensus/src/samples/ListeKeyVaultSecrets.md +++ b/sdk/core/azure-core-tracing-opencensus/src/samples/ListeKeyVaultSecrets.md @@ -12,7 +12,7 @@ Sample uses **[opencensus-impl][opencensus_impl]** as implementation package and com.azure azure-security-keyvault-secrets - 4.1.0-beta.1 + 4.0.0 ``` [//]: # ({x-version-update-end}) @@ -22,7 +22,7 @@ Sample uses **[opencensus-impl][opencensus_impl]** as implementation package and com.azure azure-core-tracing-opencensus - 1.0.0-beta.5 + 1.0.0-beta.4 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/core/azure-core-tracing-opencensus/src/samples/PublishEvents.md b/sdk/core/azure-core-tracing-opencensus/src/samples/PublishEvents.md index 9e1d65e57f45..fb48bd0bd601 100644 --- a/sdk/core/azure-core-tracing-opencensus/src/samples/PublishEvents.md +++ b/sdk/core/azure-core-tracing-opencensus/src/samples/PublishEvents.md @@ -13,7 +13,7 @@ Sample uses **[opencensus-impl][opencensus_impl]** as implementation package and com.azure azure-messaging-eventhubs - 5.0.0-beta.6 + 5.0.0-beta.5 ``` [//]: # ({x-version-update-end}) @@ -66,31 +66,25 @@ public class PublishEvents { } public static void main(String[] args) { - EventHubProducerClient producer = new EventHubClientBuilder() - .connectionString(connectionString) - .buildProducerClient(); + final int count = 2; + final byte[] body = "Hello World!".getBytes(UTF_8); try(Scope scope = TRACER.spanBuilder("user-parent-span").startScopedSpan()) { - final EventData event1 = new EventData("1".getBytes(UTF_8)); - event1.addContext(PARENT_SPAN_KEY, TRACER.getCurrentSpan()); - - final EventData event2 = new EventData("2".getBytes(UTF_8)); - event2.addContext(PARENT_SPAN_KEY, TRACER.getCurrentSpan()); - final List telemetryEvents = Arrays.asList(event1, event2); - final CreateBatchOptions options = new CreateBatchOptions() - .setPartitionKey("telemetry") - .setMaximumSizeInBytes(256); - - EventDataBatch currentBatch = producer.createBatch(options); + Context traceContext = new Context(PARENT_SPAN_KEY, TRACER.getCurrentSpan()); + + EventHubProducerClient producer = new EventHubClientBuilder() + .connectionString(CONNECTION_STRING) + .buildProducer(); - // For each telemetry event, we try to add it to the current batch. - for (EventData event : telemetryEvents) { - if (!currentBatch.tryAdd(event)) { - producer.send(currentBatch); - currentBatch = producer.createBatch(options); - } - } + final Context traceContext = new Context(PARENT_SPAN_KEY, TRACER.getCurrentSpan()); + final Flux testData = Flux.range(0, count) + .flatMap(number -> { + final EventData data = new EventData(body, traceContext); + return Flux.just(data); + }); + + producer.send(testData.toIterable(1)); } finally { producer.close(); Tracing.getExportComponent().shutdown(); diff --git a/sdk/core/azure-core-tracing-opencensus/src/samples/QueueClientEnqueueMessages.md b/sdk/core/azure-core-tracing-opencensus/src/samples/QueueClientEnqueueMessages.md index e85fb6668396..8420f1e8e250 100644 --- a/sdk/core/azure-core-tracing-opencensus/src/samples/QueueClientEnqueueMessages.md +++ b/sdk/core/azure-core-tracing-opencensus/src/samples/QueueClientEnqueueMessages.md @@ -13,7 +13,7 @@ Sample uses **[opencensus-impl][opencensus_impl]** as implementation package and com.azure azure-storage-queue - 12.1.0-beta.1 + 12.0.0 ``` [//]: # ({x-version-update-end}) @@ -23,7 +23,7 @@ Sample uses **[opencensus-impl][opencensus_impl]** as implementation package and com.azure azure-core-tracing-opencensus - 1.0.0-beta.5 + 1.0.0-beta.4 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/core/azure-core-tracing-opentelemetry/CHANGELOG.md b/sdk/core/azure-core-tracing-opentelemetry/CHANGELOG.md index 9a44e2ec7468..4239c9da32e7 100644 --- a/sdk/core/azure-core-tracing-opentelemetry/CHANGELOG.md +++ b/sdk/core/azure-core-tracing-opentelemetry/CHANGELOG.md @@ -1,14 +1,5 @@ # Release History -## Version 1.0.0-beta.1 (2019-11-25) +## Version 1.0.0-beta.1 (-12-) For details on the Azure SDK for Java (Decemeber 2019 Preview) release refer to the [release announcement](https://aka.ms/azure-sdk-preview5-java). -Version 1.0.0-beta.1 is the first preview of our efforts to provide low level interfaces and helper methods to support tracing for Java client libraries. -This library includes [OpenTelemetry](https://opentelemetry.io/) implementation of the interface. -This library added tracing instrumentation for AMQP and HTTP Java SDK client libraries across different languages and platforms. - -This package's -[documentation](https://github.com/Azure/azure-sdk-for-java/blob/azure-core-tracing-opentelemetry_1.0.0-beta.1/sdk/core/azure-core-tracing-opentelemetry/README.md) -and -[samples](https://github.com/Azure/azure-sdk-for-java/blob/azure-core-tracing-opentelemetry_1.0.0-beta.1/sdk/core/azure-core-tracing-opentelemetry/src/samples). - diff --git a/sdk/core/azure-core-tracing-opentelemetry/README.md b/sdk/core/azure-core-tracing-opentelemetry/README.md index 807b1e8245fd..11ecbb277759 100644 --- a/sdk/core/azure-core-tracing-opentelemetry/README.md +++ b/sdk/core/azure-core-tracing-opentelemetry/README.md @@ -53,7 +53,7 @@ Netty and include OkHTTP client in your pom.xml. com.azure azure-core-http-okhttp - 1.1.0-beta.1 + 1.0.0 ``` [//]: # ({x-version-update-end}) @@ -140,15 +140,9 @@ private static final TracerSdkFactory TRACER_SDK_FACTORY; Span span = TRACER.spanBuilder("user-parent-span").startSpan(); try (Scope scope = TRACER.withSpan(span)) { - EventData event1 = new EventData("1".getBytes(UTF_8)); - event1.addContext(PARENT_SPAN_KEY, span); - - EventDataBatch eventDataBatch = producer.createBatch(); - - if (!eventDataBatch.tryAdd(eventData)) { - producer.send(eventDataBatch); - eventDataBatch = producer.createBatch(); - } + Context traceContext = new Context(PARENT_SPAN_KEY, span); + EventData eventData = new EventData("Hello world!".getBytes(UTF_8), traceContext); + producer.send(eventData); } finally { span.end(); } diff --git a/sdk/core/azure-core-tracing-opentelemetry/src/samples/AsyncListKeyVaultSecretsSample.md b/sdk/core/azure-core-tracing-opentelemetry/src/samples/AsyncListKeyVaultSecretsSample.md index 229fab212fc5..93fcda73a2c4 100644 --- a/sdk/core/azure-core-tracing-opentelemetry/src/samples/AsyncListKeyVaultSecretsSample.md +++ b/sdk/core/azure-core-tracing-opentelemetry/src/samples/AsyncListKeyVaultSecretsSample.md @@ -10,12 +10,12 @@ Sample uses **[opentelemetry-sdk][opentelemetry_sdk]** as implementation package io.opentelemetry opentelemetry-sdk - 0.2.0 + 0.2.0-SNAPSHOT com.azure azure-security-keyvault-secrets - 4.1.0-beta.1 + 4.0.0 com.azure @@ -25,7 +25,7 @@ Sample uses **[opentelemetry-sdk][opentelemetry_sdk]** as implementation package io.opentelemetry opentelemetry-exporters-logging - 0.2.0 + 0.2.0-SNAPSHOT ``` diff --git a/sdk/core/azure-core-tracing-opentelemetry/src/samples/CreateConfigurationSettingTracingSample.md b/sdk/core/azure-core-tracing-opentelemetry/src/samples/CreateConfigurationSettingTracingSample.md index a37ca0127df9..17e8ae375d8d 100644 --- a/sdk/core/azure-core-tracing-opentelemetry/src/samples/CreateConfigurationSettingTracingSample.md +++ b/sdk/core/azure-core-tracing-opentelemetry/src/samples/CreateConfigurationSettingTracingSample.md @@ -10,7 +10,7 @@ Sample uses **[opentelemetry-sdk][opentelemetry_sdk]** as implementation package io.opentelemetry opentelemetry-sdk - 0.2.0 + 0.2.0-SNAPSHOT com.azure @@ -25,7 +25,7 @@ Sample uses **[opentelemetry-sdk][opentelemetry_sdk]** as implementation package io.opentelemetry opentelemetry-exporters-logging - 0.2.0 + 0.2.0-SNAPSHOT diff --git a/sdk/core/azure-core-tracing-opentelemetry/src/samples/ListKeyVaultSecretsTracingSample.md b/sdk/core/azure-core-tracing-opentelemetry/src/samples/ListKeyVaultSecretsTracingSample.md index 40c689588d98..e06422cc0542 100644 --- a/sdk/core/azure-core-tracing-opentelemetry/src/samples/ListKeyVaultSecretsTracingSample.md +++ b/sdk/core/azure-core-tracing-opentelemetry/src/samples/ListKeyVaultSecretsTracingSample.md @@ -10,12 +10,12 @@ Sample uses **[opentelemetry-sdk][opentelemetry_sdk]** as implementation package io.opentelemetry opentelemetry-sdk - 0.2.0 + 0.2.0-SNAPSHOT com.azure azure-security-keyvault-secrets - 4.1.0-beta.1 + 4.0.0 com.azure @@ -25,7 +25,7 @@ Sample uses **[opentelemetry-sdk][opentelemetry_sdk]** as implementation package io.opentelemetry opentelemetry-exporters-logging - 0.2.0 + 0.2.0-SNAPSHOT ``` diff --git a/sdk/core/azure-core-tracing-opentelemetry/src/samples/PublishEventsTracingSample.md b/sdk/core/azure-core-tracing-opentelemetry/src/samples/PublishEventsTracingSample.md index 2917f57a9121..d1953f3f277c 100644 --- a/sdk/core/azure-core-tracing-opentelemetry/src/samples/PublishEventsTracingSample.md +++ b/sdk/core/azure-core-tracing-opentelemetry/src/samples/PublishEventsTracingSample.md @@ -10,12 +10,12 @@ Sample uses **[opentelemetry-sdk][opentelemetry_sdk]** for implementation and ** io.opentelemetry opentelemetry-sdk - 0.2.0 + 0.2.0-SNAPSHOT com.azure azure-messaging-eventhubs - 5.0.0-beta.6 + 5.0.0-beta.5 com.azure @@ -25,7 +25,7 @@ Sample uses **[opentelemetry-sdk][opentelemetry_sdk]** for implementation and ** io.opentelemetry opentelemetry-exporters-logging - 0.2.0 + 0.2.0-SNAPSHOT @@ -74,31 +74,20 @@ public class Sample { private static void doClientWork() { EventHubProducerClient producer = new EventHubClientBuilder() - .connectionString(connectionString) - .buildProducerClient(); + .connectionString(CONNECTION_STRING) + .buildProducer(); + + final int count = 2; + final byte[] body = "Hello World!".getBytes(UTF_8); Span span = TRACER.spanBuilder("user-parent-span").startSpan(); try (final Scope scope = TRACER.withSpan(span)) { - final EventData event1 = new EventData("1".getBytes(UTF_8)); - event1.addContext(PARENT_SPAN_KEY, span); - - final EventData event2 = new EventData("2".getBytes(UTF_8)); - event2.addContext(PARENT_SPAN_KEY, span); - - final List telemetryEvents = Arrays.asList(event1, event2); - final CreateBatchOptions options = new CreateBatchOptions() - .setPartitionKey("telemetry") - .setMaximumSizeInBytes(256); - - EventDataBatch currentBatch = producer.createBatch(options); - - // For each telemetry event, we try to add it to the current batch. - for (EventData event : telemetryEvents) { - if (!currentBatch.tryAdd(event)) { - producer.send(currentBatch); - currentBatch = producer.createBatch(options); - } - } + final Context traceContext = new Context(PARENT_SPAN_KEY, span); + final Flux testData = Flux.range(0, count).flatMap(number -> { + final EventData data = new EventData(body, traceContext); + return Flux.just(data); + }); + producer.send(testData.toIterable(1)); } finally { span.end(); producer.close(); From 24c94734fc647a6bdabcce4b96b9ec31a8b5099e Mon Sep 17 00:00:00 2001 From: Sameeksha Vaity Date: Wed, 11 Dec 2019 11:52:32 -0800 Subject: [PATCH 3/4] update tracing readme --- .../azure-core-tracing-opencensus/README.md | 49 +---------------- .../src/samples/AsyncListKeyVaultSecrets.md | 4 +- .../AsyncQueueClientEnqueueMessages.md | 11 ++-- .../src/samples/ListeKeyVaultSecrets.md | 7 ++- .../src/samples/PublishEvents.md | 7 ++- .../src/samples/QueueClientEnqueueMessages.md | 7 ++- .../README.md | 52 ++----------------- .../samples/AsyncListKeyVaultSecretsSample.md | 52 +++++++++++-------- ...CreateConfigurationSettingTracingSample.md | 52 +++++++++++-------- .../ListKeyVaultSecretsTracingSample.md | 52 +++++++++++-------- .../src/samples/PublishEventsTracingSample.md | 52 +++++++++++-------- 11 files changed, 149 insertions(+), 196 deletions(-) diff --git a/sdk/core/azure-core-tracing-opencensus/README.md b/sdk/core/azure-core-tracing-opencensus/README.md index acfa6391af93..00a7c834c67e 100644 --- a/sdk/core/azure-core-tracing-opencensus/README.md +++ b/sdk/core/azure-core-tracing-opencensus/README.md @@ -19,58 +19,11 @@ documentation][api_documentation] | [Samples][samples] com.azure azure-core-tracing-opencensus - 1.0.0-beta.5 + 1.0.0-beta.5 ``` [//]: # ({x-version-update-end}) -### Default HTTP Client -All client libraries, by default, use Netty HTTP client. Adding the above dependency will automatically configure -Tracing OpenCensus to use Netty HTTP client. - -### Alternate HTTP Client -If, instead of Netty it is preferable to use OkHTTP, there is a HTTP client available for that too. Exclude the default -Netty and include OkHTTP client in your pom.xml. - -[//]: # ({x-version-update-start;com.azure:azure-core-tracing-opencensus;current}) -```xml - - - com.azure - azure-core-tracing-opencensus - 1.0.0-beta.5 - - - com.azure - azure-core-http-netty - - - -``` -[//]: # ({x-version-update-end}) -[//]: # ({x-version-update-start;com.azure:azure-core-http-okhttp;current}) -```xml - - - com.azure - azure-core-http-okhttp - 1.0.0 - -``` -[//]: # ({x-version-update-end}) - -### Configuring HTTP Clients -When an HTTP client is included on the classpath, as shown above, it is not necessary to specify it in the client library [builders][create-eventhubs-builders], unless you want to customize the HTTP client in some fashion. If this is desired, the `httpClient` builder method is often available to achieve just this, by allowing users to provide a custom (or customized) `com.azure.core.http.HttpClient` instances. - -For starters, by having the Netty or OkHTTP dependencies on your classpath, as shown above, you can create new instances of these `HttpClient` types using their builder APIs. For example, here is how you would create a Netty HttpClient instance: - -```java -HttpClient client = new NettyAsyncHttpClientBuilder() - .port(8080) - .wiretap(true) - .build(); -``` - ## Key concepts ### Trace A trace is a tree of spans showing the path of work through a system. A trace on its own is distinguishable by a unique 16 byte sequence called a TraceID. diff --git a/sdk/core/azure-core-tracing-opencensus/src/samples/AsyncListKeyVaultSecrets.md b/sdk/core/azure-core-tracing-opencensus/src/samples/AsyncListKeyVaultSecrets.md index 4fa008479e2e..1e29612b229d 100644 --- a/sdk/core/azure-core-tracing-opencensus/src/samples/AsyncListKeyVaultSecrets.md +++ b/sdk/core/azure-core-tracing-opencensus/src/samples/AsyncListKeyVaultSecrets.md @@ -12,7 +12,7 @@ Sample uses **[opencensus-impl][opencensus_impl]** as implementation package and com.azure azure-security-keyvault-secrets - 4.0.1 + 4.0.1 ``` [//]: # ({x-version-update-end}) @@ -22,7 +22,7 @@ Sample uses **[opencensus-impl][opencensus_impl]** as implementation package and com.azure azure-core-tracing-opencensus - 1.0.0-beta.5 + 1.0.0-beta.5 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/core/azure-core-tracing-opencensus/src/samples/AsyncQueueClientEnqueueMessages.md b/sdk/core/azure-core-tracing-opencensus/src/samples/AsyncQueueClientEnqueueMessages.md index 285fe7d43904..61cebcc34ff0 100644 --- a/sdk/core/azure-core-tracing-opencensus/src/samples/AsyncQueueClientEnqueueMessages.md +++ b/sdk/core/azure-core-tracing-opencensus/src/samples/AsyncQueueClientEnqueueMessages.md @@ -7,29 +7,31 @@ messages on queue client with tracing instrumentation. Sample uses **[opencensus-impl][opencensus_impl]** as implementation package and **[Zipkin Exporter][zipkin_exporter]** as exporter. ### Adding dependencies to your project: + [//]: # ({x-version-update-start;com.azure:azure-storage-queue;current}) ```xml com.azure azure-storage-queue - 12.1.0 + 12.1.0 ``` [//]: # ({x-version-update-end}) + [//]: # ({x-version-update-start;com.azure:azure-core-tracing-opencensus;current}) ```xml com.azure azure-core-tracing-opencensus - 1.0.0-beta.5 + 1.0.0-beta.5 ``` [//]: # ({x-version-update-end}) + ```xml - io.opencensus opencensus-exporter-trace-zipkin @@ -41,6 +43,8 @@ Sample uses **[opencensus-impl][opencensus_impl]** as implementation package and 0.24.0 ``` +> All client libraries, by default, use Netty HTTP client. For adding client library dependency without netty, please follow the documentation [here][alternate_http_client]. + #### Sample demonstrates tracing when asynchronously queueing and dequeuing of messages using [azure-storage-queue][azure_storage_queue] client library. ```java import com.azure.core.util.Context; @@ -118,6 +122,7 @@ public class Sample { ``` +[alternate_http_client]: https://github.com/Azure/azure-sdk-for-java/tree/master/sdk/storage/azure-storage-queue#alternate-http-client [azure_storage_queue]: https://mvnrepository.com/artifact/com.azure/azure-storage-queue [opencensus_impl]: https://mvnrepository.com/artifact/io.opencensus/opencensus-impl/ [zipkin_exporter]: https://mvnrepository.com/artifact/io.opencensus/opencensus-exporter-trace-zipkin diff --git a/sdk/core/azure-core-tracing-opencensus/src/samples/ListeKeyVaultSecrets.md b/sdk/core/azure-core-tracing-opencensus/src/samples/ListeKeyVaultSecrets.md index a9dd0a106861..7c2dfc39f4a7 100644 --- a/sdk/core/azure-core-tracing-opencensus/src/samples/ListeKeyVaultSecrets.md +++ b/sdk/core/azure-core-tracing-opencensus/src/samples/ListeKeyVaultSecrets.md @@ -6,26 +6,29 @@ Following documentation describes instructions to run a sample program for creat Sample uses **[opencensus-impl][opencensus_impl]** as implementation package and **[ZipkinExporter][zipkin_exporter]** as exporter. ### Adding dependencies to your project: + [//]: # ({x-version-update-start;com.azure:azure-security-keyvault-secrets;current}) ```xml com.azure azure-security-keyvault-secrets - 4.0.1 + 4.0.1 ``` [//]: # ({x-version-update-end}) + [//]: # ({x-version-update-start;com.azure:azure-core-tracing-opencensus;current}) ```xml com.azure azure-core-tracing-opencensus - 1.0.0-beta.5 + 1.0.0-beta.5 ``` [//]: # ({x-version-update-end}) + ```xml diff --git a/sdk/core/azure-core-tracing-opencensus/src/samples/PublishEvents.md b/sdk/core/azure-core-tracing-opencensus/src/samples/PublishEvents.md index 61f73847b05d..23774c93cae6 100644 --- a/sdk/core/azure-core-tracing-opencensus/src/samples/PublishEvents.md +++ b/sdk/core/azure-core-tracing-opencensus/src/samples/PublishEvents.md @@ -7,22 +7,25 @@ Following documentation describes instructions to run a sample program for publi Sample uses **[opencensus-impl][opencensus_impl]** as implementation package and **[Zipkin Exporter][zipkin_exporter]** as exporter. ### Adding dependencies to your project: + [//]: # ({x-version-update-start;com.azure:azure-messaging-eventhubs;current}) ```xml com.azure azure-messaging-eventhubs - 5.0.0-beta.6 + 5.0.0-beta.6 ``` [//]: # ({x-version-update-end}) + +[//]: # ({x-version-update-start;com.azure:azure-core-tracing-opencensus;current}) ```xml com.azure azure-core-tracing-opencensus - 1.0.0-beta.5 + 1.0.0-beta.5 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/core/azure-core-tracing-opencensus/src/samples/QueueClientEnqueueMessages.md b/sdk/core/azure-core-tracing-opencensus/src/samples/QueueClientEnqueueMessages.md index 5651e6decc5d..2050ee3fc67e 100644 --- a/sdk/core/azure-core-tracing-opencensus/src/samples/QueueClientEnqueueMessages.md +++ b/sdk/core/azure-core-tracing-opencensus/src/samples/QueueClientEnqueueMessages.md @@ -7,26 +7,29 @@ messages on queue client with tracing instrumentation. Sample uses **[opencensus-impl][opencensus_impl]** as implementation package and **[Zipkin Exporter][zipkin_exporter]** as exporter. ### Adding dependencies to your project: + [//]: # ({x-version-update-start;com.azure:azure-storage-queue;current}) ```xml com.azure azure-storage-queue - 12.1.0 + 12.1.0 ``` [//]: # ({x-version-update-end}) + [//]: # ({x-version-update-start;com.azure:azure-core-tracing-opencensus;current}) ```xml com.azure azure-core-tracing-opencensus - 1.0.0-beta.5 + 1.0.0-beta.5 ``` [//]: # ({x-version-update-end}) + ```xml diff --git a/sdk/core/azure-core-tracing-opentelemetry/README.md b/sdk/core/azure-core-tracing-opentelemetry/README.md index 4cc6f4cfc4c7..772a8b26ac5a 100644 --- a/sdk/core/azure-core-tracing-opentelemetry/README.md +++ b/sdk/core/azure-core-tracing-opentelemetry/README.md @@ -13,63 +13,17 @@ documentation][api_documentation] | [Samples][samples] - [Maven][maven] ### Adding package to your product -[//]: # ({x-version-update-start;com.azure:azure-core-tracing-opentelemetry;current}) -```xml - - com.azure - azure-core-tracing-opentelemetry - 1.0.0-beta.1 - -``` -[//]: # ({x-version-update-end}) - -### Default HTTP Client -All client libraries, by default, use Netty HTTP client. Adding the above dependency will automatically configure -Tracing OpenTelemetry to use Netty HTTP client. - -### Alternate HTTP Client -If, instead of Netty it is preferable to use OkHTTP, there is a HTTP client available for that too. Exclude the default -Netty and include OkHTTP client in your pom.xml. [//]: # ({x-version-update-start;com.azure:azure-core-tracing-opentelemetry;current}) ```xml - - - com.azure - azure-core-tracing-opentelemetry - 1.0.0-beta.1 - - - com.azure - azure-core-http-netty - - - -``` -[//]: # ({x-version-update-end}) -[//]: # ({x-version-update-start;com.azure:azure-core-http-okhttp;current}) -```xml - com.azure - azure-core-http-okhttp - 1.0.0 + azure-core-tracing-opentelemetry + 1.0.0-beta.1 ``` [//]: # ({x-version-update-end}) -### Configuring HTTP Clients -When an HTTP client is included on the classpath, as shown above, it is not necessary to specify it in the client library [builders][create-eventhubs-builders], unless you want to customize the HTTP client in some fashion. If this is desired, the `httpClient` builder method is often available to achieve just this, by allowing users to provide a custom (or customized) `com.azure.core.http.HttpClient` instances. - -For starters, by having the Netty or OkHTTP dependencies on your classpath, as shown above, you can create new instances of these `HttpClient` types using their builder APIs. For example, here is how you would create a Netty HttpClient instance: - -```java -HttpClient client = new NettyAsyncHttpClientBuilder() - .port(8080) - .wiretap(true) - .build(); -``` - ## Key concepts ### Trace A trace is a tree of spans showing the path of work through a system. A trace on its own is distinguishable by a unique 16 byte sequence called a TraceID. @@ -180,7 +134,7 @@ When you submit a pull request, a CLA-bot will automatically determine whether y This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments. -[api_documentation]: https://azure.github.io/azure-sdk-for-java/track2reports/index.html +[api_documentation]: https://azure.github.io/azure-sdk-for-java/ [azure_data_app_configuration]: https://mvnrepository.com/artifact/com.azure/azure-data-appconfiguration/ [azure-security-keyvault-secrets]: ../../keyvault/azure-security-keyvault-secrets [azure_keyvault_secrets]: https://mvnrepository.com/artifact/com.azure/azure-security-keyvault-secrets diff --git a/sdk/core/azure-core-tracing-opentelemetry/src/samples/AsyncListKeyVaultSecretsSample.md b/sdk/core/azure-core-tracing-opentelemetry/src/samples/AsyncListKeyVaultSecretsSample.md index 2a193f24b3f7..6321aacb17a1 100644 --- a/sdk/core/azure-core-tracing-opentelemetry/src/samples/AsyncListKeyVaultSecretsSample.md +++ b/sdk/core/azure-core-tracing-opentelemetry/src/samples/AsyncListKeyVaultSecretsSample.md @@ -6,30 +6,38 @@ Following documentation describes instructions to run a sample program for async Sample uses **[opentelemetry-sdk][opentelemetry_sdk]** as implementation package and **[Logging Exporter][logging_exporter]** as exporter. ### Adding dependencies to your project: ```xml - - - io.opentelemetry - opentelemetry-sdk - 0.2.0 - - - com.azure - azure-security-keyvault-secrets - 4.0.1 - - - com.azure - azure-core-tracing-opentelemetry - 1.0.0-beta.1 - - - io.opentelemetry - opentelemetry-exporters-logging - 0.2.0 - - + + io.opentelemetry + opentelemetry-sdk + 0.2.0 + + + io.opentelemetry + opentelemetry-exporters-logging + 0.2.0 + ``` +[//]: # ({x-version-update-start;com.azure:azure-security-keyvault-secrets;current}) +```xml + + com.azure + azure-security-keyvault-secrets + 4.0.1 + +``` +[//]: # ({x-version-update-end}) + +[//]: # ({x-version-update-start;com.azure:azure-core-tracing-opentelemetry;current}) +```xml + + com.azure + azure-core-tracing-opentelemetry + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + #### Sample demonstrates tracing when asynchronously creating and listing secrets from a Key Vault using [azure-security-keyvault-secrets][azure_keyvault_secrets] client library. ```java import com.azure.identity.DefaultAzureCredentialBuilder; diff --git a/sdk/core/azure-core-tracing-opentelemetry/src/samples/CreateConfigurationSettingTracingSample.md b/sdk/core/azure-core-tracing-opentelemetry/src/samples/CreateConfigurationSettingTracingSample.md index b13c710ceff6..ddaa90782a1c 100644 --- a/sdk/core/azure-core-tracing-opentelemetry/src/samples/CreateConfigurationSettingTracingSample.md +++ b/sdk/core/azure-core-tracing-opentelemetry/src/samples/CreateConfigurationSettingTracingSample.md @@ -6,30 +6,38 @@ Following documentation describes instructions to run a sample program for creat Sample uses **[opentelemetry-sdk][opentelemetry_sdk]** as implementation package and **[Logging Exporter][logging_exporter]** as exporter. ### Adding dependencies to your project: ```xml - - - io.opentelemetry - opentelemetry-sdk - 0.2.0 - - - com.azure - azure-data-appconfiguration - 1.0.0-beta.7 - - - com.azure - azure-core-tracing-opentelemetry - 1.0.0-beta.1 - - - io.opentelemetry - opentelemetry-exporters-logging - 0.2.0 - - + + io.opentelemetry + opentelemetry-sdk + 0.2.0 + + + io.opentelemetry + opentelemetry-exporters-logging + 0.2.0 + +``` + +[//]: # ({x-version-update-start;com.azure:azure-data-appconfiguration;current}) +```xml + + com.azure + azure-data-appconfiguration + 1.0.0-beta.7 + +``` +[//]: # ({x-version-update-end}) +[//]: # ({x-version-update-start;com.azure:azure-core-tracing-opentelemetry;current}) +```xml + + com.azure + azure-core-tracing-opentelemetry + 1.0.0-beta.1 + ``` +[//]: # ({x-version-update-end}) + #### Sample demonstrates tracing when adding a configuration setting using [azure-data-app-configuration][azure_data_app_configuration] client library. ```java import com.azure.core.util.Context; diff --git a/sdk/core/azure-core-tracing-opentelemetry/src/samples/ListKeyVaultSecretsTracingSample.md b/sdk/core/azure-core-tracing-opentelemetry/src/samples/ListKeyVaultSecretsTracingSample.md index 96bc8f8d67de..4f954230b2fb 100644 --- a/sdk/core/azure-core-tracing-opentelemetry/src/samples/ListKeyVaultSecretsTracingSample.md +++ b/sdk/core/azure-core-tracing-opentelemetry/src/samples/ListKeyVaultSecretsTracingSample.md @@ -6,30 +6,38 @@ Following documentation describes instructions to run a sample program for creat Sample uses **[opentelemetry-sdk][opentelemetry_sdk]** as implementation package and **[Logging Exporter][logging_exporter]** as exporter. ### Adding dependencies to your project: ```xml - - - io.opentelemetry - opentelemetry-sdk - 0.2.0 - - - com.azure - azure-security-keyvault-secrets - 4.0.1 - - - com.azure - azure-core-tracing-opentelemetry - 1.0.0-beta.1 - - - io.opentelemetry - opentelemetry-exporters-logging - 0.2.0 - - + + io.opentelemetry + opentelemetry-sdk + 0.2.0 + + + io.opentelemetry + opentelemetry-exporters-logging + 0.2.0 + ``` +[//]: # ({x-version-update-start;com.azure:azure-security-keyvault-secrets;current}) +```xml + + com.azure + azure-security-keyvault-secrets + 4.0.1 + +``` +[//]: # ({x-version-update-end}) + +[//]: # ({x-version-update-start;com.azure:azure-core-tracing-opentelemetry;current}) +```xml + + com.azure + azure-core-tracing-opentelemetry + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + #### Sample demonstrates tracing when creating and listing secrets from a Key Vault using [azure-security-keyvault-secrets][azure_keyvault_secrets] client library. ```java import com.azure.core.util.Context; diff --git a/sdk/core/azure-core-tracing-opentelemetry/src/samples/PublishEventsTracingSample.md b/sdk/core/azure-core-tracing-opentelemetry/src/samples/PublishEventsTracingSample.md index 91ed0e1bc79a..c7b9ca096dbe 100644 --- a/sdk/core/azure-core-tracing-opentelemetry/src/samples/PublishEventsTracingSample.md +++ b/sdk/core/azure-core-tracing-opentelemetry/src/samples/PublishEventsTracingSample.md @@ -6,30 +6,38 @@ Following documentation describes instructions to run a sample program for publi Sample uses **[opentelemetry-sdk][opentelemetry_sdk]** for implementation and **[Logging Exporter][logging_exporter]** as exporter. ### Adding dependencies to your project: ```xml - - - io.opentelemetry - opentelemetry-sdk - 0.2.0 - - - com.azure - azure-messaging-eventhubs - 5.0.0-beta.6 - - - com.azure - azure-core-tracing-opentelemetry - 1.0.0-beta.1 - - - io.opentelemetry - opentelemetry-exporters-logging - 0.2.0 - - + + io.opentelemetry + opentelemetry-sdk + 0.2.0 + + + io.opentelemetry + opentelemetry-exporters-logging + 0.2.0 + +``` + +[//]: # ({x-version-update-start;com.azure:azure-messaging-eventhubs;current}) +```xml + + com.azure + azure-messaging-eventhubs + 5.0.0-beta.6 + +``` +[//]: # ({x-version-update-end}) +[//]: # ({x-version-update-start;com.azure:azure-core-tracing-opentelemetry;current}) +```xml + + com.azure + azure-core-tracing-opentelemetry + 1.0.0-beta.1 + ``` +[//]: # ({x-version-update-end}) + #### Sample demonstrates tracing when publishing multiple events to an eventhub instance using [azure-messaging-eventhubs][azure_messaging_eventhubs] client library. ```java import com.azure.core.util.Context; From 5679d4f3879968926da3e957f24cb83e9bccbaf1 Mon Sep 17 00:00:00 2001 From: Sameeksha Vaity Date: Wed, 11 Dec 2019 13:37:25 -0800 Subject: [PATCH 4/4] update to include md files in version update: --- eng/versioning/update_versions.py | 28 +++++++++---------- .../AsyncQueueClientEnqueueMessages.md | 1 - .../src/samples/ListeKeyVaultSecrets.md | 1 - .../src/samples/PublishEvents.md | 1 - .../src/samples/QueueClientEnqueueMessages.md | 1 - .../samples/AsyncListKeyVaultSecretsSample.md | 1 - ...CreateConfigurationSettingTracingSample.md | 1 - .../ListKeyVaultSecretsTracingSample.md | 1 - .../src/samples/PublishEventsTracingSample.md | 1 - 9 files changed, 14 insertions(+), 22 deletions(-) diff --git a/eng/versioning/update_versions.py b/eng/versioning/update_versions.py index 1b08e5789c8b..15a6669b91e4 100644 --- a/eng/versioning/update_versions.py +++ b/eng/versioning/update_versions.py @@ -23,7 +23,7 @@ # necessary here, since our README.md files don't contain externaly dependency versions, there's no point in scanning files # that shouldn't require changes. # python eng/versioning/update_versions.py --ut external_dependency --sr -# +# # The script must be run at the root of azure-sdk-for-java. import argparse @@ -54,16 +54,16 @@ def update_versions(version_map, target_file): if match: module_name, version_type = match.group(1), match.group(2) repl_thisline = True - else: - match = version_update_start_marker.search(line) - if match: - module_name, version_type = match.group(1), match.group(2) - repl_open, repl_thisline = True, True - else: - match = version_update_end_marker.search(line) - if match: + else: + match = version_update_start_marker.search(line) + if match: + module_name, version_type = match.group(1), match.group(2) + repl_open, repl_thisline = True, True + else: + match = version_update_end_marker.search(line) + if match: repl_open, repl_thisline = False, False - + if repl_thisline: # If the module isn't found then just continue. This can # happen if we're going through and replacing only library @@ -121,7 +121,7 @@ def load_version_map_from_file(the_file, version_map): def display_version_info(version_map): for value in version_map.values(): print(value) - + def update_versions_all(update_type, build_type, target_file, skip_readme): version_map = {} # Load the version and/or external dependency file for the given UpdateType @@ -145,10 +145,10 @@ def update_versions_all(update_type, build_type, target_file, skip_readme): for root, _, files in os.walk("."): for file_name in files: file_path = root + os.sep + file_name - if (file_name == 'README.md' and not skip_readme) or (file_name.startswith('pom.') and file_name.endswith('.xml')): + if (file_name.endswith('.md') and not skip_readme) or (file_name.startswith('pom.') and file_name.endswith('.xml')): update_versions(version_map, file_path) - # This is a temporary stop gap to deal with versions hard coded in java files. + # This is a temporary stop gap to deal with versions hard coded in java files. # Everything within the begin/end tags below can be deleted once # https://github.com/Azure/azure-sdk-for-java/issues/3141 has been fixed. # version_*_java_files.txt @@ -184,4 +184,4 @@ def main(): print('Total time for replacement: {}'.format(str(timedelta(seconds=elapsed_time)))) if __name__ == '__main__': - main() \ No newline at end of file + main() diff --git a/sdk/core/azure-core-tracing-opencensus/src/samples/AsyncQueueClientEnqueueMessages.md b/sdk/core/azure-core-tracing-opencensus/src/samples/AsyncQueueClientEnqueueMessages.md index 61cebcc34ff0..27e2066b6f39 100644 --- a/sdk/core/azure-core-tracing-opencensus/src/samples/AsyncQueueClientEnqueueMessages.md +++ b/sdk/core/azure-core-tracing-opencensus/src/samples/AsyncQueueClientEnqueueMessages.md @@ -18,7 +18,6 @@ Sample uses **[opencensus-impl][opencensus_impl]** as implementation package and ``` [//]: # ({x-version-update-end}) - [//]: # ({x-version-update-start;com.azure:azure-core-tracing-opencensus;current}) ```xml diff --git a/sdk/core/azure-core-tracing-opencensus/src/samples/ListeKeyVaultSecrets.md b/sdk/core/azure-core-tracing-opencensus/src/samples/ListeKeyVaultSecrets.md index 7c2dfc39f4a7..4ed8864983f8 100644 --- a/sdk/core/azure-core-tracing-opencensus/src/samples/ListeKeyVaultSecrets.md +++ b/sdk/core/azure-core-tracing-opencensus/src/samples/ListeKeyVaultSecrets.md @@ -17,7 +17,6 @@ Sample uses **[opencensus-impl][opencensus_impl]** as implementation package and ``` [//]: # ({x-version-update-end}) - [//]: # ({x-version-update-start;com.azure:azure-core-tracing-opencensus;current}) ```xml diff --git a/sdk/core/azure-core-tracing-opencensus/src/samples/PublishEvents.md b/sdk/core/azure-core-tracing-opencensus/src/samples/PublishEvents.md index 23774c93cae6..29674153f9b8 100644 --- a/sdk/core/azure-core-tracing-opencensus/src/samples/PublishEvents.md +++ b/sdk/core/azure-core-tracing-opencensus/src/samples/PublishEvents.md @@ -18,7 +18,6 @@ Sample uses **[opencensus-impl][opencensus_impl]** as implementation package and ``` [//]: # ({x-version-update-end}) - [//]: # ({x-version-update-start;com.azure:azure-core-tracing-opencensus;current}) ```xml diff --git a/sdk/core/azure-core-tracing-opencensus/src/samples/QueueClientEnqueueMessages.md b/sdk/core/azure-core-tracing-opencensus/src/samples/QueueClientEnqueueMessages.md index 2050ee3fc67e..8ce90a2ff790 100644 --- a/sdk/core/azure-core-tracing-opencensus/src/samples/QueueClientEnqueueMessages.md +++ b/sdk/core/azure-core-tracing-opencensus/src/samples/QueueClientEnqueueMessages.md @@ -18,7 +18,6 @@ Sample uses **[opencensus-impl][opencensus_impl]** as implementation package and ``` [//]: # ({x-version-update-end}) - [//]: # ({x-version-update-start;com.azure:azure-core-tracing-opencensus;current}) ```xml diff --git a/sdk/core/azure-core-tracing-opentelemetry/src/samples/AsyncListKeyVaultSecretsSample.md b/sdk/core/azure-core-tracing-opentelemetry/src/samples/AsyncListKeyVaultSecretsSample.md index 6321aacb17a1..8363154334c7 100644 --- a/sdk/core/azure-core-tracing-opentelemetry/src/samples/AsyncListKeyVaultSecretsSample.md +++ b/sdk/core/azure-core-tracing-opentelemetry/src/samples/AsyncListKeyVaultSecretsSample.md @@ -27,7 +27,6 @@ Sample uses **[opentelemetry-sdk][opentelemetry_sdk]** as implementation package ``` [//]: # ({x-version-update-end}) - [//]: # ({x-version-update-start;com.azure:azure-core-tracing-opentelemetry;current}) ```xml diff --git a/sdk/core/azure-core-tracing-opentelemetry/src/samples/CreateConfigurationSettingTracingSample.md b/sdk/core/azure-core-tracing-opentelemetry/src/samples/CreateConfigurationSettingTracingSample.md index ddaa90782a1c..76df142d273d 100644 --- a/sdk/core/azure-core-tracing-opentelemetry/src/samples/CreateConfigurationSettingTracingSample.md +++ b/sdk/core/azure-core-tracing-opentelemetry/src/samples/CreateConfigurationSettingTracingSample.md @@ -27,7 +27,6 @@ Sample uses **[opentelemetry-sdk][opentelemetry_sdk]** as implementation package ``` [//]: # ({x-version-update-end}) - [//]: # ({x-version-update-start;com.azure:azure-core-tracing-opentelemetry;current}) ```xml diff --git a/sdk/core/azure-core-tracing-opentelemetry/src/samples/ListKeyVaultSecretsTracingSample.md b/sdk/core/azure-core-tracing-opentelemetry/src/samples/ListKeyVaultSecretsTracingSample.md index 4f954230b2fb..289faf51bc67 100644 --- a/sdk/core/azure-core-tracing-opentelemetry/src/samples/ListKeyVaultSecretsTracingSample.md +++ b/sdk/core/azure-core-tracing-opentelemetry/src/samples/ListKeyVaultSecretsTracingSample.md @@ -27,7 +27,6 @@ Sample uses **[opentelemetry-sdk][opentelemetry_sdk]** as implementation package ``` [//]: # ({x-version-update-end}) - [//]: # ({x-version-update-start;com.azure:azure-core-tracing-opentelemetry;current}) ```xml diff --git a/sdk/core/azure-core-tracing-opentelemetry/src/samples/PublishEventsTracingSample.md b/sdk/core/azure-core-tracing-opentelemetry/src/samples/PublishEventsTracingSample.md index c7b9ca096dbe..2bd9d1bd6ab7 100644 --- a/sdk/core/azure-core-tracing-opentelemetry/src/samples/PublishEventsTracingSample.md +++ b/sdk/core/azure-core-tracing-opentelemetry/src/samples/PublishEventsTracingSample.md @@ -27,7 +27,6 @@ Sample uses **[opentelemetry-sdk][opentelemetry_sdk]** for implementation and ** ``` [//]: # ({x-version-update-end}) - [//]: # ({x-version-update-start;com.azure:azure-core-tracing-opentelemetry;current}) ```xml