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

Set span start and end timestamps #98

Merged
merged 2 commits into from
Jun 9, 2020

Conversation

pyohannes
Copy link
Contributor

This adds SDK support for setting start and end timestamps on spans.

  1. The API is extended to allow for specifying end timestamps manually.
  2. Comparison operators to SystemTimestamp and SteadyTimestamp are added.
  3. The Span implementation in the SDK is updated to use given timestamps or calculate timestamps based on the current time.

Copy link
Member

@reyang reyang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@@ -39,7 +39,7 @@ class Span final : public trace::Span

void UpdateName(nostd::string_view name) noexcept override { span_->UpdateName(name); }

void End() noexcept override { span_->End(); }
void End(const trace::EndSpanOptions &options = {}) noexcept override { span_->End(options); }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason we have different structures for StartSpanOptions and EndSpanOptions?

Would it make sense to have one common options class, such as SpanOptions ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The intent behind this design is to make it very clear to the API user which option can be set at which time (at start and end).

This also reflects the OpenTracing API, which provides FinishSpanOptions and StartSpanOptions.

@reyang
Copy link
Member

reyang commented Jun 8, 2020

@pyohannes please rebase, thanks.

@pyohannes
Copy link
Contributor Author

@reyang This is rebased now.

@reyang reyang merged commit 58736f0 into open-telemetry:master Jun 9, 2020
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.

3 participants