From ca8e58ff84fa8683eb13ec64d07cc96109e0b36e Mon Sep 17 00:00:00 2001 From: Lalit Kumar Bhasin Date: Tue, 2 Aug 2022 12:09:34 -0700 Subject: [PATCH] [Trace] Add SpanData getter for Span Recordable (#1508) --- sdk/include/opentelemetry/sdk/trace/recordable.h | 9 +++++++++ 1 file changed, 9 insertions(+) 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