Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
@opentelemetry/exporter-collector
Advanced tools
OpenTelemetry Collector Exporter allows user to send collected traces to the OpenTelemetry Collector
This module provides exporter for web and node to be used with opentelemetry-collector.
npm install --save @opentelemetry/exporter-collector
The CollectorExporter in Web expects the endpoint to end in /v1/trace
.
import { SimpleSpanProcessor } from '@opentelemetry/tracing';
import { WebTracerProvider } 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
headers: {}, //an optional object containing custom headers to be sent with each request
};
const provider = new WebTracerProvider();
const exporter = new CollectorExporter(collectorOptions);
provider.addSpanProcessor(new SimpleSpanProcessor(exporter));
provider.register();
The CollectorExporter in Node expects the URL to only be the hostname. It will not work with /v1/trace
.
const { BasicTracerProvider, SimpleSpanProcessor } = require('@opentelemetry/tracing');
const { CollectorExporter } = require('@opentelemetry/exporter-collector');
const collectorOptions = {
serviceName: 'basic-service',
url: '<opentelemetry-collector-url>' // url is optional and can be omitted - default is localhost:55678
};
const provider = new BasicTracerProvider();
const exporter = new CollectorExporter(collectorOptions);
provider.addSpanProcessor(new SimpleSpanProcessor(exporter));
provider.register();
By default, plaintext connection is used. In order to use TLS in Node.js, provide credentials
option like so:
const fs = require('fs');
const grpc = require('grpc');
const { BasicTracerProvider, SimpleSpanProcessor } = require('@opentelemetry/tracing');
const { CollectorExporter } = require('@opentelemetry/exporter-collector');
const collectorOptions = {
serviceName: 'basic-service',
url: '<opentelemetry-collector-url>', // url is optional and can be omitted - default is localhost:55678
credentials: grpc.credentials.createSsl(
fs.readFileSync('./ca.crt'),
fs.readFileSync('./client.key'),
fs.readFileSync('./client.crt')
)
};
const provider = new BasicTracerProvider();
const exporter = new CollectorExporter(collectorOptions);
provider.addSpanProcessor(new SimpleSpanProcessor(exporter));
provider.register();
To see how to generate credentials, you can refer to the script used to generate certificates for tests here
The exporter can be configured to send custom metadata with each request as in the example below:
const grpc = require('grpc');
const { BasicTracerProvider, SimpleSpanProcessor } = require('@opentelemetry/tracing');
const { CollectorExporter } = require('@opentelemetry/exporter-collector');
const metadata = new grpc.Metadata();
metadata.set('k', 'v');
const collectorOptions = {
serviceName: 'basic-service',
url: '<opentelemetry-collector-url>', // url is optional and can be omitted - default is localhost:55678
metadata, // // an optional grpc.Metadata object to be sent with each request
};
const provider = new BasicTracerProvider();
const exporter = new CollectorExporter(collectorOptions);
provider.addSpanProcessor(new SimpleSpanProcessor(exporter));
provider.register();
Note, that this will only work if TLS is also configured on the server.
npm run collector:docker:ot
http://localhost:9411/zipkin/
to observe the tracesApache 2.0 - See LICENSE for more information.
0.9.0
opentelemetry-api
, opentelemetry-exporter-prometheus
, opentelemetry-metrics
opentelemetry-api
, opentelemetry-metrics
opentelemetry-api
, opentelemetry-core
, opentelemetry-tracing
opentelemetry-plugin-fetch
, opentelemetry-plugin-xml-http-request
, opentelemetry-web
opentelemetry-node
opentelemetry-exporter-jaeger
opentelemetry-exporter-zipkin
opentelemetry-plugin-xml-http-request
opentelemetry-metrics
opentelemetry-exporter-collector
opentelemetry-exporter-zipkin
opentelemetry-exporter-collector
opentelemetry-context-zone-peer-dep
opentelemetry-semantic-conventions
FAQs
OpenTelemetry Collector Exporter allows user to send collected traces to the OpenTelemetry Collector
The npm package @opentelemetry/exporter-collector receives a total of 18,698 weekly downloads. As such, @opentelemetry/exporter-collector popularity was classified as popular.
We found that @opentelemetry/exporter-collector demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.