Skip to content

Commit

Permalink
Merge pull request MicrosoftDocs#809 from azure-sdk/onboarding-azure-…
Browse files Browse the repository at this point in the history
…monitor-opentelemetry-exporter-518306

Docs.MS Release Updates for azure-monitor-opentelemetry-exporter
  • Loading branch information
xirzec authored Sep 17, 2020
2 parents ab8e3c8 + c5d29ff commit cf643a6
Show file tree
Hide file tree
Showing 2 changed files with 123 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ci-configs/packages-preview.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@
{
"name": "@azure/schema-registry@next"
},
{
"name": "@azure/event-hubs@next"
},
{
"name": "@azure/monitor-opentelemetry-exporter@next"
},
{
"name": "@azure/data-tables@next"
},
Expand Down
117 changes: 117 additions & 0 deletions docs-ref-services/monitor-opentelemetry-exporter-readme-pre.md
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)

0 comments on commit cf643a6

Please sign in to comment.