Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions sdk/core/azure-core-tracing-opencensus/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
# Release History
## Version 1.0.0-beta.5 (2019-11-26)
For details on the Azure SDK for Java (December 2019 Preview) release refer to the [release announcement](https://aka.ms/azure-sdk-preview6-java).
- Extended support for 0.24.0 opencensus-api package version.
- Added tracing instrumentation for Batch send operation in Eventhubs.

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)

Expand Down
23 changes: 14 additions & 9 deletions sdk/core/azure-core-tracing-opencensus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ documentation][api_documentation] | [Samples][samples]
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core-tracing-opencensus</artifactId>
<version>1.0.0-beta.4</version>
<version>1.0.0-beta.5</version> <!-- {x-version-update;com.azure:azure-core-tracing-opencensus;current} -->
</dependency>
```
[//]: # ({x-version-update-end})
Expand All @@ -38,11 +38,11 @@ Netty and include OkHTTP client in your pom.xml.
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core-tracing-opencensus</artifactId>
<version>1.0.0-beta.4</version>
<version>1.0.0-beta.5</version> <!-- {x-version-update;com.azure:azure-core-tracing-opencensus;current} -->
<exclusions>
<exclusion>
<groupId>com.azure</groupId>
<artifactId>azure-core-http-netty</artifactId>
<artifactId>azure-core-http-netty</artifactId> <!-- {x-version-update;com.azure:azure-core-http-netty;current} -->
</exclusion>
</exclusions>
</dependency>
Expand All @@ -53,7 +53,7 @@ Netty and include OkHTTP client in your pom.xml.
<!-- Add OkHTTP client to use with Tracing OpenCensus package -->
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core-http-okhttp</artifactId>
<artifactId>azure-core-http-okhttp</artifactId> <!-- {x-version-update;com.azure:azure-core-http-okhttp;current} -->
<version>1.0.0</version>
</dependency>
```
Expand Down Expand Up @@ -134,13 +134,18 @@ private static final Tracer TRACER;
public static void doClientWork() {
EventHubProducerClient producer = new EventHubClientBuilder()
.connectionString(CONNECTION_STRING)
.buildProducer();
.buildProducerClient();

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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Sample uses **[opencensus-impl][opencensus_impl]** as implementation package and
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-security-keyvault-secrets</artifactId>
<version>4.0.0</version>
<version>4.1.0-beta.1</version> <!-- {x-version-update;com.azure:azure-security-keyvault-secrets;current} -->
</dependency>
```
[//]: # ({x-version-update-end})
Expand All @@ -22,7 +22,7 @@ Sample uses **[opencensus-impl][opencensus_impl]** as implementation package and
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core-tracing-opencensus</artifactId>
<version>1.0.0-beta.4</version>
<version>1.0.0-beta.5</version> <!-- {x-version-update;com.azure:azure-core-tracing-opencensus;current} -->
</dependency>
```
[//]: # ({x-version-update-end})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Sample uses **[opencensus-impl][opencensus_impl]** as implementation package and
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-storage-queue</artifactId>
<version>12.0.0</version>
<version>12.0.2</version> <!-- {x-version-update;com.azure:azure-storage-queue;current} -->
</dependency>
```
[//]: # ({x-version-update-end})
Expand All @@ -23,7 +23,7 @@ Sample uses **[opencensus-impl][opencensus_impl]** as implementation package and
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core-tracing-opencensus</artifactId>
<version>1.0.0-beta.4</version>
<version>1.0.0-beta.5</version> <!-- {x-version-update;com.azure:azure-core-tracing-opencensus;current} -->
</dependency>
```
[//]: # ({x-version-update-end})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Sample uses **[opencensus-impl][opencensus_impl]** as implementation package and
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-security-keyvault-secrets</artifactId>
<version>4.0.0</version>
<version>4.1.0-beta.1</version> <!-- {x-version-update;com.azure:azure-security-keyvault-secrets;current} -->
</dependency>
```
[//]: # ({x-version-update-end})
Expand All @@ -22,7 +22,7 @@ Sample uses **[opencensus-impl][opencensus_impl]** as implementation package and
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core-tracing-opencensus</artifactId>
<version>1.0.0-beta.4</version>
<version>1.0.0-beta.5</version> <!-- {x-version-update;com.azure:azure-core-tracing-opencensus;current} -->
</dependency>
```
[//]: # ({x-version-update-end})
Expand Down
40 changes: 23 additions & 17 deletions sdk/core/azure-core-tracing-opencensus/src/samples/PublishEvents.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Sample uses **[opencensus-impl][opencensus_impl]** as implementation package and
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-messaging-eventhubs</artifactId>
<version>5.0.0-beta.5</version>
<version>5.0.0-beta.6</version> <!-- {x-version-update;com.azure:azure-messaging-eventhubs;current} -->
</dependency>
```
[//]: # ({x-version-update-end})
Expand All @@ -22,7 +22,7 @@ Sample uses **[opencensus-impl][opencensus_impl]** as implementation package and
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core-tracing-opencensus</artifactId>
<version>1.0.0-beta.4</version>
<version>1.0.0-beta.5</version> <!-- {x-version-update;com.azure:azure-core-tracing-opencensus;current} -->
</dependency>
```
[//]: # ({x-version-update-end})
Expand Down Expand Up @@ -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<EventData> 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<EventData> 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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Sample uses **[opencensus-impl][opencensus_impl]** as implementation package and
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-storage-queue</artifactId>
<version>12.0.0</version>
<version>12.0.2</version> <!-- {x-version-update;com.azure:azure-storage-queue;current} -->
</dependency>
```
[//]: # ({x-version-update-end})
Expand All @@ -23,7 +23,7 @@ Sample uses **[opencensus-impl][opencensus_impl]** as implementation package and
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core-tracing-opencensus</artifactId>
<version>1.0.0-beta.4</version>
<version>1.0.0-beta.5</version> <!-- {x-version-update;com.azure:azure-core-tracing-opencensus;current} -->
</dependency>
```
[//]: # ({x-version-update-end})
Expand Down
11 changes: 10 additions & 1 deletion sdk/core/azure-core-tracing-opentelemetry/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Release History

## Version 1.0.0-beta.1 (-12-)
## Version 1.0.0-beta.1 (2019-11-26)

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).

20 changes: 13 additions & 7 deletions sdk/core/azure-core-tracing-opentelemetry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ documentation][api_documentation] | [Samples][samples]
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core-tracing-opentelemetry</artifactId>
<version>1.0.0-beta.1</version>
<version>1.0.0-beta.1</version> <!-- {x-version-update;com.azure:azure-core-tracing-opentelemetry;current} -->
</dependency>
```
[//]: # ({x-version-update-end})
Expand All @@ -37,7 +37,7 @@ Netty and include OkHTTP client in your pom.xml.
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core-tracing-opentelemetry</artifactId>
<version>1.0.0-beta.1</version>
<version>1.0.0-beta.1</version> <!-- {x-version-update;com.azure:azure-core-tracing-opentelemetry;current} -->
<exclusions>
<exclusion>
<groupId>com.azure</groupId>
Expand All @@ -53,7 +53,7 @@ Netty and include OkHTTP client in your pom.xml.
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core-http-okhttp</artifactId>
<version>1.0.0</version>
<version>1.0.0</version> <!-- {x-version-update;com.azure:azure-core-http-okhttp;current} -->
</dependency>
```
[//]: # ({x-version-update-end})
Expand Down Expand Up @@ -136,13 +136,19 @@ private static final TracerSdkFactory TRACER_SDK_FACTORY;
private static void doClientWork() {
EventHubProducerClient producer = new EventHubClientBuilder()
.connectionString(CONNECTION_STRING)
.buildProducer();
.buildProducerClient();

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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@ Sample uses **[opentelemetry-sdk][opentelemetry_sdk]** as implementation package
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-sdk</artifactId>
<version>0.2.0-SNAPSHOT</version>
<version>0.2.0</version>
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-security-keyvault-secrets</artifactId>
<version>4.0.0</version>
<version>4.1.0-beta.1</version> <!-- {x-version-update;com.azure:azure-security-keyvault-secrets;current} -->
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core-tracing-opentelemetry</artifactId>
<version>1.0.0-beta.1</version>
<version>1.0.0-beta.1</version> <!-- {x-version-update;com.azure:azure-core-tracing-opentelemetry;current} -->
</dependency>
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-exporters-logging</artifactId>
<version>0.2.0-SNAPSHOT</version>
<version>0.2.0</version>
</dependency>
</dependencies>
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@ Sample uses **[opentelemetry-sdk][opentelemetry_sdk]** as implementation package
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-sdk</artifactId>
<version>0.2.0-SNAPSHOT</version>
<version>0.2.0</version>
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-data-appconfiguration</artifactId>
<version>1.0.0-beta.7</version>
<version>1.0.0-beta.7</version> <!-- {x-version-update;com.azure:azure-data-appconfiguration;current} -->
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core-tracing-opentelemetry</artifactId>
<version>1.0.0-beta.1</version>
<version>1.0.0-beta.1</version> <!-- {x-version-update;com.azure:azure-core-tracing-opentelemetry;current} -->
</dependency>
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-exporters-logging</artifactId>
<version>0.2.0-SNAPSHOT</version>
<version>0.2.0</version>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@ Sample uses **[opentelemetry-sdk][opentelemetry_sdk]** as implementation package
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-sdk</artifactId>
<version>0.2.0-SNAPSHOT</version>
<version>0.2.0</version>
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-security-keyvault-secrets</artifactId>
<version>4.0.0</version>
<version>4.1.0-beta.1</version> <!-- {x-version-update;com.azure:azure-security-keyvault-secrets;current} -->
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core-tracing-opentelemetry</artifactId>
<version>1.0.0-beta.1</version>
<version>1.0.0-beta.1</version> <!-- {x-version-update;com.azure:azure-core-tracing-opentelemetry;current} -->
</dependency>
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-exporters-logging</artifactId>
<version>0.2.0-SNAPSHOT</version>
<version>0.2.0</version>
</dependency>
</dependencies>
```
Expand Down
Loading