smoketurner / dropwizard-zipkin Goto Github PK
View Code? Open in Web Editor NEWDropwizard Zipkin Bundle
License: Apache License 2.0
Dropwizard Zipkin Bundle
License: Apache License 2.0
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?
Can this library be extended to send spans for nested method calls?
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!)
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.
Try to get the serviceHost and servicePort when Jetty is started
Is it possible to set Zipkin base path url in the configuration?
Upgrade to Brave 5.9.2 or later to bring in the fix for openzipkin/brave#1045
5.10.1 is the latest version
Brave has a feature where you can extend FinishedSpanHandler and use it to customise spans. It can be used for things like redaction of sensitive data in HTTP paths.
As far as I can see, there are no Java 8 spefific features here.
Currently there is a bug on handling http.route for async resources as mentioned here openzipkin/brave#715. And They just fixed it in Brave 5.1.0 ! Can we upgrade to it ? @jplock
The readme example of setting up brave client doesn't match the java-example. The move to httptracing object is done in the example but not on the home readme
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>
Below image using,
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka-clients</artifactId>
<version>3.2.3</version>
</dependency>
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
As I know, we can use one of the logging plugins from here
https://github.com/openzipkin/brave/tree/master/context
and configure log format like so
https://github.com/openzipkin/brave-webmvc-example/blob/master/webmvc4/src/main/resources/log4j2.properties#L5
to enable putting trace id into logs.
Does dropwizard-zipkin support it ?
Brave provides a "HttpRuleSampler" for configuring per-operation sampling strategy. For example, health check requests are usually noisy and I want to exclude them out, and I can do
httpTracingBuilder.serverSampler(HttpRuleSampler.newBuilder()
.addRule(null, "/healthcheck", 0.0f)
.build());
As mentioned here: https://github.com/openzipkin/brave/tree/master/instrumentation/http#sampling-policy
Looks like dropwizard-zipkin has not supported it yet. Can we add it ?
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)
While nothing in code or docs makes me thing we support jdbi, worth to ask and also ask if this is something desirable.
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.
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);
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.
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));
`
Currently this library doesn't seem to support custom retry handling. Would be great if this was added.
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
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 ?
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.
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?
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 ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.