Dropwizard Zipkin Client

Dropwizard Zipkin Bundle

License

License

Categories

Categories

DropWizard Container Microservices Zipkin Application Testing & Monitoring Application Performance Monitoring (APM) CLI User Interface
GroupId

GroupId

com.smoketurner.dropwizard
ArtifactId

ArtifactId

zipkin-client
Last Version

Last Version

2.0.16-1
Release Date

Release Date

Type

Type

jar
Description

Description

Dropwizard Zipkin Client
Dropwizard Zipkin Bundle

Download zipkin-client

How to add to project

<!-- https://jarcasting.com/artifacts/com.smoketurner.dropwizard/zipkin-client/ -->
<dependency>
    <groupId>com.smoketurner.dropwizard</groupId>
    <artifactId>zipkin-client</artifactId>
    <version>2.0.16-1</version>
</dependency>
// https://jarcasting.com/artifacts/com.smoketurner.dropwizard/zipkin-client/
implementation 'com.smoketurner.dropwizard:zipkin-client:2.0.16-1'
// https://jarcasting.com/artifacts/com.smoketurner.dropwizard/zipkin-client/
implementation ("com.smoketurner.dropwizard:zipkin-client:2.0.16-1")
'com.smoketurner.dropwizard:zipkin-client:jar:2.0.16-1'
<dependency org="com.smoketurner.dropwizard" name="zipkin-client" rev="2.0.16-1">
  <artifact name="zipkin-client" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.smoketurner.dropwizard', module='zipkin-client', version='2.0.16-1')
)
libraryDependencies += "com.smoketurner.dropwizard" % "zipkin-client" % "2.0.16-1"
[com.smoketurner.dropwizard/zipkin-client "2.0.16-1"]

Dependencies

compile (5)

Group / Artifact Type Version
io.dropwizard : dropwizard-client jar
io.zipkin.brave : brave-instrumentation-httpclient jar
io.zipkin.brave : brave jar
io.zipkin.brave : brave-instrumentation-jaxrs2 jar
io.zipkin.brave : brave-instrumentation-jersey-server jar

runtime (2)

Group / Artifact Type Version
jakarta.xml.bind : jakarta.xml.bind-api jar
jakarta.activation : jakarta.activation-api jar

test (6)

Group / Artifact Type Version
io.dropwizard : dropwizard-testing jar
org.junit.jupiter : junit-jupiter jar 5.7.0
org.assertj : assertj-core jar 3.18.1
org.mockito : mockito-core jar 3.6.28
org.openjdk.jmh : jmh-core jar 1.26
org.openjdk.jmh : jmh-generator-annprocess jar 1.26

Project Modules

There are no modules declared in this project.

Dropwizard Zipkin Bundle

Build Status Maven Central GitHub license Become a Patron

A bundle for submitting tracing data to Zipkin from Dropwizard applications. Internally, this library uses Brave to interface a Zipkin collector.

Dependency Info

<dependency>
    <groupId>com.smoketurner.dropwizard</groupId>
    <artifactId>zipkin-core</artifactId>
    <version>2.0.7-1</version>
</dependency>

Beginning with v1.2.2-4, if you are using the Kafka sender, you must explicitly add the kafka-clients dependency into your pom.xml as it has been excluded from the zipkin-core module.

<dependency>
    <groupId>org.apache.kafka</groupId>
    <artifactId>kafka-clients</artifactId>
    <version>2.2.1</version>
</dependency>

Usage

Add a ZipkinBundle to your Application class.

private ZipkinBundle<HelloWorldConfiguration> zipkinBundle;

@Override
public void initialize(Bootstrap<HelloWorldConfiguration> bootstrap) {
  zipkinBundle = new ZipkinBundle<HelloWorldConfiguration>(getName()) {
    @Override
    public ZipkinFactory getZipkinFactory(HelloWorldConfiguration configuration) {
      return configuration.getZipkinFactory();
    }
  };
  bootstrap.addBundle(zipkinBundle);
}

@Override
public void run(HelloWorldConfiguration configuration, Environment environment) throws Exception {
  final Optional<HttpTracing> tracing = zipkinBundle.getHttpTracing();
}

Configuration

For configuring the Zipkin connection, there is a ZipkinFactory:

zipkin:

  # Required properties
  # Whether tracing is enabled or not (defaults to true)
  enabled: true
  # Listening IP address of the service
  serviceHost: 192.168.1.100
  # Listening port of the service
  servicePort: 8080

  # Optional properties
  # Span collector to use (console, http, kafka or empty)
  collector: http
  # If using the http collector, provide the baseUrl
  baseUrl: http://127.0.0.1:9411/
  # If using the http collector, timeout out when connecting (defaults to 10s)
  connectTimeout: 10s
  # If using the http collector, timeout out when reading the response (defaults to 60s)
  readTimeout: 60s
  # If using the kafka collector, provide the Kafka bootstrap servers
  bootstrapServers: 127.0.0.1:9092;10.0.1.1:9092

Example Application

This bundle includes a modified version of the HelloWorldApplication from Dropwizard's Getting Started documentation.

You can execute this application by first starting Zipkin on your local machine then running:

./mvnw clean package
java -jar zipkin-example/target/zipkin-example-*-SNAPSHOT.jar server zipkin-example/hello-world.yml

This will start the application on port 8080 (admin port 8180). This application demonstrations the following Zipkin integration points:

  • You can use the included ZipkinClientBuilder to construct an instrumented JerseyClient's that will send span traces to Zipkin
  • The service will send request and response traces to Zipkin

Support

Please file bug reports and feature requests in GitHub issues.

License

Copyright (c) 2020 Smoke Turner, LLC

This library is licensed under the Apache License, Version 2.0.

See http://www.apache.org/licenses/LICENSE-2.0.html or the LICENSE file in this repository for the full license text.

com.smoketurner.dropwizard

Smoke Turner, LLC

Versions

Version
2.0.16-1
2.0.12-1
2.0.10-1
2.0.0-1
1.3.15-1
1.3.12-4
1.3.12-3
1.3.12-1
1.3.9-1
1.3.8-1
1.3.7-3
1.3.7-2
1.3.7-1
1.3.5-5
1.3.5-4
1.3.5-3
1.3.5-2
1.3.5-1
1.3.4-2
1.3.4-1
1.3.2-2
1.3.2-1
1.3.1-1
1.3.0-1
1.2.4-2
1.2.4-1
1.2.3-3
1.2.3-2
1.2.3-1
1.2.2-4
1.2.2-3
1.2.2-2
1.2.2-1
1.2.0-1
1.1.0-2
1.1.0-1
1.0.6-1
1.0.5-4
1.0.5-3
1.0.5-2
1.0.5-1
1.0.3-2
1.0.3-1
1.0.2-4
1.0.2-3
1.0.2-2
1.0.2-1
1.0.1-1
1.0.0-2
1.0.0-1
0.9.3-3
0.9.3-2
0.9.3-1
0.9.2-9
0.9.2-8
0.9.2-7
0.9.2-6
0.9.2-5
0.9.2-4