OpenTelemetry Honeycomb Trace Exporter allows the user to send collected traces to Honeycomb.
npm install --save https://github.com/metered/opentelemetry-honeycomb-exporter-js
Install the exporter on your application and pass the options, it must contain a service name.
import { HoneycombExporter } from '@honeycombio/opentelemetry-exporter';
const exporter = new HoneycombExporter({
logger: console,
serviceName: "my-service",
libhoney: {
writeKey: 'honeycomb-api-key',
dataset: 'my-dataset',
}
})
Now, register the exporter.
tracer.addSpanProcessor(new BatchSpanProcessor(exporter));
You can use built-in SimpleSpanProcessor
or BatchSpanProcessor
or write your own.
- SimpleSpanProcessor: The implementation of
SpanProcessor
that passes ended span directly to the configuredSpanExporter
. - BatchSpanProcessor: The implementation of the
SpanProcessor
that batches ended spans and pushes them to the configuredSpanExporter
. It is recommended to use thisSpanProcessor
for better performance and optimization.
- For more information on OpenTelemetry, visit: https://opentelemetry.io/
- For more about OpenTelemetry JavaScript: https://github.com/open-telemetry/opentelemetry-js
- For help or feedback on this project, join us on [gitter][gitter-url]
Apache 2.0 - See LICENSE for more information.