Zipkin Tracing

Helidon is integrated with the Zipkin tracer.

The Zipkin builder is loaded through ServiceLoader and configured. You could also use the Zipkin builder directly, though this would create a source-code dependency on the Zipkin tracer.

Prerequisites

To use Zipkin as a tracer, add the following dependency to your project:

<dependency>
    <groupId>io.helidon.tracing</groupId>
    <artifactId>helidon-tracing-zipkin</artifactId>
</dependency>
Copied

Configuring Zipkin

The Zipkin tracer supports the following configuration options:

KeyDefault valueBuilder methodDescription
serviceN/AserviceNameName of the service, to distinguish traces crossing service boundaries; Zipkin is using lower-case only, name will be automatically lower-cased
protocolhttpcollectorProtocolProtocol of the Zipkin trace collector (http or https)
hostlocalhostcollectorHostHost of the Zipkin trace collector (IP Address, hostname, or FQDN)
port9411collectorPortPort of the Zipkin trace collector
pathdefined by versioncollectorPathPath of the Zipkin trace collector, each version uses a different path by default.
api-version2versionZipkin specific method, set the protocol version to communicate with trace collector
enabledtrueenabledIf set to false, tracing would be disabled
tagsN/AaddTracerTag(String, String)String tags to add to each span
boolean-tagsN/AaddTracerTag(String, boolean)boolean tags to add to each span
int-tagsN/AaddTracerTag(String, int)int tags to add to each span

The following is an example of a Zipkin configuration, specified in the YAML format.

tracing:
  zipkin:
    service: "helidon-service"
    protocol: "https"
    host: "192.168.1.1"
    port: 9987
    api-version: 1
    # this is the default path for API version 2
    path: "/api/v2/spans"
    tags:
      tag1: "tag1-value"
      tag2: "tag2-value"
    boolean-tags:
      tag3: true
      tag4: false
    int-tags:
      tag5: 145
      tag6: 741
Copied

Example of Zipkin trace:

Zipkin example