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

Enable setting Span endtime for ETW exporter #1846

Merged
merged 8 commits into from
Dec 8, 2022

Conversation

lalitb
Copy link
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

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           

@@ -899,7 +899,15 @@ class Span : public opentelemetry::trace::Span
*/
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
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
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