Skip to content

Commit

Permalink
[Trace] Add SpanData getter for Span Recordable (open-telemetry#1508)
Browse files Browse the repository at this point in the history
  • Loading branch information
lalitb authored and yxue committed Dec 5, 2022
1 parent efd9596 commit ca8e58f
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

0 comments on commit ca8e58f

Please sign in to comment.