-
Notifications
You must be signed in to change notification settings - Fork 888
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
Clarify event timestamp origin and range #839
Merged
arminru
merged 19 commits into
open-telemetry:master
from
dynatrace-oss-contrib:define-timestamp-range
Sep 17, 2020
Merged
Changes from 8 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
bb1e233
Document that event timestamps might be out of range
arminru fcbc5fe
Add to changelog
arminru 8ded9fa
Update specification/trace/api.md
arminru c5ff2f3
Clarify that custom timestamps should only be used when necessary
arminru 8f17b7f
Generalize occasions when timestamps might be out of range
arminru d5ba3bb
Point out that a timestamp is always there but can be overriden by th…
arminru d0f6e62
Remove inconsistent required/optional from property list
arminru 4b44694
Merge branch 'master' into define-timestamp-range
arminru a3122b2
Merge branch 'master' into define-timestamp-range
arminru e3db762
Merge branch 'master' into define-timestamp-range
arminru fbaf199
Merge branch 'master' into define-timestamp-range
arminru bcc1b72
Merge branch 'master' into define-timestamp-range
arminru e329bbe
Merge branch 'master' into define-timestamp-range
arminru 5d779f7
Merge branch 'master' into define-timestamp-range
arminru 62b2dcc
Merge branch 'master' into define-timestamp-range
arminru 9b684c9
Merge branch 'master' into define-timestamp-range
arminru 3461fa2
Merge branch 'master' into define-timestamp-range
arminru 548b655
Merge branch 'master' into define-timestamp-range
arminru 2c45fef
Merge branch 'master' into define-timestamp-range
arminru File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -427,16 +427,21 @@ with the moment when they are added to the `Span`. | |
|
||
An `Event` is defined by the following properties: | ||
|
||
- (Required) Name of the event. | ||
- (Optional) [`Attributes`](../common/common.md#attributes). | ||
- (Optional) Timestamp for the event. If not provided, the current time when the event is added MUST be used. | ||
- Name of the event. | ||
- A timestamp for the event. Either the time at which the event was | ||
added or a custom timestamp provided by the user. | ||
- [`Attributes`](../common/common.md#attributes) further describing the event. | ||
|
||
The `Event` SHOULD be an immutable type. | ||
|
||
The Span interface MUST provide: | ||
|
||
- An API to record a single `Event` where the `Event` properties are passed as | ||
arguments. This MAY be called `AddEvent`. | ||
This API takes the name of the event, optional `Attributes` and an optional | ||
`Timestamp` which can be used to specify the time at which the event occurred. | ||
If no custom timestamp is provided by the user, the implementation automatically | ||
sets the time at which this API is called on the event. | ||
- An API to record a single `Event` whose attributes or attribute values are | ||
lazily constructed, with the intention of avoiding unnecessary work if an event | ||
is unused. If the language supports overloads then this SHOULD be called | ||
|
@@ -445,8 +450,15 @@ The Span interface MUST provide: | |
wrapping class or function that returns an `Event` or formatted attributes. When | ||
providing a wrapping class or function it SHOULD be named `EventFormatter`. | ||
|
||
Events SHOULD preserve the order in which they're set. This will typically match | ||
the ordering of the events' timestamps. | ||
Events SHOULD preserve the order in which they are recorded. | ||
This will typically match the ordering of the events' timestamps, | ||
but events may be recorded out-of-order using custom timestamps. | ||
|
||
Consumers should be aware that an event's timestamp might be before the start or | ||
after the end of the span if custom timestamps were provided by the user for the | ||
event or when starting or ending the span. | ||
The specification does not require any normalization if provided timestamps are | ||
out of range. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
|
||
Note that the OpenTelemetry project documents certain ["standard event names and | ||
keys"](semantic_conventions/README.md) which have prescribed semantic meanings. | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned before, I think this is an unrelated change and should be made across the entire file if we want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keeping the wording that the timestamp is an optional property of an event is wrong, however, so dropping the misleading part and opening #850 for consolidating it across the file was the best compromise to move forward IMHO.
This section describes the event itself with its non-optional timestamp and the API definition for adding events below explicitly states the timestamp is optional as a parameter to this API and that it will use the current time as a default if not provided.
We only have these (Required)/(Optional) prefixes for the Events and Links sections here and now only Links are left with it. All the other API definitions don't use this notion anyway so it's not aligned already and this change is not making anything worse. I also don't think the change is unrelated to this PR which is intended to clarify the timestamps origin and range.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bogdandrutu ^^^
I think we should be able to move forward with this PR and sort out the rest on #850.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bogdandrutu ^^^
I think we should be able to move forward with this PR and sort out the rest on #850.