Giter Site home page Giter Site logo

microsoft / opentelemetry-azure-monitor-js Goto Github PK

View Code? Open in Web Editor NEW
13.0 6.0 10.0 1.73 MB

This repository is home to Azure Monitor Exporters and SDKs for the OpenTelemetry JavaScript Project (https://github.com/open-telemetry/opentelemetry-js)

License: MIT License

JavaScript 1.36% TypeScript 98.64%
opentelemetry azure applicationinsights nodejs javascript azure-monitor

opentelemetry-azure-monitor-js's Introduction

This repository has been moved to the Azure SDK for JavaScript repository. In order to improve discoverability and share common dependencies/tests, the OpenTelemetry Azure Monitor for JS exporter has moved to a common location containing all Azure SDKs.

Azure Monitor JavaScript Exporter for OpenTelemetry

npm version codecov Node.js CI

Getting Started

This exporter package assumes your application is already instrumented with the OpenTelemetry SDK. Once you are ready to export OpenTelemetry data, you can add this exporter to your application:

npm install @azure/monitor-opentelemetry-exporter

Distributed Tracing

Add the exporter to your existing OpenTelemetry tracer provider (NodeTracerProvider / BasicTracerProvider)

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

Please take a look at the examples to see how to add the Azure Monitor Exporter to your existing OpenTelemetry instrumented project.

Compiling This Project

npm install
npm run build
npm run lint
npm run test

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

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., status check, 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. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

opentelemetry-azure-monitor-js's People

Contributors

dependabot-preview[bot] avatar hectorhdzg avatar markwolff avatar microsoft-github-operations[bot] avatar microsoftopensource avatar richardpark-msft avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

opentelemetry-azure-monitor-js's Issues

Failed to load Application Version

Hello. Thanks for your work on this. I am getting an error 'Failed to load Application version' after tracing is initialised. From a quick dig into this, it seems like the _appPrefix needs one further '../' to find the package.json file that it is looking for.

Happy to submit a PR if it is helpful and assuming correct diagnosis!

const packageJsonPath = path.resolve(__dirname, `${this._appPrefix}../../../../package.json`);

Failed to fetch persisted file

It appears that 'failing to fetch persisted file' is an expected and normal outcome, and so therefore should not be an error like this?

I checked the folder there and it does not exist. However, all envelopes seem to end up successfully in Application Insights.

Screenshot 2020-06-26 at 15 53 58

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.