forked from MicrosoftDocs/azure-docs-sdk-node
-
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.
Merge pull request MicrosoftDocs#809 from azure-sdk/onboarding-azure-…
…monitor-opentelemetry-exporter-518306 Docs.MS Release Updates for azure-monitor-opentelemetry-exporter
- Loading branch information
Showing
2 changed files
with
123 additions
and
0 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
117 changes: 117 additions & 0 deletions
117
docs-ref-services/monitor-opentelemetry-exporter-readme-pre.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,117 @@ | ||
--- | ||
title: Azure Monitor OpenTelemetry Exporter client library for JavaScript | ||
keywords: Azure, javascript, SDK, API, @azure/monitor-opentelemetry-exporter, | ||
author: maggiepint | ||
ms.author: magpint | ||
ms.date: 09/01/2020 | ||
ms.topic: article | ||
ms.prod: azure | ||
ms.technology: azure | ||
ms.devlang: javascript | ||
ms.service: | ||
--- | ||
|
||
# Azure Monitor OpenTelemetry Exporter client library for JavaScript - Version 1.0.0-preview.5 | ||
|
||
|
||
[![npm version](https://badge.fury.io/js/%40azure%2Fmonitor-opentelemetry-exporter.svg)](https://badge.fury.io/js/%40azure%2Fmonitor-opentelemetry-exporter) | ||
|
||
## Getting started | ||
|
||
This exporter package assumes your application is [already instrumented](https://github.com/open-telemetry/opentelemetry-js/blob/master/getting-started/README.md) with the OpenTelemetry SDK. Once you are ready to export OpenTelemetry data, you can add this exporter to your application. | ||
|
||
### Install the package | ||
|
||
`npm install @azure/monitor-opentelemetry-exporter` | ||
|
||
### Prerequisites | ||
|
||
You must have an [Azure subscription](https://azure.microsoft.com/free/) and a | ||
[Application Insights workspace](https://docs.microsoft.com/en-us/azure/azure-monitor/app/app-insights-overview/) to use this package. | ||
If you are using this package in a Node.js application, then use Node.js 8.x or higher. | ||
|
||
### Distributed Tracing | ||
|
||
Add the exporter to your existing OpenTelemetry tracer provider (`NodeTracerProvider` / `BasicTracerProvider`) | ||
|
||
```js | ||
const { AzureMonitorTraceExporter } = require("@azure/monitor-opentelemetry-exporter"); | ||
const { NodeTracerProvider } = require("@opentelemetry/node"); | ||
const { BatchSpanProcessor } = require("@opentelemetry/tracing"); | ||
|
||
// Use your existing provider | ||
const provider = new NodeTracerProvider({ | ||
plugins: { | ||
https: { | ||
// Ignore Application Insights Ingestion Server | ||
ignoreOutgoingUrls: [new RegExp(/dc.services.visualstudio.com/i)], | ||
}, | ||
}, | ||
}); | ||
provider.register(); | ||
|
||
// Create an exporter instance | ||
const exporter = new AzureMonitorTraceExporter({ | ||
logger: provider.logger, | ||
instrumentationKey: "ikey", | ||
}); | ||
|
||
// Add the exporter to the provider | ||
provider.addSpanProcessor( | ||
new BatchSpanProcessor(exporter, { | ||
bufferTimeout: 15000, | ||
bufferSize: 1000, | ||
}), | ||
); | ||
``` | ||
|
||
### Metrics | ||
|
||
Coming Soon | ||
|
||
### Logs | ||
|
||
Coming Soon | ||
|
||
## Examples | ||
|
||
Coming soon // TODO: Update this with link to samples when we have some | ||
|
||
## Key concepts | ||
|
||
For more information on the OpenTelemetry project, please review the [**OpenTelemetry Specifications**](https://github.com/open-telemetry/opentelemetry-specification#opentelemetry-specification). | ||
|
||
## Troubleshooting | ||
|
||
### Enable debug logging | ||
|
||
You can enable debug logging by changing the logging level of your provider. | ||
|
||
```js | ||
const provider = new NodeTracerProvider({ | ||
logLevel: LogLevel.DEBUG, | ||
plugins: { | ||
https: { | ||
// Ignore Application Insights Ingestion Server | ||
ignoreOutgoingUrls: [new RegExp(/dc.services.visualstudio.com/i)], | ||
}, | ||
}, | ||
}); | ||
``` | ||
|
||
## Next steps | ||
|
||
This exporter is made to be used with the [OpenTelemetry JS](http://github.com/open-telemetry/opentelemetry-js). | ||
|
||
### Plugin Registry | ||
|
||
To see if a plugin has already been made for a library you are using, please check out the [OpenTelemetry Registry](https://opentelemetry.io/registry/). | ||
|
||
If you cannot your library in the registry, feel free to suggest a new plugin request at [`opentelemetry-js-contrib`](http://github.com/open-telemetry/opentelemetry-js-contrib). | ||
|
||
## Contributing | ||
|
||
If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code. | ||
|
||
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/monitor/opentelemetry-exporter/README.png) | ||
|