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

Remove SpanData #215

Merged
merged 15 commits into from
Sep 13, 2019
Merged

Remove SpanData #215

merged 15 commits into from
Sep 13, 2019

Conversation

bg451
Copy link
Member

@bg451 bg451 commented Aug 14, 2019

Motivation

The goal of this change is to remove SpanData from the API specification and replace it by adding span start and end options. SpanData, from what I could see, had two primary use cases in mind. The first involved building out of band spans from different sources such as logs. The second was to allow deferred span creation, for example, receiving the first byte in a request, taking the time of that, parsing the headers, then finally creating the span with that first byte timestamp.

Changes

References to SpanData have been removed.

For span start options, we are adding an optional timestamp to specify the start time, a resource to override the tracer's resource, and span ID to support out of band reporting.

For span end options, we are adding an optional timestamp to specify the end time.

Maybe it's out of scope for this specification change and i can remove it, but I've also added an optional timestamp when adding events to support out of band events as well. See #213 for an example use case.

Original RFC discussion: open-telemetry/oteps#8
Merged RFC: https://github.com/open-telemetry/rfcs/blob/8dd6e21/text/0002-remove-spandata.md

- `SpanID`
- `Start timestamp`

// TODO: There's a question about clock resolution when a user supplies a ts
Copy link
Member Author

Choose a reason for hiding this comment

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

This is an open question for me and I'm not quite sure what the solution is. I'd love to get your input and ideas @bogdandrutu and @tylerbenson

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should just say that when using an explicit start time, we recommend also using an explicit stop time, otherwise there is a chance that the clock readings are not comparable. If pressed, I would add that individual languages may decide to support >1 kind of timestamp where appropriate. E.g., In Python there is time.time() and time.time_ns() and both could be supported in some way.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds like we should add End timestamp to the member list here as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

I suspect I should just remove this todo altogether and just add a tidbit about languages recommending which clock should be used if supplying timestamps (assuming there's more than one way e.g. javascript and python). Does that seem like a reasonable solution?

@bogdandrutu
Copy link
Member

I think we don't have the RFC approved, as per suggestion from @iredelmeier and @jmacd we merge all RFC with a proposed status and later we approve them (my initial thought was that once we merge the RFCs are approved or denied, but that is not the case) so please do a PR that changes the status to approved for that RFC before merging this.

I am not sure what is the process with RFC because I am not the one who proposed this process, so not clear for me what do we need to do to approve RFCs.

Copy link
Contributor

@carlosalberto carlosalberto left a comment

Choose a reason for hiding this comment

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

Left a note about possibly adding End timestamp as part of this PR - that aside, it all looks great!

@bogdandrutu
Copy link
Member

Please rebase. There are a lot of changes in this doc already merged :)

@arminru
Copy link
Member

arminru commented Aug 20, 2019

The RFC says:

From #71: If the underlying SDK automatically adds tags to spans such as thread-id, stacktrace, and cpu-usage when a span is started, they would be incorrect for out of band spans as the tracer would not know the difference between in and out of band spans. This can be mitigated by indicating that the span is out of band to prevent attaching incorrect information, possibly with an isOutOfBand() option on startSpan().

This flag/option is missing in this PR.

You noted above:

For span start options, we are adding an optional timestamp to specify the start time, a resource to override the tracer's resource, and span ID to support out of band reporting.

When spans are created asynchronously, e.g. from received messages or by reading a log file (see use cases described in #71), a Span ID will have to be generated at span creation and can therefore not be used to indicate that the span is reported out of band.

specification/api-tracing.md Show resolved Hide resolved
@bogdandrutu
Copy link
Member

Approvers please approve this PR. I think this is a trivial (and good) change applying the already approved RFC.

Copy link
Member

@songy23 songy23 left a comment

Choose a reason for hiding this comment

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

LGTM


- `Resource`
- `SpanID`
- `Start timestamp`
Copy link
Member

Choose a reason for hiding this comment

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

Start timestamp will not be removed :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Oops will fix right now

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed :)

Copy link
Contributor

Choose a reason for hiding this comment

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

No End timestamp btw? ;)

Copy link
Member

Choose a reason for hiding this comment

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

@songy23
Copy link
Member

songy23 commented Sep 9, 2019

Please rebase.

@bogdandrutu
Copy link
Member

Please follow what it says here https://github.com/open-telemetry/opentelemetry-specification/pull/215/checks?check_run_id=216754717

While I am trying to understand why DCO was added as a check please do this to not block this PR.

Signed-off-by: Brandon Gonzalez <[email protected]>
Brandon Gonzalez and others added 12 commits September 9, 2019 16:19
Signed-off-by: Brandon Gonzalez <[email protected]>
Signed-off-by: Brandon Gonzalez <[email protected]>
Signed-off-by: Brandon Gonzalez <[email protected]>
Signed-off-by: Brandon Gonzalez <[email protected]>
Signed-off-by: Brandon Gonzalez <[email protected]>
Signed-off-by: Brandon Gonzalez <[email protected]>
…y#234)

* Rename TraceOptions to TraceFlags to be w3c compatible

Signed-off-by: Bogdan Drutu <[email protected]>

* Fix more TraceOptions and rename recorded with sampled

Signed-off-by: Bogdan Drutu <[email protected]>
Signed-off-by: Brandon Gonzalez <[email protected]>
@bg451 bg451 force-pushed the bg/remove_spandata branch from ffe3441 to cda0350 Compare September 9, 2019 20:20
@bg451
Copy link
Member Author

bg451 commented Sep 9, 2019

Cool fixed DCO

@@ -388,8 +381,7 @@ timestamps to the Span object:
- The end time needs to be recorded when the operation is ended.

Start and end time as well as Event's timestamps MUST be recorded at a time of a
calling of corresponding API and MUST not be passed as an argument. In order to
record already completed span - [`SpanData`](#spandata) API HAVE TO be used.
calling of corresponding API and MAY be used as an argument.
Copy link
Member

Choose a reason for hiding this comment

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

not sure what " and MAY be used as an argument" means. Is it needed here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hm yeah it doesn't read well, I don't think it's needed.

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.

@yurishkuro yurishkuro merged commit 9d2edd2 into open-telemetry:master Sep 13, 2019
SergeyKanzhelev pushed a commit to SergeyKanzhelev/opentelemetry-specification that referenced this pull request Feb 18, 2020
* Removes references of spandata

Signed-off-by: Brandon Gonzalez <[email protected]>

* initial stab at tracing spec

Signed-off-by: Brandon Gonzalez <[email protected]>

* adds link and event timestamp

Signed-off-by: Brandon Gonzalez <[email protected]>

* re-add whitespace to reduce diff size

Signed-off-by: Brandon Gonzalez <[email protected]>

* typo fix

Signed-off-by: Brandon Gonzalez <[email protected]>

* Adds OutOfBand flag to span options

Signed-off-by: Brandon Gonzalez <[email protected]>

* specification/api-distributedcontext: fix typo (open-telemetry#236)

contest -> context

Signed-off-by: Brandon Gonzalez <[email protected]>

* Adds comment+link to Remove Out Of Band Support RFC

Signed-off-by: Brandon Gonzalez <[email protected]>

* remove comment in doc

Signed-off-by: Brandon Gonzalez <[email protected]>

* Remove work_in_progress dir (open-telemetry#225)

Signed-off-by: Brandon Gonzalez <[email protected]>

* Move start timestamp above the possibly removed fields

Signed-off-by: Brandon Gonzalez <[email protected]>

* Fix typo in FailedNotRetryable (open-telemetry#243)

Signed-off-by: Brandon Gonzalez <[email protected]>

* Rename TraceOptions to TraceFlags to be w3c compatible (open-telemetry#234)

* Rename TraceOptions to TraceFlags to be w3c compatible

Signed-off-by: Bogdan Drutu <[email protected]>

* Fix more TraceOptions and rename recorded with sampled

Signed-off-by: Bogdan Drutu <[email protected]>
Signed-off-by: Brandon Gonzalez <[email protected]>

* Respond to comment
carlosalberto pushed a commit to carlosalberto/opentelemetry-specification that referenced this pull request Oct 31, 2024
* Removes references of spandata

Signed-off-by: Brandon Gonzalez <[email protected]>

* initial stab at tracing spec

Signed-off-by: Brandon Gonzalez <[email protected]>

* adds link and event timestamp

Signed-off-by: Brandon Gonzalez <[email protected]>

* re-add whitespace to reduce diff size

Signed-off-by: Brandon Gonzalez <[email protected]>

* typo fix

Signed-off-by: Brandon Gonzalez <[email protected]>

* Adds OutOfBand flag to span options

Signed-off-by: Brandon Gonzalez <[email protected]>

* specification/api-distributedcontext: fix typo (open-telemetry#236)

contest -> context

Signed-off-by: Brandon Gonzalez <[email protected]>

* Adds comment+link to Remove Out Of Band Support RFC

Signed-off-by: Brandon Gonzalez <[email protected]>

* remove comment in doc

Signed-off-by: Brandon Gonzalez <[email protected]>

* Remove work_in_progress dir (open-telemetry#225)

Signed-off-by: Brandon Gonzalez <[email protected]>

* Move start timestamp above the possibly removed fields

Signed-off-by: Brandon Gonzalez <[email protected]>

* Fix typo in FailedNotRetryable (open-telemetry#243)

Signed-off-by: Brandon Gonzalez <[email protected]>

* Rename TraceOptions to TraceFlags to be w3c compatible (open-telemetry#234)

* Rename TraceOptions to TraceFlags to be w3c compatible

Signed-off-by: Bogdan Drutu <[email protected]>

* Fix more TraceOptions and rename recorded with sampled

Signed-off-by: Bogdan Drutu <[email protected]>
Signed-off-by: Brandon Gonzalez <[email protected]>

* Respond to comment
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.