Giter Site home page Giter Site logo

openzipkin / brave-example Goto Github PK

View Code? Open in Web Editor NEW
209.0 209.0 139.0 617 KB

A collection of examples how to use brave instrumentation in various frameworks and libraries.

Home Page: https://gitter.im/openzipkin/zipkin

License: Apache License 2.0

Java 73.31% Dockerfile 1.87% Shell 24.82%
brave distributed-tracing openzipkin zipkin

brave-example's People

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  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  avatar  avatar

Watchers

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

brave-example's Issues

Unit test failed: ITZipkinSpanCollector.testOfferTimeOut:101 ╗ TTransport Could not create Serve...

Module brave-zipkin-spancollector gives error in unit test while building via mvn clean install


Tests run: 2, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 13.384 sec <<< FAILURE!
testOfferTimeOut(com.github.kristofa.brave.zipkin.ITZipkinSpanCollector) Time elapsed: 0.006 sec <<< ERROR!
org.apache.thrift.transport.TTransportException: Could not create ServerSocket on address 0.0.0.0/0.0.0.0:9410.
at org.apache.thrift.transport.TNonblockingServerSocket.(TNonblockingServerSocket.java:89)
at org.apache.thrift.transport.TNonblockingServerSocket.(TNonblockingServerSocket.java:68)
at org.apache.thrift.transport.TNonblockingServerSocket.(TNonblockingServerSocket.java:61)
at com.github.kristofa.brave.zipkin.ZipkinCollectorServer.(ZipkinCollectorServer.java:32)
at com.github.kristofa.brave.zipkin.ITZipkinSpanCollector.testOfferTimeOut(ITZipkinSpanCollector.java:101)

Results :

Tests in error:
ITZipkinSpanCollector.testOfferTimeOut:101 ╗ TTransport Could not create Serve...

Tests run: 2, Failures: 0, Errors: 1, Skipped: 0

Zipkin brave and Kafka transports using XML

I have 3 projects, namely Project A which is the Data layer. Project B which acts as the rest client of Project A. Project C is a web application, having dependency as Project B. Built using Java and Spring mvc. Have configured all 3 projects as given in the example, and giving "zipkin:service" as "app". Built success on Maven and run on Tomcat using Eclipse. When seen from Zipkin UI, when a request is given from Project C, it shows traces coming from three different projects, and not as a single trace, going from Project C to Project A, thru Project B. What am I missing or should I be trying a different instrumentation for a project structure like this. Please help me.

Help needed on deploying this example for tomcat WITHOUT using PROFILES

I tried the example using Brave-zipkin[https://github.com/openzipkin/brave-webmvc-example/tree/master/webmvc3]. Everything looks fine for me.. except that, in the given example jetty server deploys the application twice, one for FrontEnd and another for Backend(using two profiles). Whereas I need to use tomcat-server without using any profiles.

Can anyone help me how to use this same tool for deploying in Tomcat-server and start the application without using profiles? kindly help

Help about Spring Boot Option ? it seems does not work

when i tried following the instructions in the introducation of webmvc4-boot, Backend and Frontend had different trace_id, by the way the webmvc4 works.

i did as follows:

  1. git clone https://github.com/openzipkin/brave-webmvc-example.git
  2. cd webmvc4-boot
  3. mvn compile exec:java -Dexec.mainClass=brave.webmvc.Backend
  4. mvn compile exec:java -Dexec.mainClass=brave.webmvc.Frontend
  5. java -jar zipkin.jar
  6. curl -s localhost:8081 -H'user-name: JC'

The Result :
brave.webmvc.Frontend : [de8e059e2458c13a/de8e059e2458c13a]
brave.webmvc.Backend : [5762ebf5fd9fcb52/5762ebf5fd9fcb52]

is there anything wrong? Thanks.

I got several questions about trace wanna discuss with you.

hi, me again :)
I used brave-resteasy-example to build a trace demo, after run them, I try to understand the data struce, so i looking into database.

table_zipkin_spans.

span_id parent_id trace_id span_name debug duration
-1015356763606953178 -7464383308562486440 -7464383308562486440 /brave-resteasy-example/b 0 888000
-1015356763606953178 -7464383308562486440 -7464383308562486440 /RestEasyTest/brave-resteasy-example/b 0 896000
-7464383308562486440 -7464383308562486440 /brave-resteasy-example/a 0 956000

I have some questions blow.
1.I got three spans, one for a, and two for b, and there are two annotations (sr,ss)
) for a, and four annotation(cs,sr,ss,cr) for b. I guess you put the cs and cr annotation that occured by call a->b into span b.

2.why does the same spans b has two different span names (/brave-resteasy-example/b and /RestEasyTest/brave-resteasy-example/b)?

3.It seams like the dependencies tab not working. so I build my own test datas several times, and insert them into database, the only date that works fine lists below.

span_id parent_id trace_id span_name duration annotations
1 10 a 10000 sr,cr,cs,ss
2 1 10 b 9500 sr,ss

a.one name for one host.
b.one span for one host.(if not, e.g. host b have two spans with same span id(id=2), and this span id(id=2) associated with four annotations(sr,cr,cs,ss), in zipkin front UI these four annotations would be display twice for span b, that would be eight annotations)
c.host always have server part annotations(if don't have one, zipkin will make fake one), but client part annotations is not always needed.

If I generated two spans for one host, the only way avoid double annotations is like you did above, to give them different span name. but which name will be displayd in front is not so sure.

convert this project to normal webmvc and rest template

We get questions more frequently on normal spring and anecdotally I don't recall any questions about resteasy. It seems more bang for the buck to make this repository use vanilla spring web mvc servlet -> rest template.

If I get a couple people saying do it, I'll do it and rename it to brave-webmvc-example similar to https://github.com/openzipkin/sleuth-webmvc-example except not requiring spring boot (as some have mentioned they aren't running boot)

Extend example with ZipkinSpanCollector

Add dependency and code to make use of Zipkin server vs logging spans into console. This logic is not enabled by default but it can be easily enabled. Could be very helpful to quickly ramp up with Zipkin.

The project can't be build with jdk8

This project can't be build on jdk8 when running mvn jetty:run -Pfrontend:

[WARNING] Rule 0: org.apache.maven.plugins.enforcer.RequireJavaVersion failed with message:
Detected JDK Version: 1.8.0-202 is not in the allowed range [1.7,1.8).

my jdk version is:

➜  webmvc25 git:(master) ✗ java -version
java version "1.8.0_212"
Java(TM) SE Runtime Environment (build 1.8.0_212-b31)
Java HotSpot(TM) GraalVM EE 19.0.0 (build 25.212-b31-jvmci-19-b01, mixed mode)

A quick work around is changing the pom.xml:

                <requireJavaVersion>
                  <version>1.7</version> // before is [1.7, 1.8)
                </requireJavaVersion>

How to log the parentSpanId?

seems below config parentSpanId doesn't work:
%d{ABSOLUTE} [%X{traceId}/%X{spanId}/%X{parentSpanId}] %-5p [%t] %C{2} - %m%n

Rename repo to brave-example and start publishing docker test images

Let's rename this repo to "brave-example" and allow other non-MVC examples inside.

This is an alternative to making a lot of repos based on example type (ex grpc vs spring). In other words, this should result in deleting https://github.com/openzipkin/brave-grpc-example or moving it to the attic

A macro-repo which covers different instrumentation will be similar to how the parent repo does. This can happen even if the MVC example is a primary choice for people getting started in Java.

Doing so would be similar to zipkin-js-example which includes two completely different examples inside (react-native and web).

It will also make docker slightly more coherent. The example image for brave would be "openzipkin/example-brave" with a tag describing which example it is.

Ex. openzipkin/example-brave:webmvc4-boot image would correspond to the webmvc4-boot directory here.

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.