@opentelemetry/core
OpenTelemetry Core provides default and no-op implementations of the OpenTelemetry types for trace and metrics
Last updated 4 years ago by dyladan .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @opentelemetry/core 
SYNC missed versions from official npm registry.

OpenTelemetry Core

Gitter chat NPM Published Version dependencies devDependencies Apache License

This package provides default implementations of the OpenTelemetry API for trace and metrics. It's intended for use both on the server and in the browser.

Built-in Implementations

Built-in Propagators

HttpTraceContext Propagator

OpenTelemetry provides a text-based approach to propagate context to remote services using the W3C Trace Context HTTP headers.

const api = require("@opentelemetry/api");
const { HttpTraceContext } = require("@opentelemetry/core");

/* Set Global Propagator */
api.propagation.setGlobalPropagator(new HttpTraceContext());

B3 Propagator

This is propagator for the B3 HTTP header format, which sends a SpanContext on the wire in an HTTP request, allowing other services to create spans with the right context. Based on: https://github.com/openzipkin/b3-propagation

const api = require("@opentelemetry/api");
const { B3Propagator } = require("@opentelemetry/core");

/* Set Global Propagator */
api.propagation.setGlobalPropagator(new B3Propagator());

Composite Propagator

Combines multiple propagators into a single propagator.

This is used as a default Propagator

const api = require("@opentelemetry/api");
const { CompositePropagator } = require("@opentelemetry/core");

/* Set Global Propagator */
api.propagation.setGlobalPropagator(new CompositePropagator());

Correlation Context Propagator

Provides a text-based approach to propagate correlation context to remote services using the OpenTelemetry CorrelationContext Propagation HTTP headers.

const api = require("@opentelemetry/api");
const { HttpCorrelationContext } = require("@opentelemetry/core");

/* Set Global Propagator */
api.propagation.setGlobalPropagator(new HttpCorrelationContext());

Built-in Sampler

Sampler is used to make decisions on Span sampling.

AlwaysOn

Samples every trace regardless of upstream sampling decisions.

This is used as a default Sampler

const { NodeTracerProvider } = require("@opentelemetry/node");
const { AlwaysOnSampler } = require("@opentelemetry/core");

const tracerProvider = new NodeTracerProvider({
  sampler: new AlwaysOnSampler()
});

AlwaysOff

Doesn't sample any trace, regardless of upstream sampling decisions.

const { NodeTracerProvider } = require("@opentelemetry/node");
const { AlwaysOffSampler } = require("@opentelemetry/core");

const tracerProvider = new NodeTracerProvider({
  sampler: new AlwaysOffSampler()
});

Probability

Samples a configurable percentage of traces, and additionally samples any trace that was sampled upstream.

const { NodeTracerProvider } = require("@opentelemetry/node");
const { ProbabilitySampler } = require("@opentelemetry/core");

const tracerProvider = new NodeTracerProvider({
  sampler: new ProbabilitySampler(0.5)
});

ParentOrElse

A composite sampler that either respects the parent span's sampling decision or delegates to delegateSampler for root spans.

const { NodeTracerProvider } = require("@opentelemetry/node");
const { ParentOrElseSampler, AlwaysOffSampler } = require("@opentelemetry/core");

const tracerProvider = new NodeTracerProvider({
  sampler: new ParentOrElseSampler(new AlwaysOffSampler())
});

Useful links

License

Apache 2.0 - See LICENSE for more information.

Current Tags

  • 0.25.1-alpha.23                                ...           canary (3 years ago)
  • 1.27.0                                ...           latest (23 days ago)
  • 1.8.0                                ...           next (2 years ago)

173 Versions

  • 1.27.0                                ...           23 days ago
  • 1.26.0                                ...           3 months ago
  • 1.25.1                                ...           5 months ago
  • 1.25.0                                ...           5 months ago
  • 1.24.1                                ...           6 months ago
  • 1.24.0                                ...           7 months ago
  • 1.23.0                                ...           7 months ago
  • 1.22.0                                ...           9 months ago
  • 1.21.0                                ...           10 months ago
  • 1.20.0                                ...           10 months ago
  • 1.19.0                                ...           a year ago
  • 1.18.1                                ...           a year ago
  • 1.18.0                                ...           a year ago
  • 1.17.1                                ...           a year ago
  • 1.17.0                                ...           a year ago
  • 1.16.0                                ...           a year ago
  • 1.15.2                                ...           a year ago
  • 1.15.1                                ...           a year ago
  • 1.15.0                                ...           a year ago
  • 1.14.0                                ...           a year ago
  • 1.13.0                                ...           2 years ago
  • 1.12.0                                ...           2 years ago
  • 1.11.0                                ...           2 years ago
  • 1.10.1                                ...           2 years ago
  • 1.10.0                                ...           2 years ago
  • 1.9.1                                ...           2 years ago
  • 1.9.0                                ...           2 years ago
  • 1.8.0                                ...           2 years ago
  • 1.7.0                                ...           2 years ago
  • 1.6.0                                ...           2 years ago
  • 1.5.0                                ...           2 years ago
  • 1.4.0                                ...           2 years ago
  • 1.3.1                                ...           2 years ago
  • 1.3.0                                ...           2 years ago
  • 1.2.0                                ...           3 years ago
  • 1.1.1                                ...           3 years ago
  • 1.1.0                                ...           3 years ago
  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
  • 0.26.0                                ...           3 years ago
  • 0.25.1-alpha.23                                ...           3 years ago
  • 0.25.1-alpha.13                                ...           3 years ago
  • 0.25.1-alpha.12                                ...           3 years ago
  • 0.25.1-alpha.4                                ...           3 years ago
  • 0.25.1-alpha.2                                ...           3 years ago
  • 0.25.0                                ...           3 years ago
  • 0.25.1-alpha.21                                ...           3 years ago
  • 0.24.1-alpha.20                                ...           3 years ago
  • 0.24.1-alpha.14                                ...           3 years ago
  • 0.24.1-alpha.7                                ...           3 years ago
  • 0.24.1-alpha.5                                ...           3 years ago
  • 0.24.1-alpha.4                                ...           3 years ago
  • 0.24.1-alpha.1                                ...           3 years ago
  • 0.24.0                                ...           3 years ago
  • 0.24.1-alpha.31                                ...           3 years ago
  • 0.23.1-alpha.28                                ...           3 years ago
  • 0.23.1-alpha.24                                ...           3 years ago
  • 0.23.1-alpha.23                                ...           3 years ago
  • 0.23.1-alpha.15                                ...           3 years ago
  • 0.23.1-alpha.3                                ...           3 years ago
  • 0.23.1-alpha.18                                ...           3 years ago
  • 0.23.0                                ...           3 years ago
  • 0.23.1-alpha.17                                ...           3 years ago
  • 0.22.1-alpha.16                                ...           3 years ago
  • 0.22.1-alpha.15                                ...           3 years ago
  • 0.22.1-alpha.13                                ...           3 years ago
  • 0.22.1-alpha.3                                ...           3 years ago
  • 0.22.0                                ...           3 years ago
  • 0.22.1-alpha.5                                ...           3 years ago
  • 0.21.1-alpha.2                                ...           3 years ago
  • 0.21.1-alpha.1                                ...           3 years ago
  • 0.21.0                                ...           3 years ago
  • 0.21.1-alpha.7                                ...           3 years ago
  • 0.20.1-alpha.4                                ...           3 years ago
  • 0.20.1-alpha.3                                ...           3 years ago
  • 0.20.0                                ...           3 years ago
  • 0.20.1-alpha.49                                ...           3 years ago
  • 0.19.1-alpha.43                                ...           3 years ago
  • 0.19.1-alpha.42                                ...           3 years ago
  • 0.19.1-alpha.38                                ...           3 years ago
  • 0.19.1-alpha.33                                ...           3 years ago
  • 0.19.1-alpha.31                                ...           3 years ago
  • 0.19.1-alpha.26                                ...           4 years ago
  • 0.19.1-alpha.25                                ...           4 years ago
  • 0.19.1-alpha.21                                ...           4 years ago
  • 0.19.1-alpha.19                                ...           4 years ago
  • 0.19.1-alpha.12                                ...           4 years ago
  • 0.19.1-alpha.11                                ...           4 years ago
  • 0.19.1-alpha.9                                ...           4 years ago
  • 0.19.1-alpha.7                                ...           4 years ago
  • 0.19.1-alpha.39                                ...           4 years ago
  • 0.19.1-alpha.37                                ...           4 years ago
  • 0.19.0                                ...           4 years ago
  • 0.19.1-alpha.36                                ...           4 years ago
  • 0.18.3-alpha.31                                ...           4 years ago
  • 0.18.3-alpha.28                                ...           4 years ago
  • 0.18.3-alpha.25                                ...           4 years ago
  • 0.18.3-alpha.23                                ...           4 years ago
  • 0.18.3-alpha.20                                ...           4 years ago
  • 0.18.3-alpha.18                                ...           4 years ago
  • 0.18.3-alpha.16                                ...           4 years ago
  • 0.18.3-alpha.14                                ...           4 years ago
  • 0.18.3-alpha.11                                ...           4 years ago
  • 0.18.3-alpha.10                                ...           4 years ago
  • 0.18.3-alpha.7                                ...           4 years ago
  • 0.18.3-alpha.5                                ...           4 years ago
  • 0.18.3-alpha.4                                ...           4 years ago
  • 0.18.3-alpha.3                                ...           4 years ago
  • 0.18.3-alpha.1                                ...           4 years ago
  • 0.18.2                                ...           4 years ago
  • 0.18.3-alpha.2                                ...           4 years ago
  • 0.18.2-alpha.1                                ...           4 years ago
  • 0.18.1                                ...           4 years ago
  • 0.18.2-alpha.81                                ...           4 years ago
  • 0.18.1-alpha.26                                ...           4 years ago
  • 0.18.1-alpha.24                                ...           4 years ago
  • 0.18.1-alpha.21                                ...           4 years ago
  • 0.18.1-alpha.20                                ...           4 years ago
  • 0.18.1-alpha.3                                ...           4 years ago
  • 0.18.0                                ...           4 years ago
  • 0.18.1-alpha.12                                ...           4 years ago
  • 0.17.1-alpha.8                                ...           4 years ago
  • 0.17.1-alpha.5                                ...           4 years ago
  • 0.17.1-alpha.2                                ...           4 years ago
  • 0.17.1-alpha.21                                ...           4 years ago
  • 0.17.0                                ...           4 years ago
  • 0.16.1-alpha.20                                ...           4 years ago
  • 0.16.1-alpha.18                                ...           4 years ago
  • 0.16.1-alpha.15                                ...           4 years ago
  • 0.16.1-alpha.14                                ...           4 years ago
  • 0.16.1-alpha.11                                ...           4 years ago
  • 0.16.1-alpha.10                                ...           4 years ago
  • 0.16.0                                ...           4 years ago
  • 0.15.0                                ...           4 years ago
  • 0.14.0                                ...           4 years ago
  • 0.13.0                                ...           4 years ago
  • 0.12.1-alpha.7                                ...           4 years ago
  • 0.12.0                                ...           4 years ago
  • 0.12.1-alpha.54                                ...           4 years ago
  • 0.11.1-alpha.53                                ...           4 years ago
  • 0.11.1-alpha.44                                ...           4 years ago
  • 0.11.1-alpha.36                                ...           4 years ago
  • 0.11.1-alpha.35                                ...           4 years ago
  • 0.11.1-alpha.15                                ...           4 years ago
  • 0.11.0                                ...           4 years ago
  • 0.11.1-alpha.48                                ...           4 years ago
  • 0.10.3-alpha.41                                ...           4 years ago
  • 0.10.3-alpha.40                                ...           4 years ago
  • 0.10.3-alpha.35                                ...           4 years ago
  • 0.10.3-alpha.34                                ...           4 years ago
  • 0.10.3-canary.0                                ...           4 years ago
  • 0.10.2                                ...           4 years ago
  • 0.10.1                                ...           4 years ago
  • 0.10.0                                ...           4 years ago
  • 0.9.0                                ...           4 years ago
  • 0.8.3                                ...           4 years ago
  • 0.8.2                                ...           4 years ago
  • 0.8.1                                ...           4 years ago
  • 0.8.0                                ...           5 years ago
  • 0.7.0                                ...           5 years ago
  • 0.6.1                                ...           5 years ago
  • 0.6.0                                ...           5 years ago
  • 0.5.2                                ...           5 years ago
  • 0.5.1                                ...           5 years ago
  • 0.5.0                                ...           5 years ago
  • 0.4.0                                ...           5 years ago
  • 0.3.3                                ...           5 years ago
  • 0.3.2                                ...           5 years ago
  • 0.3.1                                ...           5 years ago
  • 0.3.0                                ...           5 years ago
  • 0.2.0                                ...           5 years ago
  • 0.1.1                                ...           5 years ago
  • 0.1.0                                ...           5 years ago
Downloads
Total 0
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (3)
Dev Dependencies (23)
Dependents (56)

© 2010 - cnpmjs.org x YWFE | Home | YWFE