diff --git a/sdk/include/opentelemetry/sdk/trace/recordable.h b/sdk/include/opentelemetry/sdk/trace/recordable.h index 8f9fb460e4..04248944e9 100644 --- a/sdk/include/opentelemetry/sdk/trace/recordable.h +++ b/sdk/include/opentelemetry/sdk/trace/recordable.h @@ -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. @@ -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