Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds LocalTracer, designed for in-process activity that explains latency #112

Merged
merged 1 commit into from
Nov 21, 2015

Conversation

codefromthecrypt
Copy link
Member

A local span can represent bootstrap, codec, file i/o or other activity
that notably impacts performance.

Local spans always have a binary annotation "lc" which indicates the
component name. Usings zipkin's UI or Api, you can query by for spans
that use a component like this: lc=spring-boot

Here's an example of allocating precise duration for a local span:

tracer.startSpan("codec", "encode");
try {
  return codec.encode(input);
} finally {
  tracer.finishSpan();
}

Fixes #111
See openzipkin/zipkin#821

Another example: Local span where user does know about time and duration, such as recording events that already occurred:

if (localTracer.startSpan("spring-boot", "bootstrap", startTimestamp) != null) {
  // log historical annotations/binary annotations only if we know the trace was sampled
  localTracer.finishSpan(duration);
}

@codefromthecrypt codefromthecrypt force-pushed the local-span branch 3 times, most recently from f8d6944 to 17e7115 Compare November 20, 2015 21:46
A local span can represent bootstrap, codec, file i/o or other activity
that notably impacts performance.

Local spans always have a binary annotation "lc" which indicates the
component name. Usings zipkin's UI or Api, you can query by for spans
that use a component like this: `lc=spring-boot`

Here's an example of allocating precise duration for a local span:
```java
tracer.startSpan("codec", "encode");
try {
  return codec.encode(input);
} finally {
  tracer.finishSpan();
}
```

Fixes #111
See openzipkin/zipkin#821
@codefromthecrypt codefromthecrypt changed the title Adds LocalTracer Adds LocalTracer, designed for in-process activity that explains latency Nov 20, 2015
@codefromthecrypt
Copy link
Member Author

@kristofa PTAL I'm done I think :)

@kristofa
Copy link
Member

@adriancole Thank you! LGTM!

kristofa added a commit that referenced this pull request Nov 21, 2015
Adds LocalTracer, designed for in-process activity that explains latency
@kristofa kristofa merged commit 8e8830c into master Nov 21, 2015
@kristofa kristofa deleted the local-span branch November 21, 2015 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants