Skip to content

Releases: openzipkin-contrib/zipkin-otel

Zipkin OTEL 0.2.0

16 Jan 06:06
Compare
Choose a tag to compare

What's Changed

  • Add OTLP log endpoint to convert log events to span annotations by @making in #26
  • Make the mapping from brave tags to otel attributes configurable by @making in #27
  • Support mapping brave info to otel server/client.address/port attributes by @making in #28
  • Apply Square Java Code Styles by @making in #30
  • Bump Zipkin from 3.4.3 to 3.4.4

Full Changelog: 0.1.2...0.2.0

Usage

Encoder

Add the dependency:

		<dependency>
			<groupId>io.zipkin.contrib.otel</groupId>
			<artifactId>encoder-brave</artifactId>
			<version>0.2.0</version>
		</dependency>

The following demonstrates using the encoder:

// 'sender' is directed at the OTLP tracing endpoint (e.g., http://localhost:4318/v1/traces)
spanHandler = AsyncZipkinSpanHandler.newBuilder(sender).build(OtlpProtoV1Encoder.create());

You can customize the encoder as follows:

OtlpProtoV1Encoder encoder = OtlpProtoV1Encoder.newBuilder()
    // OpenTelemetry Instrumentation scope
    .instrumentationScope(new InstrumentationScope("com.example.app", "1.0.0"))
    // OpenTelemetry Resource Attributes
    .resourceAttributes(Map.of("key", "value"))
    // Mapping from Brave Tags to OpenTelemetry Attributes
    .tagToAttributes(TagToAttributes.newBuilder()
        .withDefaults()
        .tagToAttribute("method", "http.request.method")
        .tagToAttribute("status", "http.response.status_code")
        .build())
    // Brave Error Tag
    .errorTag(Tags.ERROR)
    .build();

Collector

To start the Zipkin OTLP collector, use the following Docker command:

# The endpoint for OTLP/HTTP is http://localhost:9411/v1/traces
docker run --rm -p 9411:9411 -e UI_ENABLED=true ghcr.io/openzipkin-contrib/zipkin-otel:0.2.0

For a complete example, please refer to the sample repository.

Zipkin OTEL 0.1.2

23 Dec 02:27
Compare
Choose a tag to compare

What's Changed

  • Bump opentelemetry-proto to 1.4.0-alpha by @making in #22
  • Remove dependency on io.opentelemetry.semconv:opentelemetry-semconv by @making in #23
  • Make Brave InstrumentationScope configurable by @making in #24
  • Add Telemetry Attributes to OtlpProtoV1Encoder by @making in #25
  • Update dependencies

Full Changelog: 0.1.0...0.1.2

Zipkin OTEL 0.1.0

17 Oct 11:26
Compare
Choose a tag to compare

We’re excited to announce the first release of Zipkin Otel, version 0.1.0! This project provides integration between Zipkin and OpenTelemetry by introducing two main components:

  1. Brave Encoder for OTLP
    A Brave (client-side) encoder that transforms Zipkin Spans into OTLP Spans. This encoder currently supports only HTTP/protobuf.

  2. Zipkin Collector for OTLP
    A collector for the Zipkin server that receives traces in OTLP format over HTTP/protobuf.

Usage

Encoder

Add the dependency:

		<dependency>
			<groupId>io.zipkin.contrib.otel</groupId>
			<artifactId>encoder-brave</artifactId>
			<version>0.1.0</version>
		</dependency>

The following demonstrates using the encoder:

// 'sender' is directed at the OTLP tracing endpoint (e.g., http://localhost:4318/v1/traces)
spanHandler = AsyncZipkinSpanHandler.newBuilder(sender).build(OtlpProtoV1Encoder.create());

Collector

To start the Zipkin OTLP collector, use the following Docker command:

# The endpoint for OTLP/HTTP is http://localhost:9411/v1/traces
docker run --rm -p 9411:9411 -e UI_ENABLED=true ghcr.io/openzipkin-contrib/zipkin-otel:0.1.0

For a complete example, please refer to the sample repository.

Zipkin ↔ OTLP Transformation Details

While this project mostly aligns with the OpenTelemetry to Zipkin Transformation documentation, here are a few additional notes.

Zipkin to OTLP (Brave)

  • Mapping to Resource Attributes: Direct mapping from Zipkin Spans to resource attributes is not provided, but resource attributes can be set on the encoder as follows:
    OtlpProtoV1Encoder.newBuilder().resourceAttributes(map).build()
  • Zipkin Span Annotations: Zipkin Span annotations are mapped to OpenTelemetry Span Event names. Currently, there’s no support for mapping annotation details to event attributes, but future support is under consideration.

OTLP to Zipkin (Collector)

  • Resource Attributes as Span Tags: OpenTelemetry resource attributes are included as Span tags in Zipkin. The zipkin2.collector.otel.http.OtelResourceMapper interface can be implemented to customize the mapping from OTLP resources to Zipkin Spans.
  • OpenTelemetry Span Events: Events are mapped to Zipkin annotations. If event attributes are present, the format is:
    "my-event-name": { "key1": "value1", "key2": "value2" }.
    If no event attributes are present, the annotation simply becomes my-event-name (without quotes).
  • Remote Endpoint: Only peer.name attribute or network.peer.address attribute are considered as remote endpoint candidates.