Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 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
49 changes: 1 addition & 48 deletions sdk/core/azure-core-tracing-opencensus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,58 +19,11 @@ documentation][api_documentation] | [Samples][samples]
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core-tracing-opencensus</artifactId>
<version>1.0.0-beta.5</version> <!-- {x-version-update;com.azure:azure-core-tracing-opencensus;current} -->
<version>1.0.0-beta.5</version>
</dependency>
```
[//]: # ({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
<!-- Add Tracing OpenCensus without Netty HTTP client -->
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core-tracing-opencensus</artifactId>
<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> <!-- {x-version-update;com.azure:azure-core-http-netty;current} -->
</exclusion>
</exclusions>
</dependency>
```
[//]: # ({x-version-update-end})
[//]: # ({x-version-update-start;com.azure:azure-core-http-okhttp;current})
```xml
<!-- Add OkHTTP client to use with Tracing OpenCensus package -->
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core-http-okhttp</artifactId> <!-- {x-version-update;com.azure:azure-core-http-okhttp;current} -->
<version>1.0.0</version>
</dependency>
```
[//]: # ({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.
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.1</version> <!-- {x-version-update;com.azure:azure-security-keyvault-secrets;current} -->
<version>4.0.1</version>
</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.5</version> <!-- {x-version-update;com.azure:azure-core-tracing-opencensus;current} -->
<version>1.0.0-beta.5</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
<!-- Add Storage Queue dependency -->
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-storage-queue</artifactId>
<version>12.1.0</version> <!-- {x-version-update;com.azure:azure-storage-queue;current} -->
<version>12.1.0</version>
</dependency>
```
[//]: # ({x-version-update-end})

Comment thread
samvaity marked this conversation as resolved.
Outdated
[//]: # ({x-version-update-start;com.azure:azure-core-tracing-opencensus;current})
```xml
<!-- Add Azure core tracing OpenCensus plugin package to your project -->
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core-tracing-opencensus</artifactId>
<version>1.0.0-beta.5</version> <!-- {x-version-update;com.azure:azure-core-tracing-opencensus;current} -->
<version>1.0.0-beta.5</version>
</dependency>
```
[//]: # ({x-version-update-end})

```xml
<!-- Add opencensus-impl and opencensus-zipkin-exporter to your project -->

<dependency>
<groupId>io.opencensus</groupId>
<artifactId>opencensus-exporter-trace-zipkin</artifactId>
Expand All @@ -41,6 +43,8 @@ Sample uses **[opencensus-impl][opencensus_impl]** as implementation package and
<version>0.24.0</version>
</dependency>
```
> 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;
Expand Down Expand Up @@ -118,6 +122,7 @@ public class Sample {
```

<!-- Links -->
[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
Original file line number Diff line number Diff line change
Expand Up @@ -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
<!-- Add Key Vault Secrets dependency -->
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-security-keyvault-secrets</artifactId>
<version>4.0.1</version> <!-- {x-version-update;com.azure:azure-security-keyvault-secrets;current} -->
<version>4.0.1</version>
</dependency>
```
[//]: # ({x-version-update-end})

[//]: # ({x-version-update-start;com.azure:azure-core-tracing-opencensus;current})
```xml
<!-- Add Azure core tracing OpenCensus plugin package to your project -->
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core-tracing-opencensus</artifactId>
<version>1.0.0-beta.5</version> <!-- {x-version-update;com.azure:azure-core-tracing-opencensus;current} -->
<version>1.0.0-beta.5</version>
</dependency>
```
[//]: # ({x-version-update-end})

```xml
<!-- Add opencensus-impl and opencensus-zipkin-exporter to your project -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
<!-- Adding Azure Event Hubs dependency to your project -->
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-messaging-eventhubs</artifactId>
<version>5.0.0-beta.6</version> <!-- {x-version-update;com.azure:azure-messaging-eventhubs;current} -->
<version>5.0.0-beta.6</version>
</dependency>
```
[//]: # ({x-version-update-end})

[//]: # ({x-version-update-start;com.azure:azure-core-tracing-opencensus;current})
```xml
<!-- Adding Azure core tracing OpenCensus plugin package to your project -->
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core-tracing-opencensus</artifactId>
<version>1.0.0-beta.5</version> <!-- {x-version-update;com.azure:azure-core-tracing-opencensus;current} -->
<version>1.0.0-beta.5</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
<!-- Add Storage Queue dependency -->
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-storage-queue</artifactId>
<version>12.1.0</version> <!-- {x-version-update;com.azure:azure-storage-queue;current} -->
<version>12.1.0</version>
</dependency>
```
[//]: # ({x-version-update-end})

[//]: # ({x-version-update-start;com.azure:azure-core-tracing-opencensus;current})
```xml
<!-- Add Azure core tracing OpenCensus plugin package to your project -->
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core-tracing-opencensus</artifactId>
<version>1.0.0-beta.5</version> <!-- {x-version-update;com.azure:azure-core-tracing-opencensus;current} -->
<version>1.0.0-beta.5</version>
</dependency>
```
[//]: # ({x-version-update-end})

```xml
<!-- Add opencensus-impl and opencensus-zipkin-exporter to your project -->
<dependency>
Expand Down
52 changes: 3 additions & 49 deletions sdk/core/azure-core-tracing-opentelemetry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core-tracing-opentelemetry</artifactId>
<version>1.0.0-beta.1</version> <!-- {x-version-update;com.azure:azure-core-tracing-opentelemetry;current} -->
</dependency>
```
[//]: # ({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
<!-- Add Tracing OpenTelemetry without Netty HTTP client -->
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core-tracing-opentelemetry</artifactId>
<version>1.0.0-beta.1</version> <!-- {x-version-update;com.azure:azure-core-tracing-opentelemetry;current} -->
<exclusions>
<exclusion>
<groupId>com.azure</groupId>
<artifactId>azure-core-http-netty</artifactId>
</exclusion>
</exclusions>
</dependency>
```
[//]: # ({x-version-update-end})
[//]: # ({x-version-update-start;com.azure:azure-core-http-okhttp;current})
```xml
<!-- Add OkHTTP client to use with Tracing OpenTelemetry package -->
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core-http-okhttp</artifactId>
<version>1.0.0</version> <!-- {x-version-update;com.azure:azure-core-http-okhttp;current} -->
<artifactId>azure-core-tracing-opentelemetry</artifactId>
<version>1.0.0-beta.1</version>
</dependency>
```
[//]: # ({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.
Expand Down Expand Up @@ -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.

<!-- Links -->
[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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
<dependencies>
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-sdk</artifactId>
<version>0.2.0</version>
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-security-keyvault-secrets</artifactId>
<version>4.0.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> <!-- {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</version>
</dependency>
</dependencies>
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-sdk</artifactId>
<version>0.2.0</version>
</dependency>
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-exporters-logging</artifactId>
<version>0.2.0</version>
</dependency>
```

[//]: # ({x-version-update-start;com.azure:azure-security-keyvault-secrets;current})
```xml
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-security-keyvault-secrets</artifactId>
<version>4.0.1</version>
</dependency>
```
[//]: # ({x-version-update-end})

[//]: # ({x-version-update-start;com.azure:azure-core-tracing-opentelemetry;current})
```xml
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core-tracing-opentelemetry</artifactId>
<version>1.0.0-beta.1</version>
</dependency>
```
[//]: # ({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;
Expand Down
Loading