Coder Social home page Coder Social logo

smoketurner / dropwizard-zipkin Goto Github PK

View Code? Open in Web Editor NEW
50.0 7.0 25.0 3.25 MB

Dropwizard Zipkin Bundle

License: Apache License 2.0

Shell 1.02% Java 98.98%
zipkin dropwizard dropwizard-zipkin java tracing instrumentation distributed-tracing zipkin-brave

dropwizard-zipkin's People

Contributors

adriancole avatar dennyac avatar dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar jplock avatar pavolloffay avatar reftel avatar rieske avatar spikhalskiy avatar spudone avatar xihw avatar ygaller avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

dropwizard-zipkin's Issues

LoggingZipkinFactory Missing

In the latest release (coupled with dropwizard 1.2.0), the class LoggingZipkinFactory is no longer present. It is, however, still listed in META-INF/services as an available factory. Is this meant to be replaced by ConsoleZipkinFactory, or is there a a separate issue?

Add resource exclusions

We have various status endpoints on our applications which I'd love to be able to exclude. Do you have a recommended way to achieve this? Perhaps some exclusions could be included in the config?

e.g.

...
exclude:
   -  */somecheck/*
   -  */someothercheck/

(Great job btw!)

AbstractZipkinFactory should allow configurable Sampler

buildBrave in AbstractZipkinFactory currently calls Sampler.create(sampleRate), which uses CountingSampler.

This is insufficient for high traffic sites as it puts a floor of .01 (1%) on the sampleRate. An option to pass in a specific Sampler implementation, rather than the sample rate alone, would be useful. For example, BoundarySampler allows more granularity.

High CPU usage when using kafka-clients:3.3.1

Hi,

We have a Dropwizard app (dropwizard-core:2.1.4) which uses zipkin-core:2.0.16-1 with 'kafka' collector. When using it along kafka-clients:3.3.1 we are able to see a high CPU usage but the same behaviour does not apply when using kafka-clients:3.2.3.
On using a profiler we are able to see a worker thread stuck in Runnable state forever and is not going to the waiting state after the traces are published. The thread goes to Runnable state and stuck there forever when an initial API request hits one of our endpoints. JDK used is Corretto 17.0.5

Below image using,

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

image

Below image using,

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

image

Can you help in shedding some light on this or can it be taken as bug?
If it is not a bug can I get some compatibility matrix for dropwizard-zipkin bundle with kafka-clients?

Regards,
Kishore

cannot change serviceName in zipkinClient configuration

serviceName is required for zipkinClient configuration. When I tried to change serviceName in zipkin-example configuration (hello-world.yml), this name wasn't changed in application. I tried to debug this issue and noticed that this value was overrided at runtime with Environment.name value. (We defined this value when overrided getName() method in zipkin-example HelloWorldApplication class)

Automatically call build from run

Presently, the application is supposed to call build on the zipkin bundle from within its run method. That means that the zipkin bundle's build method gets called after the run methods of all other bundles have been called, so it's therefore not possible for them to access the HttpTracing instance from there. That makes it complicated to add tracing to requests made from bundles.
If the run method of the zipkin bundle would instead itself call build, and store the result in a field with a getter, then by adding the zipkin bundle first, and arranging to have the bundles that want to trace get a reference to the zipkin bundle, one could let those bundles ask for the HttpTracing instance from their run methods, and use that to configure their clients.

Failing Example

Tried the example. It is failing. Please advise:

$ java -jar target/zipkin-example-1.0.3-3-SNAPSHOT.jar server
Exception in thread "main" java.lang.IllegalArgumentException: No serializer found for class com.github.kristofa.brave.Sampler$1 and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) ) (through reference chain: com.example.helloworld.HelloWorldConfiguration["zipkin"]->com.smoketurner.dropwizard.zipkin.LoggingZipkinFactory["sampler"])
	at com.fasterxml.jackson.databind.ObjectMapper.valueToTree(ObjectMapper.java:2591)
	at io.dropwizard.configuration.YamlConfigurationFactory.build(YamlConfigurationFactory.java:105)
	at io.dropwizard.cli.ConfiguredCommand.parseConfiguration(ConfiguredCommand.java:126)
	at io.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:72)
	at io.dropwizard.cli.Cli.run(Cli.java:75)
	at io.dropwizard.Application.run(Application.java:79)
	at com.example.helloworld.HelloWorldApplication.main(HelloWorldApplication.java:32)
Caused by: com.fasterxml.jackson.databind.JsonMappingException: No serializer found for class com.github.kristofa.brave.Sampler$1 and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) ) (through reference chain: com.example.helloworld.HelloWorldConfiguration["zipkin"]->com.smoketurner.dropwizard.zipkin.LoggingZipkinFactory["sampler"])
	at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:270)
	at com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.failForEmpty(UnknownSerializer.java:68)
	at com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.serialize(UnknownSerializer.java:32)
	at com.fasterxml.jackson.module.afterburner.ser.ObjectMethodPropertyWriter.serializeAsField(ObjectMethodPropertyWriter.java:87)
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:678)
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeWithType(BeanSerializerBase.java:569)
	at com.fasterxml.jackson.module.afterburner.ser.ObjectFieldPropertyWriter.serializeAsField(ObjectFieldPropertyWriter.java:89)
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:678)
	at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:157)
	at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:130)
	at com.fasterxml.jackson.databind.ObjectMapper.writeValue(ObjectMapper.java:2444)
	at com.fasterxml.jackson.databind.ObjectMapper.valueToTree(ObjectMapper.java:2586)

Disabling FAIL_ON_EMPTY_BEANS has no affect.

environment.getObjectMapper().disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);

Is it possible to make HttpTracing singleton ?

HttpTracing instance is usually used as a singleton across the application, does it make sense to add a singleton utility for it in this repo? Otherwise we always have to pass the instance around or maintain the singleton by our own in many different places.

Submit Binary Annotation

Hi all,
I am having trouble submitting binary annotations in drowpwizard application.
I tried using following code in run method:
`

    Brave brave = configuration.getZipkinFactory().build(environment);

    final Client client = new ZipkinClientBuilder(environment, brave).build(configuration.getZipkinClient());

    brave.serverSpanAnnotationSubmitter().submitBinaryAnnotation("Key_test","value_test");
    environment.jersey().register(new LearnDWResource(client));
`

serviceName in ZipkinClientConfiguration is unused

The line httpTracing = httpTracing.clientOf(remoteServiceName) in ZipkinClientBuilder::using has no effect. When we call setApacheHttpClientBuilder in the ZipkinClientBuilder constructor, TracingHttpClientBuilder.create(httpTracing) has its own copy of httpTracing. So whatever serverName is present in httpTracing during construction is used.

Can be reproduced by running any Integration test that boots up the dropwizard app and adding a breakpoint at return TracingHttpClientBuilder.create(httpTracing); in ZipkinClientBuilder constructor and check value of serverName on httpTracing

Any thoughts on how you would want to address this? Happy to create a PR for it.

Created a PR to fix it in zipkin-example #124

Support @Priority annotation

I have a chain of filters in addition to the brave filters in my DW servers. These also connect to other services (for authorization etc). In order to get the timing right, I would like the Brave request filter to be the first in the request processing chain, and the response filter to be the last. For the client filters, I achive this by subclassing the brave filters, supplying a @priority annotation in the subclass. Not sure what would be the best way of supporting this in the Zipkin bundle ? Maybe a couple of extra arguments to the build method, where the class names of the subclasses can be provided ?

tracing downstream services

Hi,
Does this library support tracing downstream services? As mentioned in the zipkin docs:

If the service calls out to a downstream service a new span is created as a child of the former span. It is identified by the same trace id, a new span id, and the parent id is set to the span id of the previous span.
Note This process must be repeated if the service makes multiple downstream calls. That is each subsequent span will have the same trace id and parent id, but a new and different span id.

Does this work out of the box or do I have to make some changes to my code?

Thanks.

Add support for Kafka with SASL authentication

I need to connect to Kafka with SASL authentication. This requires configuring several producer configs (security.protocol, sasl.mechanism, sasl.jaas.config) https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-quickstart-kafka-enabled-event-hubs#send-and-receive-messages-with-kafka-in-event-hubs. Is this something that seems worth adding? I have a branch with the change ready to go, but don't have permission push my branch.

Also when I mvn clean package, it builds successfully, but I notice the last few commits to master don't pass in Travis. Is it a Travis issue?

Brave 4

Disclaimer ; Still learing this, so I may be totally off the mark here.
But from this link I understand that one a can get from brave4 to brave3 through an adapter:
https://groups.google.com/forum/#!topic/zipkin-user/TfRHcJjKGzk

Would it not be better, moving forward, to have the ZipkinFactory#build method of this bundle return a Tracer and not a Brave object ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.