forked from Azure/azure-sdk-for-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial commit for monitor exporter client library (Azure#15429)
* Initial commit for monitor exporter client library
- Loading branch information
Showing
59 changed files
with
5,597 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. | ||
|
||
trigger: | ||
branches: | ||
include: | ||
- master | ||
- hotfix/* | ||
- release/* | ||
paths: | ||
include: | ||
- sdk/monitor/ | ||
- eng/common/ | ||
|
||
pr: | ||
branches: | ||
include: | ||
- master | ||
- feature/* | ||
- hotfix/* | ||
- release/* | ||
paths: | ||
include: | ||
- sdk/monitor/ | ||
|
||
extends: | ||
template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml | ||
parameters: | ||
ServiceDirectory: monitor | ||
Artifacts: | ||
- name: opentelemetry-exporter-azuremonitor | ||
groupId: com.azure | ||
safeName: opentelemetryexporterazuremonitor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Release History | ||
|
||
## 1.0.0-beta.1 (2020-10-06) | ||
- Initial release. Please see the README and wiki for information on the new design. |
115 changes: 115 additions & 0 deletions
115
sdk/monitor/opentelemetry-exporter-azuremonitor/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
# Azure Monitor OpenTelemetry Exporter client library for Java | ||
|
||
This client library provides support for exporting OpenTelemetry data to Azure Monitor. This package assumes your | ||
application is already instrumented with the [OpenTelemetry SDK][opentelemetry_sdk] following the [OpenTelemetry | ||
Specification][opentelemetry_specification]. | ||
|
||
[Source code][source_code] | Package (Maven) | [API reference documentation][api_reference_doc] | [Product Documentation][product_documentation] | [Samples][sample_readme] | ||
|
||
## Getting started | ||
|
||
### Prerequisites | ||
|
||
- [Java Development Kit (JDK) with version 8 or above][jdk] | ||
- [Azure Subscription][azure_subscription] | ||
- [Application Insights resource][application_insights_resource] | ||
|
||
For more information, please read [introduction to Application Insights][application_insights_intro]. | ||
|
||
### Include the Package | ||
|
||
[//]: # ({x-version-update-start;com.azure:opentelemetry-exporter-azuremonitor;current}) | ||
```xml | ||
<dependency> | ||
<groupId>com.azure</groupId> | ||
<artifactId>opentelemetry-exporter-azuremonitor</artifactId> | ||
<version>1.0.0-beta.1</version> | ||
</dependency> | ||
``` | ||
[//]: # ({x-version-update-end}) | ||
|
||
### Authentication | ||
|
||
#### Get the instrumentation key from the portal | ||
|
||
In order to export telemetry data to Azure Monitor, you will need the instrumentation key to your [Application | ||
Insights resource][application_insights_resource]. To get your instrumentation key, go to [Azure Portal][azure_portal], | ||
search for your resource. On the overview page of your resource, you will find the instrumentation key on the top | ||
right corner. | ||
|
||
### Creating exporter for Azure Monitor | ||
<!-- embedme ./src/samples/java/com/azure/opentelemetry/exporter/azuremonitor/ReadmeSamples.java#L25-L27 --> | ||
```java | ||
AzureMonitorExporter azureMonitorExporter = new MonitorExporterClientBuilder() | ||
.instrumentationKey("{instrumentation-key}") | ||
.buildExporter(); | ||
``` | ||
|
||
#### Exporting span data | ||
|
||
The following example shows how to export a collection of available SpanData to Azure Monitor thorugh the | ||
`AzureMonitorExporter` | ||
|
||
<!-- embedme ./src/samples/java/com/azure/opentelemetry/exporter/azuremonitor/ReadmeSamples.java#L34-L39 --> | ||
```java | ||
AzureMonitorExporter azureMonitorExporter = new MonitorExporterClientBuilder() | ||
.instrumentationKey("{instrumentation-key}") | ||
.buildExporter(); | ||
|
||
CompletableResultCode resultCode = azureMonitorExporter.export(getSpanDataCollection()); | ||
System.out.println(resultCode.isSuccess()); | ||
``` | ||
|
||
## Key concepts | ||
For more information on the OpenTelemetry project, please review the [OpenTelemetry Specifications | ||
][opentelemetry_specification]. | ||
|
||
## Examples | ||
|
||
More examples can be found in [samples][samples_code]. | ||
|
||
## Troubleshooting | ||
|
||
### Enabling Logging | ||
|
||
Azure SDKs for Java offer a consistent logging story to help aid in troubleshooting application errors and expedite | ||
their resolution. The logs produced will capture the flow of an application before reaching the terminal state to help | ||
locate the root issue. View the [logging][logging] wiki for guidance about enabling logging. | ||
|
||
## Next steps | ||
Learn more about [Open Telemetry][opentelemetry_io] | ||
|
||
## Contributing | ||
|
||
This project welcomes contributions and suggestions. Most contributions require you to agree to a | ||
[Contributor License Agreement (CLA)][cla] declaring that you have the right to, and actually do, grant us the rights | ||
to use your contribution. | ||
|
||
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate | ||
the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to | ||
do this once across all repos using our CLA. | ||
|
||
This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the | ||
[Code of Conduct FAQ][coc_faq] or contact [[email protected]][coc_contact] with any additional questions or comments. | ||
|
||
<!-- LINKS --> | ||
[jdk]: https://docs.microsoft.com/java/azure/jdk/?view=azure-java-stable | ||
[samples]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/monitor/opentelemetry-exporter-azuremonitor/src/samples/java/ | ||
[source_code]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/monitor/opentelemetry-exporter-azuremonitor/src | ||
[azure_subscription]: https://azure.microsoft.com/free/ | ||
[api_reference_doc]: https://docs.microsoft.com/azure/azure-monitor/overview | ||
[product_documentation]: https://docs.microsoft.com/azure/azure-monitor/overview | ||
[azure_cli]: https://docs.microsoft.com/cli/azure | ||
[azure_portal]: https://portal.azure.com | ||
[azure_identity]: https://github.com/Azure/azure-sdk-for-java/tree/master/sdk/identity/azure-identity | ||
[DefaultAzureCredential]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/identity/azure-identity/README.md#defaultazurecredential | ||
[custom_subdomain]: https://docs.microsoft.com/azure/cognitive-services/authentication#create-a-resource-with-a-custom-subdomain | ||
[logging]: https://github.com/Azure/azure-sdk-for-java/wiki/Logging-with-Azure-SDK | ||
[opentelemetry_sdk]: https://github.com/open-telemetry/opentelemetry-java/blob/master/QUICKSTART.md | ||
[opentelemetry_specification]: https://github.com/open-telemetry/opentelemetry-specification | ||
[application_insights_resource]: https://docs.microsoft.com/azure/azure-monitor/app/create-new-resource | ||
[application_insights_intro]: https://docs.microsoft.com/azure/azure-monitor/app/app-insights-overview | ||
[azure_portal]: https://ms.portal.azure.com/#blade/HubsExtension/BrowseResource/resourceType/microsoft.insights%2Fcomponents | ||
[opentelemetry_io]: https://opentelemetry.io/ | ||
|
||
 |
115 changes: 115 additions & 0 deletions
115
sdk/monitor/opentelemetry-exporter-azuremonitor/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
<!-- Copyright (c) Microsoft Corporation. All rights reserved. | ||
Licensed under the MIT License. --> | ||
|
||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>com.azure</groupId> | ||
<artifactId>azure-client-sdk-parent</artifactId> | ||
<version>1.7.0</version> <!-- {x-version-update;com.azure:azure-client-sdk-parent;current} --> | ||
<relativePath>../../parents/azure-client-sdk-parent</relativePath> | ||
</parent> | ||
|
||
<groupId>com.azure</groupId> | ||
<artifactId>opentelemetry-exporter-azuremonitor</artifactId> | ||
<version>1.0.0-beta.1</version> <!-- {x-version-update;com.azure:opentelemetry-exporter-azuremonitor;current} --> | ||
|
||
<name>Microsoft Azure SDK for OpenTelemetry Azure Monitor Exporter</name> | ||
<description>This package contains Microsoft Azure SDK for OpenTelemetry Azure Monitor Exporter.</description> | ||
|
||
<distributionManagement> | ||
<site> | ||
<id>azure-java-build-docs</id> | ||
<url>${site.url}/site/${project.artifactId}</url> | ||
</site> | ||
</distributionManagement> | ||
|
||
<scm> | ||
<url>https://github.com/Azure/azure-sdk-for-java</url> | ||
</scm> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.azure</groupId> | ||
<artifactId>azure-core</artifactId> | ||
<version>1.9.0</version> <!-- {x-version-update;com.azure:azure-core;dependency} --> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.azure</groupId> | ||
<artifactId>azure-core-http-netty</artifactId> | ||
<version>1.6.2</version> <!-- {x-version-update;com.azure:azure-core-http-netty;dependency} --> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.opentelemetry</groupId> | ||
<artifactId>opentelemetry-api</artifactId> | ||
<version>0.8.0</version> <!-- {x-version-update;io.opentelemetry:opentelemetry-api;external_dependency} --> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.opentelemetry</groupId> | ||
<artifactId>opentelemetry-sdk</artifactId> | ||
<version>0.8.0</version> <!-- {x-version-update;io.opentelemetry:opentelemetry-sdk;external_dependency} --> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.google.code.findbugs</groupId> | ||
<artifactId>jsr305</artifactId> | ||
<version>3.0.2</version> <!-- {x-version-update;com.google.code.findbugs:jsr305;external_dependency} --> | ||
<scope>provided</scope> | ||
</dependency> | ||
<!-- Test dependencies --> | ||
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter-api</artifactId> | ||
<version>5.6.2</version> <!-- {x-version-update;org.junit.jupiter:junit-jupiter-api;external_dependency} --> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter-engine</artifactId> | ||
<version>5.6.2</version> <!-- {x-version-update;org.junit.jupiter:junit-jupiter-engine;external_dependency} --> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter-params</artifactId> | ||
<version>5.6.2</version> <!-- {x-version-update;org.junit.jupiter:junit-jupiter-params;external_dependency} --> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.azure</groupId> | ||
<artifactId>azure-core-test</artifactId> | ||
<version>1.5.0</version> <!-- {x-version-update;com.azure:azure-core-test;dependency} --> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.jacoco</groupId> | ||
<artifactId>jacoco-maven-plugin</artifactId> | ||
<version>0.8.5</version> <!-- {x-version-update;org.jacoco:jacoco-maven-plugin;external_dependency} --> | ||
<configuration> | ||
<skip>true</skip> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-enforcer-plugin</artifactId> | ||
<version>3.0.0-M3</version> <!-- {x-version-update;org.apache.maven.plugins:maven-enforcer-plugin;external_dependency} --> | ||
<configuration> | ||
<rules> | ||
<bannedDependencies> | ||
<includes> | ||
<include>io.opentelemetry:opentelemetry-api:[0.8.0]</include> <!-- {x-include-update;io.opentelemetry:opentelemetry-api;external_dependency} --> | ||
<include>io.opentelemetry:opentelemetry-sdk:[0.8.0]</include> <!-- {x-include-update;io.opentelemetry:opentelemetry-sdk;external_dependency} --> | ||
</includes> | ||
</bannedDependencies> | ||
</rules> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
Oops, something went wrong.