question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

There are a number of zipkin libraries supporting local tracing (operations that spawn in-process and are not RPCs).

We’ve recently had a request by @wirehead for how to do this.

// Is this how I'm supposed to instrument a long-running function?
function ExampleTraceFunction() {
  tracer.setId(tracer.createRootId());
  tracer.recordMessage('start');
  // do stuff here
  tracer.recordMessage('end');
}

workaround

I suggested a workaround, which is to use Client annotations while we figure out how we want to address this here.

function ExampleTraceFunction() {
  tracer.scoped(() => {
    tracer.setId(tracer.createRootId());
    tracer.recordAnnotation(new Annotation.ClientSend());

    // do work

    tracer.recordAnnotation(new Annotation.ClientRecv());
  });
}

There’s a background issue in finagle which might steer implementation. https://github.com/twitter/finagle/issues/541

cc @fedj

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
eirslettcommented, May 2, 2017

We can do something like

const result = tracer.local('myoperation', () => {
  return someComputation();
});

then you’re guaranteed that start() and finish() will be called correctly.

0reactions
codefromthecryptcommented, Nov 21, 2017

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Case Investigation and Contact Tracing : Part of a ... - CDC
Case investigation and contact tracing, a core disease control measure employed by local and state health department personnel for decades, ...
Read more >
Evaluating the impact of local tracing partnerships on ... - arXiv
We use the proposed approach to evaluate the impact that local tracing partnerships (LTP) had on the effectiveness of England's Test and ...
Read more >
State Approaches to Contact Tracing during the COVID-19 ...
The CDC Foundation supports recruitment for the contact tracing workforce. The state and local health departments perform contact tracing. AR ...
Read more >
What is Contact Tracing?
You may be asked to speak with a contact tracer or answer questions in a survey sent to you by text message from...
Read more >
Local Government COVID-19 Contact Tracing Guidance
For these reasons, local governments are strongly encouraged to utilize CARES Act funding to support contact tracing efforts by their local public health ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found