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.

Allow setting span start/end times explicitly

See original GitHub issue

We have a use case where the start/end times of traces is coming from an external system. We need to be able to explicitly set the times instead of the times automatically retrieved from the local clock.

The suggested change to the Span API is the following:

  1. Add void setStartTime(Timestamp startTimestamp) to Span.
  2. Add void end(EndSpanOptions options, Timestamp endTimestamp) to Span.

Here is the draft of proposed solution that I can turn into Pull Request if this issue is accepted:

https://github.com/census-instrumentation/opencensus-java/compare/master...tigrannajaryan:feature/tigran/span-times?expand=1

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:2
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
tigrannajaryancommented, May 16, 2019

I am constructing Spans, I didn’t consider creating SpanData directly. I can check that to see if it works for my use case.

For reference here is how I use this feature in my code currently:

Span span = tracer.spanBuilderWithExplicitParent(operationName, parentSpan).startSpan();
span.setStartTime(Timestamp.fromMicros(startTimeMicros));
span.end(EndSpanOptions.DEFAULT, Timestamp.fromMicros(endTimeMicros));
0reactions
tigrannajaryancommented, Jul 23, 2019

@MahatmaFatalError sorry, I no longer have that piece of code around to dig into it. I solved my problem in a different (unrelated) way, so can’t help much with this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

timechart - Splunk Documentation
When you specify a minspan value, the span that is used for the search must be equal to or greater than one of...
Read more >
opentelemetry.trace package
Each operation in a trace is represented by a Span , which records the start, end time, and metadata associated with the operation....
Read more >
grid-column - CSS: Cascading Style Sheets - MDN Web Docs
The grid-column CSS shorthand property specifies a grid item's size and location within a grid column by contributing a line, a span, ...
Read more >
Structural markup and right-to-left text in HTML - W3C
In HTML the base direction is either (a) set explicitly by the nearest ... Add dir="rtl" to the html tag any time the...
Read more >
Just-in-Time Mode - Tailwind CSS
Enabling JIT mode. To enable just-in-time mode, set the mode option to 'jit' in your tailwind.config.js file: // tailwind.config.js module.exports = { + ......
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