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

[Trace] Add SpanData getter for Span Recordable #1508

Merged
merged 11 commits into from
Aug 2, 2022
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