Skip to content

Example application to demonstrate opentracing idea (on the example of Jaeger).

Notifications You must be signed in to change notification settings

padys/opentracing-tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

7fc5805 · Mar 9, 2021

History

4 Commits
Mar 8, 2021
Mar 7, 2021
Mar 7, 2021
Mar 9, 2021
Mar 7, 2021
Mar 7, 2021

Repository files navigation

OPENTRACING-TUTORIAL

Simple application to fiddle with opentracing idea. Start the same application on different ports to create clients and APIs. Call client endpoint and trace the chain of API requests.

What do you need?

Preferably the linux OS machine with:

  1. docker
  2. nodejs/npm
  3. git
  4. curl (or other "web browser")

How to start?

  1. Download this project:
    $ git clone https://github.com/padys/opentracing-tutorial.git
    
  2. Install required libs:
    $ cd opentracing-tutorial
    $ npm install
    
  3. Run Jaeger all-in-one package using docker:
    $ docker run -d --name jaeger \​
      -p 5775:5775/udp \​
      -p 6831:6831/udp \​
      -p 6832:6832/udp \​
      -p 5778:5778 \​
      -p 16686:16686 \​
      -p 14268:14268 \​
      -p 14250:14250 \​
      -p 9411:9411 \​
      jaegertracing/all-in-one:latest​
    

How to play?

  1. Run project in three separate terminals.

    first terminal:

    $ cd opentracing-tutorial
    $ npm run start0
    

    second terminal:

    $ cd opentracing-tutorial
    $ npm run start1
    

    third terminal:

    $ cd opentracing-tutorial
    $ npm run start2
    

    It launches HTTP servers respectly on ports 8080, 8081 and 8082. Check earlier if that ports are not already used!

  2. Open http://127.0.0.1:8080/success_success_success using curl or any web browser:

    $ curl -H "jaeger-debug-id: some-correlation-id" http://127.0.0.1:8080/success_success_success
    

    TIP: You should see some logs in yours three terminals...

  3. Open Jaeger-UI client app in web browser (http://localhost:16686/search​), to see the chain of requests.

  4. Feel free to call other endpoints and modify the code!

    For example, try comment lines tracer.inject(...) or launch http://127.0.0.1:8080/success_error. Do you see difference in Jaeger-UI diagrams? Look at sent headers, baggages in console logs...

Useful links:

About

Example application to demonstrate opentracing idea (on the example of Jaeger).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published