Coder Social home page Coder Social logo

Add Propagation interface about zipkin-js HOT 13 OPEN

asanluis avatar asanluis commented on July 18, 2024 2
Add Propagation interface

from zipkin-js.

Comments (13)

asanluis avatar asanluis commented on July 18, 2024 1

Yeah, i'm going to try 😅😁!!!! When i have something i'll open a PR and wait the feedback. Thanks as always!!!

from zipkin-js.

asanluis avatar asanluis commented on July 18, 2024 1

@jcchavezs, not enough time 😞, just waiting to have a little of free time to work in this!!😉

from zipkin-js.

jcchavezs avatar jcchavezs commented on July 18, 2024

That is actually something desirable! This library does not have interfaces for propagation so it would be great to start one. Notice that currently, all the HTTP server instrumentation includes a function called readHeader in the recordRequest whose aim is to extract the headers from the values from the headers. I guess maybe that was because of the lack of standard headers in node? (just guessing here).

IMHO the easiest is to deprecate that readHeader and either:
a) delegate the responsibility of such thing into the tracer (like zipkin-go does) when readHeader is not passed? Ideally Tracer and Propagation should be separated like in brave or zipkin-php but this alternative does not feel too bad.
b) If including extract/inject in the tracer is not acceptable, then probably we can inject the propagation object into httpInstrumentation (still we will have an abstraction to propagation but not inside the tracer) and to the extract from there.

For client it is easier, that piece is already abstracted under addZipkinHeaders so we just need to tweak it to align with other interfaces and make it pluggable.

Are you up to give a stab on this?

Thoughts @adriancole @anuraaga

from zipkin-js.

anuraaga avatar anuraaga commented on July 18, 2024

Interop is the name of the game, very happy to hear about adding support for more propagations.

Not familiar enough with the js codebase but b) feels a bit nicer if it's practical. But don't feel too strongly either way.

from zipkin-js.

jcchavezs avatar jcchavezs commented on July 18, 2024

@asanluis do you need any further help on this one?

from zipkin-js.

asanluis avatar asanluis commented on July 18, 2024

@jcchavezs Hi, I've not forgotten 😥 but now i have a little of free time, and i want to ask, if you guys like this approach

namespace propagation {
    interface Propagation {
      extractor<T>(readHeader: <T> (header: string) => option.IOption<T>): TraceId;
      injector<T, H>(req: T & { headers?: any }, traceId: TraceId): RequestZipkinHeaders<T, H>;
    }
    class B3Propagation implements Propagation {
      extractor<T>(readHeader: <T> (header: string) => option.IOption<T>): TraceId;
      injector<T, H>(req: T & { headers?: any }, traceId: TraceId): RequestZipkinHeaders<T, H>;
    }
  }

the extractor would be the actual _createIdFromHeaders of the HttpServer class, and the injector would be the actual Request.addZipkinHeaders.

from zipkin-js.

asanluis avatar asanluis commented on July 18, 2024

Hi guys, i finally made a different approach, i add the propagation into the tracer 😢 , not the best implementation, but i think is the best way to easily add the baggage feature. i'll wait your feedback guys, Thanks for all!! changes branch-master

from zipkin-js.

jcchavezs avatar jcchavezs commented on July 18, 2024

from zipkin-js.

jcchavezs avatar jcchavezs commented on July 18, 2024

Hi @asanluis thanks for bringing it up. I think the approach is correct, I'd encourage you to open a PR with the changes so I can give you some feedback!

from zipkin-js.

asanluis avatar asanluis commented on July 18, 2024

I finally made the PR, i have to work in the grpc client 😞

Edit i add a comment:
https://github.com/openzipkin/zipkin-js/pull/510/files#r465894515

from zipkin-js.

asanluis avatar asanluis commented on July 18, 2024

@jcchavezs have you had time to review it?

from zipkin-js.

jcchavezs avatar jcchavezs commented on July 18, 2024

Hi @asanluis I am sorry I did not come back to you earlier. Crazy days and a job switch in the middle. I am looking at it today and in general will have more time to spend on this. Stay tuned.

from zipkin-js.

asanluis avatar asanluis commented on July 18, 2024

Hi @jcchavezs thanks for the feedback 😄, I like the Java approach of Getter and Setter in the injectors/extractor methods i added here, now im working in the implementation.

What about if i change the implementation and decouple the propagation from the tracer, and maybe put it in the instrumentation?

from zipkin-js.

Related Issues (20)

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.