From 3f0173c15f9faddc338dbc33a9bf8275d344befa Mon Sep 17 00:00:00 2001 From: TianlinZhao Date: Thu, 30 Jul 2020 19:28:03 -0400 Subject: [PATCH] tracer --- .../opentelemetry/trace/default_span.h | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/api/include/opentelemetry/trace/default_span.h b/api/include/opentelemetry/trace/default_span.h index 249a4956ef..1c6ab99738 100644 --- a/api/include/opentelemetry/trace/default_span.h +++ b/api/include/opentelemetry/trace/default_span.h @@ -7,8 +7,36 @@ #define pass OPENTELEMETRY_BEGIN_NAMESPACE -class DefaultTracer; namespace trace { +class DefaultTracer: public Tracer { +public: + ~DefaultTracer() = default; + + /** + * Starts a span. + * + * Optionally sets attributes at Span creation from the given key/value pairs. + * + * Attributes will be processed in order, previous attributes with the same + * key will be overwritten. + */ + nostd::unique_ptr StartSpan(nostd::string_view name, + const KeyValueIterable &attributes, + const StartSpanOptions &options = {}) noexcept + { + return DefaultSpan::GetInvalid(); + } + + void ForceFlushWithMicroseconds(uint64_t timeout) noexcept + { + pass; + } + + void CloseWithMicroseconds(uint64_t timeout) noexcept + { + pass; + } +}; class DefaultSpan: public Span { public: // Returns an invalid span.