@@ -590,6 +590,7 @@ class Tracer : public opentelemetry::trace::Tracer,
590590 return result;
591591 }
592592
593+ #if OPENTELEMETRY_ABI_VERSION_NO == 1
593594 /* *
594595 * @brief Force flush data to Tracer, spending up to given amount of microseconds to flush.
595596 * NOTE: this method has no effect for the realtime streaming Tracer.
@@ -615,6 +616,7 @@ class Tracer : public opentelemetry::trace::Tracer,
615616 etwProvider ().close (provHandle);
616617 }
617618 }
619+ #endif
618620
619621 /* *
620622 * @brief Add event data to span associated with tracer.
@@ -736,7 +738,18 @@ class Tracer : public opentelemetry::trace::Tracer,
736738 /* *
737739 * @brief Tracer destructor.
738740 */
739- virtual ~Tracer () { CloseWithMicroseconds (0 ); }
741+ virtual ~Tracer ()
742+ {
743+ #if OPENTELEMETRY_ABI_VERSION_NO == 1
744+ CloseWithMicroseconds (0 );
745+ #else
746+ // Close once only
747+ if (!isClosed_.exchange (true ))
748+ {
749+ etwProvider ().close (provHandle);
750+ }
751+ #endif
752+ }
740753};
741754
742755/* *
@@ -893,6 +906,34 @@ class Span : public opentelemetry::trace::Span
893906 owner_.AddEvent (*this , name, timestamp, attributes);
894907 }
895908
909+ #if OPENTELEMETRY_ABI_VERSION_NO >= 2
910+
911+ /* *
912+ * Add link (ABI).
913+ *
914+ * See comments about sampling in @ref opentelemetry::trace::Span
915+ *
916+ * @since ABI_VERSION 2
917+ */
918+ void AddLink (const trace::SpanContext & /* target*/ ,
919+ const common::KeyValueIterable & /* attrs*/ ) noexcept override
920+ {
921+ // FIXME: What to do with links?
922+ }
923+
924+ /* *
925+ * Add links (ABI).
926+ *
927+ * See comments about sampling in @ref opentelemetry::trace::Span
928+ *
929+ * @since ABI_VERSION 2
930+ */
931+ void AddLinks (const trace::SpanContextKeyValueIterable & /* links*/ ) noexcept override
932+ {
933+ // FIXME: What to do with links?
934+ }
935+ #endif
936+
896937 /* *
897938 * @brief Set Span status
898939 * @param code Span status code.
@@ -1116,7 +1157,13 @@ class TracerProvider : public opentelemetry::trace::TracerProvider
11161157 nostd::shared_ptr<opentelemetry::trace::Tracer> GetTracer (
11171158 nostd::string_view name,
11181159 nostd::string_view args = " " ,
1119- nostd::string_view schema_url = " " ) noexcept override
1160+ nostd::string_view schema_url = " "
1161+ #if OPENTELEMETRY_ABI_VERSION_NO >= 2
1162+ ,
1163+ // FIXME: This is a temporary workaround to avoid breaking compiling.
1164+ const common::KeyValueIterable * /* attributes*/ = nullptr
1165+ #endif
1166+ ) noexcept override
11201167 {
11211168 UNREFERENCED_PARAMETER (args);
11221169 UNREFERENCED_PARAMETER (schema_url);
0 commit comments