Coder Social home page Coder Social logo

local tracing about zipkin-js HOT 11 CLOSED

openzipkin avatar openzipkin commented on June 19, 2024
local tracing

from zipkin-js.

Comments (11)

eirslett avatar eirslett commented on June 19, 2024 4

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.

codefromthecrypt avatar codefromthecrypt commented on June 19, 2024

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.

codefromthecrypt avatar codefromthecrypt commented on June 19, 2024

works for me. @wirehead @fedj others.. any opinions?

from zipkin-js.

DanielMSchmidt avatar DanielMSchmidt commented on June 19, 2024

@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.

eirslett avatar eirslett commented on June 19, 2024

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.

DanielMSchmidt avatar DanielMSchmidt commented on June 19, 2024

So only the workaround is currently possible?

from zipkin-js.

codefromthecrypt avatar codefromthecrypt commented on June 19, 2024

from zipkin-js.

codefromthecrypt avatar codefromthecrypt commented on June 19, 2024

as promised #156

from zipkin-js.

codefromthecrypt avatar codefromthecrypt commented on June 19, 2024

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 to Tracer.wrap(callable) or Tracer.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.

codefromthecrypt avatar codefromthecrypt commented on June 19, 2024

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.

codefromthecrypt avatar codefromthecrypt commented on June 19, 2024

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)

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.