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

@opentelemetry/tracing

Package Overview
Dependencies
Maintainers
5
Versions
143
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opentelemetry/tracing

OpenTelemetry Tracing

  • 0.3.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
31K
decreased by-62.91%
Maintainers
5
Weekly downloads
 
Created
Source

OpenTelemetry Tracing

Gitter chat NPM Published Version dependencies devDependencies Apache License

tracing contains the foundation for all tracing SDKs of opentelemetry-js.

Used standalone, this module provides methods for manual instrumentation of code, offering full control over span creation for client-side JavaScript (browser) and Node.js.

It does not provide automated instrumentation of known libraries, context propagation for asynchronous invocations or distributed-context out-of-the-box.

For automated instrumentation for Node.js, please see @opentelemetry/node.

Installation

npm install --save @opentelemetry/core
npm install --save @opentelemetry/tracing

Usage

const opentelemetry = require('@opentelemetry/core');
const { BasicTracer } = require('@opentelemetry/tracing');

// To start a trace, you first need to initialize the Tracer.
// NOTE: the default OpenTelemetry tracer does not record any tracing information.
const tracer = new BasicTracer();

// Initialize the OpenTelemetry APIs to use the BasicTracer bindings
opentelemetry.initGlobalTracer(tracer);

// To create a span in a trace, we used the global singleton tracer to start a new span.
const span = opentelemetry.getTracer().startSpan('foo');

// Create an Attributes
span.setAttribute('key', 'value');

// We must end the spans so they becomes available for exporting.
span.end();

Example

See examples/basic-tracer-node for an end-to-end example, including exporting created spans.

License

Apache 2.0 - See LICENSE for more information.

Keywords

FAQs

Package last updated on 21 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