All Projects → openzipkin → Brave Example

openzipkin / Brave Example

Licence: apache-2.0
A collection of examples how to use brave instrumentation in various frameworks and libraries.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Brave Example

Spring Cloud Sleuth
Distributed tracing for spring cloud
Stars: ✭ 1,531 (+839.26%)
Mutual labels:  distributed-tracing, zipkin
Opencensus Go
A stats collection and distributed tracing framework
Stars: ✭ 1,895 (+1062.58%)
Mutual labels:  distributed-tracing, zipkin
Zipkin Go Opentracing
OpenTracing Bridge for Zipkin Go
Stars: ✭ 472 (+189.57%)
Mutual labels:  distributed-tracing, zipkin
gateway
A proxy to buffer and forward metrics, events, and traces.
Stars: ✭ 94 (-42.33%)
Mutual labels:  zipkin, distributed-tracing
Zipkin Armeria Example
Example project that shows how to use armeria and zipkin together
Stars: ✭ 17 (-89.57%)
Mutual labels:  distributed-tracing, zipkin
pitchfork
Convert tracing data between Zipkin and Haystack formats
Stars: ✭ 40 (-75.46%)
Mutual labels:  zipkin, distributed-tracing
Docker Zipkin
Docker images for OpenZipkin
Stars: ✭ 639 (+292.02%)
Mutual labels:  distributed-tracing, zipkin
haystack-docker
Repository with docker-compose files to start Haystack components in sandbox
Stars: ✭ 17 (-89.57%)
Mutual labels:  zipkin, distributed-tracing
Loki
Loki: Simple, Distributed Tracing
Stars: ✭ 127 (-22.09%)
Mutual labels:  distributed-tracing, zipkin
Grpc By Example Java
A collection of useful/essential gRPC Java Examples
Stars: ✭ 709 (+334.97%)
Mutual labels:  distributed-tracing, zipkin
easeagent
An agent component for the Java system
Stars: ✭ 437 (+168.1%)
Mutual labels:  zipkin, distributed-tracing
Brave Opentracing
Bridge between OpenTracing and Brave
Stars: ✭ 64 (-60.74%)
Mutual labels:  distributed-tracing, zipkin
dropwizard-zipkin
Dropwizard Zipkin Bundle
Stars: ✭ 48 (-70.55%)
Mutual labels:  zipkin, distributed-tracing
Zipkin Go
Zipkin tracer library for go
Stars: ✭ 435 (+166.87%)
Mutual labels:  distributed-tracing, zipkin
zipkin-php-example
See how much time php services spend on an http request
Stars: ✭ 52 (-68.1%)
Mutual labels:  zipkin, distributed-tracing
Zipkin Js
Zipkin instrumentation for Node.js and browsers
Stars: ✭ 489 (+200%)
Mutual labels:  distributed-tracing, zipkin
Opencensus Node
A stats collection and distributed tracing framework
Stars: ✭ 249 (+52.76%)
Mutual labels:  distributed-tracing, zipkin
opentracing-istio-troubleshooting
Tackle the challenge of observability in a Kubernetes application that consists of multiple microservices running in the Open Liberty application server.
Stars: ✭ 16 (-90.18%)
Mutual labels:  zipkin, distributed-tracing
Opencensus Java
A stats collection and distributed tracing framework
Stars: ✭ 640 (+292.64%)
Mutual labels:  distributed-tracing, zipkin
Sttp
The Scala HTTP client you always wanted!
Stars: ✭ 1,078 (+561.35%)
Mutual labels:  distributed-tracing, zipkin

Basic example showing distributed tracing across Java applications

This is an example app where two Java services collaborate on a request.

Notably, these services send data to Zipkin, a distributed tracing system. Zipkin allows you to see the how long the operation took, as well how much time was spent in each service.

Here's an example of what it looks like:

zipkin screen shot

Implementation Overview

This example has two services: frontend and backend. Both are instrumented to send tracing data to a third service Zipkin. Brave performs this function.

Running the example

To setup the demo, you need to start Frontend, Backend and Zipkin. You can do this using Java commands or Docker.

Once the services start, open http://localhost:8081/

Afterwards, you can view traces that went through the backend via http://127.0.0.1:9411/zipkin?serviceName=backend

  • This is a locally run zipkin service which keeps traces in memory

Tips

There are some interesting details that apply to all examples:

  • If you pass the header user_name Brave will automatically propagate it to the backend!
    • curl -s localhost:8081 -H'user_name: JC'
  • The below Logback pattern adds trace and span identifiers into log output
    • %d{HH:mm:ss.SSS} [%thread] [%X{userName}] [%X{traceId}/%X{spanId}] %-5level %logger{36} - %msg%n

Example projects

Here are the example projects you can try:

Starting the services with Docker

Docker Compose is the easiest way to start.

Just run docker-compose up.

Armeria starts by default. To use a different version of the project, set the VERSION variable.

Ex. VERSION=webmvc25-jetty docker-compose up

Starting the services from source

When not using Docker, you'll need to start services according to the frameworks used.

First, start Zipkin. This stores and queries traces reported by the example services.

Starting Zipkin with Java:

curl -sSL https://zipkin.io/quickstart.sh | bash -s
java -jar zipkin.jar

Java

In a separate tab or window, start each of brave.example.Frontend and brave.example.Backend.

Ex.

$ cd armeria
$ mvn compile exec:java -Dexec.mainClass=brave.example.Backend
$ mvn compile exec:java -Dexec.mainClass=brave.example.Frontend

Servlet

In a separate tab or window, start a Jetty container for "backend" and "frontend".

Ex.

$ cd webmvc4-jetty
$ mvn jetty:run -Pfrontend
$ mvn jetty:run -Pbackend
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].