Socket
Socket
Sign inDemoInstall

@opentelemetry/exporter-zipkin

Package Overview
Dependencies
5
Maintainers
3
Versions
201
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @opentelemetry/exporter-zipkin

OpenTelemetry Zipkin Exporter allows the user to send collected traces to Zipkin.


Version published
Weekly downloads
1.4M
decreased by-18.28%
Maintainers
3
Install size
3.84 MB
Created
Weekly downloads
 

Package description

What is @opentelemetry/exporter-zipkin?

The @opentelemetry/exporter-zipkin package is designed for Node.js and web applications to export telemetry data to Zipkin, a distributed tracing system. It allows developers to monitor and troubleshoot their applications by collecting and reporting timing data needed to troubleshoot latency problems in microservice architectures. This package is part of the OpenTelemetry project, which provides a set of APIs, libraries, agents, and instrumentation to create and manage telemetry data (metrics, logs, and traces).

What are @opentelemetry/exporter-zipkin's main functionalities?

Exporting Traces to Zipkin

This code snippet demonstrates how to set up the ZipkinExporter with the OpenTelemetry Node.js SDK. It initializes a NodeTracerProvider, configures the ZipkinExporter with the service name and Zipkin server URL, and registers the exporter using a SimpleSpanProcessor.

{
  const { ZipkinExporter } = require('@opentelemetry/exporter-zipkin');
  const { SimpleSpanProcessor } = require('@opentelemetry/tracing');
  const { NodeTracerProvider } = require('@opentelemetry/node');

  const provider = new NodeTracerProvider();
  const zipkinExporter = new ZipkinExporter({
    serviceName: 'your-service-name',
    url: 'http://localhost:9411/api/v2/spans'
  });
  provider.addSpanProcessor(new SimpleSpanProcessor(zipkinExporter));
  provider.register();
}

Other packages similar to @opentelemetry/exporter-zipkin

Changelog

Source

1.23.0

:rocket: (Enhancement)

  • perf(sdk-trace-base): do not allocate arrays if resource has no pending async attributes #4576 @Samuron
  • feat(sdk-metrics): added experimental synchronous gauge to SDK #4565 @clintonb
    • this change will become user-facing in an upcoming release

:bug: (Bug Fix)

  • fix(sdk-metrics): increase the depth of the output to the console such that objects in the metric are printed fully to the console #4522 @JacksonWeber

Readme

Source

OpenTelemetry Zipkin Trace Exporter

NPM Published Version Apache License

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

Zipkin is a distributed tracing system. It helps gather timing data needed to troubleshoot latency problems in microservice architectures. It manages both the collection and lookup of this data.

Installation

npm install --save @opentelemetry/exporter-zipkin

Usage in Node and Browser

Install the exporter on your application and pass the options. serviceName is an optional string. If omitted, the exporter will first try to get the service name from the Resource. If no service name can be detected on the Resource, a fallback name of "OpenTelemetry Service" will be used.

const { ZipkinExporter } = require('@opentelemetry/exporter-zipkin');

// Add your zipkin url (`http://localhost:9411/api/v2/spans` is used as
// default) and application name to the Zipkin options.
// You can also define your custom headers which will be added automatically.
const options = {
  headers: {
    'my-header': 'header-value',
  },
  url: 'your-zipkin-url',
  // optional interceptor
  getExportRequestHeaders: () => {
    return {
      'my-header': 'header-value',
    }
  }
}
const exporter = new ZipkinExporter(options);

Now, register the exporter and start tracing.

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.

Options

  • getExportRequestHeaders - optional interceptor that allows adding new headers every time time the exporter is going to send spans. This is optional and can be used if headers are changing over time. This is a sync callback.

Viewing your traces

Please visit the Zipkin UI endpoint http://localhost:9411

License

Apache 2.0 - See LICENSE for more information.

Keywords

FAQs

Last updated on 03 Apr 2024

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc