-
Notifications
You must be signed in to change notification settings - Fork 893
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
Add ObservedTimestamp to the Log Data Model #2184
Merged
jmacd
merged 3 commits into
open-telemetry:main
from
tigrannajaryan:add-log-observedtimestamp
Dec 10, 2021
Merged
Add ObservedTimestamp to the Log Data Model #2184
jmacd
merged 3 commits into
open-telemetry:main
from
tigrannajaryan:add-log-observedtimestamp
Dec 10, 2021
Conversation
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
@pmm-sumo @djaglowski please review. |
tigrannajaryan
force-pushed
the
add-log-observedtimestamp
branch
from
December 2, 2021 21:16
1a8751c
to
ff3f5f5
Compare
pmm-sumo
reviewed
Dec 2, 2021
pmm-sumo
approved these changes
Dec 2, 2021
kumoroku
reviewed
Dec 2, 2021
kumoroku
approved these changes
Dec 2, 2021
djaglowski
approved these changes
Dec 2, 2021
djaglowski
approved these changes
Dec 3, 2021
jack-berg
approved these changes
Dec 6, 2021
@open-telemetry/specs-approvers please review. |
arminru
added
area:data-model
For issues related to data model
spec:logs
Related to the specification/logs directory
labels
Dec 7, 2021
jsuereth
approved these changes
Dec 7, 2021
carlosalberto
approved these changes
Dec 7, 2021
zenmoto
approved these changes
Dec 10, 2021
Resolves open-telemetry#1875 See the issue for the discussion and the description of the source vs observed timestamps.
tigrannajaryan
force-pushed
the
add-log-observedtimestamp
branch
from
December 10, 2021 20:25
5a63210
to
b38547d
Compare
jmacd
approved these changes
Dec 10, 2021
tigrannajaryan
added a commit
to tigrannajaryan/opentelemetry-proto
that referenced
this pull request
Jan 7, 2022
This implements the log data model specification change open-telemetry/opentelemetry-specification#2184
tigrannajaryan
added a commit
to tigrannajaryan/opentelemetry-proto
that referenced
this pull request
Jan 7, 2022
This implements the log data model specification change open-telemetry/opentelemetry-specification#2184
tigrannajaryan
added a commit
to tigrannajaryan/opentelemetry-proto
that referenced
this pull request
Feb 8, 2022
This implements the log data model specification change open-telemetry/opentelemetry-specification#2184
4 tasks
tigrannajaryan
added a commit
to open-telemetry/opentelemetry-proto
that referenced
this pull request
Feb 9, 2022
This implements the log data model specification change open-telemetry/opentelemetry-specification#2184
carlosalberto
pushed a commit
to carlosalberto/opentelemetry-specification
that referenced
this pull request
Oct 31, 2024
* Add ObservedTimestamp to the Log Data Model Resolves open-telemetry#1875 See the issue for the discussion and the description of the source vs observed timestamps. * Fixed based on PR comments Co-authored-by: Joshua MacDonald <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area:data-model
For issues related to data model
spec:logs
Related to the specification/logs directory
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.
Resolves #1875
See the issue above for the detailed discussion. A summary here:
Currently, logs data model describes a single (optional)
Timestamp
field which describes when the event occurredUnlike for e.g. spans, there are at least three ways a log record can have timestamp associated:
While the first two can be considered mutually exclusive (if the record had timestamp already assigned, it does not make much sense to attempt parsing log body for it), this is not true with the last one. However, there's only one field where all of them can fit.
This brings several problems, such as:
E.g. currently
filelogreceiver
setsTimestamp
to receipt time - by default, or parsed timestamp - when timestamp operator is used. This makes it impossible to tell later if the log timestamp was parsed or not.Proposed solution
This adds another field to the log record which would store the receipt timestamp (
ObservedTimestamp
). It is filled in the record when OpenTelemetry first observes the log record.See also the clarification about the
Timestamp
field here #2183The net result is that we are aiming for 2 timestamp fields like this:
Timestamp
- Time when the event occurred measured by the origin clock, i.e. the time at the source. This field is optional, it may be missing if the source timestamp is unknown.ObservedTimestamp
- Time when the event was observed by the collection system. For events that originate in OpenTelemetry this timestamp is typically set at the generation time and is equal toTimestamp
. For events originating externally and collected by OpenTelemetry (e.g. using Collector) this is the time when any of OpenTelemetry's code observed the event measure by the clock of the OpenTelemetry code. This field SHOULD be set once the event is observed by OpenTelemetry.