3.8.0 • Published 3 days ago

@instana/opentelemetry-sampler v3.8.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 days ago

@instana/opentelemetry-sampler

The Opentelemetry Instana sampler decides if the app will record and sample based on the Instana headers.

Installation

$ npm i --save @instana/opentelemetry-sampler

Requirements

The sampler should be used together with the @opentelemetry/propagator-instana, because the propagator extracts the incoming HTTP headers.

$ npm i --save @opentelemetry/propagator-instana

NOTE: Every Instana service/app must forward the Instana headers.

Usage

const api = require('@opentelemetry/api');
const opentelemetry = require('@opentelemetry/sdk-node');
const { getNodeAutoInstrumentations } = require('@opentelemetry/auto-instrumentations-node');
const { SemanticResourceAttributes } = require('@opentelemetry/semantic-conventions');
const { Resource } = require('@opentelemetry/resources');
const { InstanaAlwaysOnSampler } = require('@instana/opentelemetry-sampler');
const { OTLPTraceExporter } = require('@opentelemetry/exporter-trace-otlp-http');
const { InstanaPropagator } = require('@opentelemetry/propagator-instana');

const nodeAutoInstrumentations = getNodeAutoInstrumentations();
api.propagation.setGlobalPropagator(new InstanaPropagator());

const traceOtlpExporter = new OTLPTraceExporter({
  url: process.env.OTEL_EXPORTER_OTLP_ENDPOINT
});

const sdk = new opentelemetry.NodeSDK({
  traceExporter: traceOtlpExporter,
  instrumentations: [nodeAutoInstrumentations],
  resource: new Resource({
    [SemanticResourceAttributes.SERVICE_NAME]: 'my-service'
  }),
  sampler: new InstanaAlwaysOnSampler()
});

sdk
  .start()
  .then(() => console.log('Tracing initialized'))
  .catch(err => console.log('Error initializing tracing', err));
3.8.0

3 days ago

3.7.0

7 days ago

3.6.0

10 days ago

3.5.0

15 days ago

3.4.0

23 days ago

3.3.1

28 days ago

3.3.0

2 months ago

3.2.1

2 months ago

3.2.0

2 months ago

3.1.3

3 months ago

3.1.2

3 months ago

3.1.1

4 months ago

3.1.0

4 months ago

3.0.0

5 months ago

2.36.1

5 months ago

2.29.0

9 months ago

2.27.0

10 months ago

2.32.0

8 months ago

2.30.2

9 months ago

2.30.1

9 months ago

2.34.0

7 months ago

2.30.0

9 months ago

2.36.0

5 months ago

2.34.1

7 months ago

2.26.3

10 months ago

2.28.0

10 months ago

2.26.2

10 months ago

2.26.1

10 months ago

2.26.0

10 months ago

2.31.0

8 months ago

2.33.1

8 months ago

2.33.0

8 months ago

2.35.0

6 months ago

2.25.3

11 months ago

2.25.0

11 months ago

2.24.0

11 months ago

2.25.2

11 months ago

2.25.1

11 months ago

2.23.0

11 months ago

2.22.1

12 months ago

2.22.0

1 year ago

2.21.1

1 year ago

2.19.0

1 year ago

2.18.1

1 year ago

2.18.0

1 year ago

2.21.0

1 year ago

2.20.2

1 year ago

2.20.0

1 year ago

2.20.1

1 year ago

2.17.0

1 year ago

2.16.0

1 year ago

2.15.0

1 year ago

2.14.1

1 year ago

2.13.2

1 year ago

2.14.2

1 year ago

2.13.0

1 year ago

2.14.0

1 year ago

2.13.1

1 year ago

2.12.0

1 year ago

2.11.1

2 years ago

2.11.0

2 years ago

2.10.0

2 years ago

2.7.0

2 years ago

2.9.0

2 years ago

2.8.1

2 years ago

2.8.0

2 years ago

2.7.1

2 years ago

2.6.2

2 years ago