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
28 changes: 14 additions & 14 deletions eng/versioning/update_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -184,4 +184,4 @@ def main():
print('Total time for replacement: {}'.format(str(timedelta(seconds=elapsed_time))))

if __name__ == '__main__':
main()
main()
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,13 +7,14 @@ 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})
Expand All @@ -23,13 +24,13 @@ 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})

```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 +42,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 +121,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,13 +6,14 @@ 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})
Expand All @@ -22,10 +23,11 @@ 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})

```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,24 @@ 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,13 +7,14 @@ 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})
Expand All @@ -23,10 +24,11 @@ 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})

```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 [email protected] 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
Loading