Skip to content

Commit

Permalink
[Trace] Add SpanData getter for Span Recordable (#1508)
Browse files Browse the repository at this point in the history
  • Loading branch information
lalitb authored Aug 2, 2022
1 parent 70fd2dc commit 78551fb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions sdk/include/opentelemetry/sdk/trace/recordable.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ namespace trace
{

using namespace opentelemetry::sdk::instrumentationscope;
class SpanData;

/**
* Maintains a representation of a span in a format that can be processed by a recorder.
Expand Down Expand Up @@ -140,6 +141,14 @@ class Recordable
*/
virtual void SetDuration(std::chrono::nanoseconds duration) noexcept = 0;

/**
* Get the SpanData object for this Recordable.
*
* @return SpanData*
*/

virtual explicit operator SpanData *() const { return nullptr; }

/**
* Set the instrumentation scope of the span.
* @param instrumentation_scope the instrumentation scope to set
Expand Down

1 comment on commit 78551fb

@github-actions
Copy link

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'OpenTelemetry-cpp sdk Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: 78551fb Previous: 70fd2dc Ratio
BM_BaselineBuffer/2 6411383.152008057 ns/iter 2349947.929382324 ns/iter 2.73
BM_LockFreeBuffer/2 2218472.617013114 ns/iter 1073598.1464385986 ns/iter 2.07

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.