Skip to content

Enable setting Span endtime for ETW exporter#1846

Merged
lalitb merged 8 commits intoopen-telemetry:mainfrom
lalitb:etw-custom-endtime
Dec 8, 2022
Merged

Enable setting Span endtime for ETW exporter#1846
lalitb merged 8 commits intoopen-telemetry:mainfrom
lalitb:etw-custom-endtime

Conversation

@lalitb
Copy link
Copy Markdown
Member

@lalitb lalitb commented Dec 7, 2022

Changes

While it is possible to set the end-time while ending span as per the spec, the ETW exporter use the endtime passed as argument in Span::End(). This PR fixes it.

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

@lalitb lalitb requested review from a team and ThomsonTan December 7, 2022 06:37
@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 7, 2022

Codecov Report

Merging #1846 (ab2ea8a) into main (7727620) will not change coverage.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1846   +/-   ##
=======================================
  Coverage   85.73%   85.73%           
=======================================
  Files         171      171           
  Lines        5240     5240           
=======================================
  Hits         4492     4492           
  Misses        748      748           

void End(const opentelemetry::trace::EndSpanOptions &options = {}) noexcept override
{
end_time_ = std::chrono::system_clock::now();
if (options.end_steady_time == opentelemetry::common::SteadyTimestamp())
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Update this to compare with 0 explicitly. And add TODO to choose a different value to represent "not set" status, as 0 is a valid value, and the user might set endtime to it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks fixed this.

@lalitb lalitb enabled auto-merge (squash) December 8, 2022 19:58
@lalitb lalitb merged commit 722ad4e into open-telemetry:main Dec 8, 2022
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.

2 participants