
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
@instana/opentelemetry-sampler
Advanced tools
The Opentelemetry Instana sampler decides if the app will record and sample based on the Instana headers.
$ npm i --save @instana/opentelemetry-sampler
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.
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));
FAQs
OpenTelemetry Instana sampler
The npm package @instana/opentelemetry-sampler receives a total of 1,361 weekly downloads. As such, @instana/opentelemetry-sampler popularity was classified as popular.
We found that @instana/opentelemetry-sampler demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?

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.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.