Giter VIP home page Giter VIP logo

dapr_trace_trying's Introduction

test dapr's distributed tracing between two services.

pre-requirments

run

run zipkin

docker run -d -p 9411:9411 openzipkin/zipkin

run service1, service2

in service1

dapr run --app-id service1 --app-port 3000 --port 3500 --config ./components/tracing.yaml  node app.js

in service2

dapr run --app-id service2 --app-port 3001 --port 3501 --config ./components/tracing.yaml  node app.js

test application

call service2 (other terminal)

POST http://localhost:3501/v1.0/invoke/service2/method/apply
{"name":"test"}

call service1 (service2 call via serivice1)

GET http://localhost:3500/v1.0/invoke/service1/method/hello

x-correlation-id propagation

if you need to continue tracing span following service, include x-correlation-id header in request.

sample is bellow.

    fetch(service2URL, {
        method: "POST",
        body: JSON.stringify({name:"service1"}),
        headers: {
            "content-type":"application/json"
            , "x-correlation-id" : req.headers["x-correlation-id"]
            }

if x-correlation-id does not include, new trace start in service2.

result is this.

splited trace

if x-correlation-id include in request, trace is single.

single trace

this is same limitaion in envoy (https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/observability/tracing#trace-context-propagation) but, dapr is simple because only propate x-correlation-id header only.

dapr_trace_trying's People

Contributors

kencharos avatar

Watchers

 avatar  avatar

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.