Comments (11)
We can do something like
const result = tracer.local('myoperation', () => {
return someComputation();
});
then you're guaranteed that start() and finish() will be called correctly.
from zipkin-js.
FWIW, here's a proposal I made in finagle a while back. I didn't implement it because there weren't enough people engaged on the topic. You know me.. rule-of-three
tracer.recordAnnotation(new Annotation.Start())
tracer.recordAnnotation(new Annotation.Operation(spanName))
tracer.recordAnnotation(new Annotation.Finish())
// or on abend
tracer.recordAnnotation(new Annotation.Error(message))
from zipkin-js.
works for me. @wirehead @fedj others.. any opinions?
from zipkin-js.
@adriancole Thanks for linking this issue, but I am unable to guess the usage from this conversation as I don't know what was implemented and what was just a suggestion. Is there a piece of documentation on how to use this and when? Is it for every action that is not causing an HTTP request?
from zipkin-js.
It was never implemented, just a sketch. You could use it for actions that cause HTTP requests as well, it could work with promises.
from zipkin-js.
So only the workaround is currently possible?
from zipkin-js.
from zipkin-js.
as promised #156
from zipkin-js.
couple things to consider before merge. Please comment within the next couple days if you can, as we should do a release soon.
- Maybe we should add a constructor parameter in Tracer for the local endpoint.
This can reduce duplication in all the instrumentation where we keep passing serviceName (and sometimes get it wrong). Most importantly here, we can attach a local endpoint to the span so that you can look it up (most importantly you can attach it without the user having to pass it around).
I would offer to add a constructor and backport all the instrumentation libraries to default to the tracer's localEndpoint. This would essentially deprecate having to pass serviceName
at each instrumentation point. I'd merge that prior to the local tracing one, so that I can reuse it there.
- Maybe we should rename
Tracer.local
toTracer.wrap(callable)
orTracer.recordingCallable(callable)
Tracer.recordDuration(callable)
or something..
Reason is all the operations in tracer are prefixed record
. local
as a keyword still makes sense to me, just some final notes prior to merge
from zipkin-js.
Added #159 which is the minimum change besides the main PR. This centralizes assignment of the local service name (similar to how is done in brave). feedback welcome
from zipkin-js.
ok ready to merge #156.. last warning :)
this keeps Tracer.local as a keyword that means "trace this callable" as no-one seems bothered about it.
from zipkin-js.
Related Issues (20)
- Add Propagation interface HOT 13
- 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.