Comments (13)
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.
@jcchavezs, not enough time 😞, just waiting to have a little of free time to work in this!!😉
from zipkin-js.
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.
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.
@asanluis do you need any further help on this one?
from zipkin-js.
@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.
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.
from zipkin-js.
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.
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.
@jcchavezs have you had time to review it?
from zipkin-js.
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.
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)
- Trace ID not Maintained over Multiple Service Hops with Express/Fetch HOT 2
- Allow adding arbitrary tags on span HOT 1
- gotjs intrumentation is not working HOT 3
- Makes HttpLogger flushable and/or sync optionally HOT 2
- node-fetch is listed as devDependency but it is required as the default fetch HOT 1
- Instrumentations multiple instances HOT 1
- isOptional and Related checks are wrong and breaks compatibility between versions HOT 5
- ES6 import doesn't work with 'zipkin-context-cls' HOT 1
- Migrate to Github Actions
- Switch CI to GitHub actions HOT 3
- Does zipkin support grpc server in javascript now?
- How to pass custom header in zipkin with multi-service request
- zipkin-instrumentation-axiosjs not preserving traceId HOT 1
- Integration with NextJs
- Separate Trace is getting created in case of wrapping Axios Client HOT 1
- zipkin-cls-context test can't passed
- zipkin-js doesn't work with last versions of create-react-app (react-scripts) 5 or webpack 5
- Missing parent link
- Help with "exclude urls" in HttpLogger of zipkin-transport-http
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zipkin-js.