Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@opentelemetry/exporter-collector

Package Overview
Dependencies
Maintainers
5
Versions
167
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opentelemetry/exporter-collector

OpenTelemetry Collector Exporter allows user to send collected traces to the OpenTelemetry Collector

  • 0.3.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
27K
increased by40.08%
Maintainers
5
Weekly downloads
 
Created
Source

OpenTelemetry Collector Exporter for web and node

Gitter chat NPM Published Version dependencies devDependencies Apache License

This module provides exporter for web and node to be used with opentelemetry-collector.

Installation

npm install --save @opentelemetry/exporter-collector

Usage in Web

import * as opentelemetry from '@opentelemetry/core';
import { SimpleSpanProcessor } from '@opentelemetry/tracing';
import { WebTracer } from '@opentelemetry/web';
import { CollectorExporter } from '@opentelemetry/exporter-collector'

const collectorOptions = {
  url: '<opentelemetry-collector-url>' // url is optional and can be omitted - default is http://localhost:55678/v1/trace
};

const tracer = new WebTracer();
const exporter = new CollectorExporter(collectorOptions);
tracer.addSpanProcessor(new SimpleSpanProcessor(exporter));

opentelemetry.initGlobalTracer(tracer);

Usage in Node

const opentelemetry = require('@opentelemetry/core');
const { BasicTracer, SimpleSpanProcessor } = require('@opentelemetry/tracing');
const { CollectorExporter } =  require('@opentelemetry/exporter-collector');

const collectorOptions = {
  url: '<opentelemetry-collector-url>' // url is optional and can be omitted - default is http://localhost:55678/v1/trace
};

const tracer = new BasicTracer();
const exporter = new CollectorExporter(collectorOptions);
tracer.addSpanProcessor(new SimpleSpanProcessor(exporter));

opentelemetry.initGlobalTracer(tracer);

Running opentelemetry-collector locally to see the traces

  1. Go to examples/basic-tracer-node
  2. run npm run collector:docker:ot
  3. Open page at http://localhost:9411/zipkin/ to observe the traces

License

Apache 2.0 - See LICENSE for more information.

Keywords

FAQs

Package last updated on 13 Dec 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc