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

OTLP exporter: Set observed timestamp #4444

Merged
merged 3 commits into from
Apr 26, 2023

Conversation

alanwest
Copy link
Member

@alanwest alanwest commented Apr 26, 2023

Observed timestamp should equal the timestamp. See: https://github.com/open-telemetry/opentelemetry-proto/blob/395c8422fe90080314c7d9b4114d701a0c049e1f/opentelemetry/proto/logs/v1/logs.proto#L123-L129

  // time_unix_nano is the time when the event occurred.
  // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970.
  // Value of 0 indicates unknown or missing timestamp.
  fixed64 time_unix_nano = 1;

  // Time when the event was observed by the collection system.
  // For events that originate in OpenTelemetry (e.g. using OpenTelemetry Logging SDK)
  // this timestamp is typically set at the generation time and is equal to Timestamp.
  // For events originating externally and collected by OpenTelemetry (e.g. using
  // Collector) this is the time when OpenTelemetry's code observed the event measured
  // by the clock of the OpenTelemetry code. This field MUST be set once the event is
  // observed by OpenTelemetry.
  //
  // For converting OpenTelemetry log data to formats that support only one timestamp or
  // when receiving OpenTelemetry log data by recipients that support only one timestamp
  // internally the following logic is recommended:
  //   - Use time_unix_nano if it is present, otherwise use observed_time_unix_nano.
  //
  // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970.
  // Value of 0 indicates unknown or missing timestamp.
  fixed64 observed_time_unix_nano = 11;

@alanwest alanwest requested a review from a team April 26, 2023 19:13
@codecov
Copy link

codecov bot commented Apr 26, 2023

Codecov Report

Merging #4444 (449cd71) into main (9d51cc3) will decrease coverage by 0.03%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4444      +/-   ##
==========================================
- Coverage   85.00%   84.98%   -0.03%     
==========================================
  Files         306      306              
  Lines       12182    12184       +2     
==========================================
- Hits        10355    10354       -1     
- Misses       1827     1830       +3     
Impacted Files Coverage Δ
...etryProtocol/Implementation/LogRecordExtensions.cs 89.41% <100.00%> (+0.25%) ⬆️

... and 6 files with indirect coverage changes

@cijothomas cijothomas merged commit 39314f8 into open-telemetry:main Apr 26, 2023
@alanwest alanwest deleted the alanwest/observed-timestamp branch April 26, 2023 20:30
@amachado-pie
Copy link

As context, this issue was discussed here: https://cloud-native.slack.com/archives/C01N3BC2W7Q/p1682531179925309

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.

4 participants