Skip to content

katiebayes/opentelemetry-exporter-js

Repository files navigation

OpenTelemetry Honeycomb Trace Exporter

Apache License

OpenTelemetry Honeycomb Trace Exporter allows the user to send collected traces to Honeycomb.

Installation

npm install --save https://github.com/metered/opentelemetry-honeycomb-exporter-js

Usage

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 configured SpanExporter.
  • BatchSpanProcessor: The implementation of the SpanProcessor that batches ended spans and pushes them to the configured SpanExporter. It is recommended to use this SpanProcessor for better performance and optimization.

Useful links

License

Apache 2.0 - See LICENSE for more information.

About

The Honeycomb exporter for the OpenTelemetry Javascript SDK

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published