From a16aba178db724924075d2ca006fa60c595564ba Mon Sep 17 00:00:00 2001 From: pantoss Date: Tue, 26 Sep 2017 23:23:04 +0100 Subject: [PATCH] Store tags in StartSpanOptions as string. Correct comment. (#19) * Small correct to the documentation of Start Span. * Store span options as strings to prevent dangling pointer and to allow moving over the tags vector. --- include/opentracing/tracer.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/opentracing/tracer.h b/include/opentracing/tracer.h index 93da809..df84684 100644 --- a/include/opentracing/tracer.h +++ b/include/opentracing/tracer.h @@ -25,7 +25,7 @@ struct StartSpanOptions { SystemTime start_system_timestamp; SteadyTime start_steady_timestamp; std::vector> references; - std::vector> tags; + std::vector> tags; }; // StartSpanOption instances (zero or more) may be passed to Tracer.StartSpan. @@ -63,12 +63,12 @@ class Tracer { // // The vanilla child span case: // auto span = tracer.StartSpan( // "GetFeed", - // {opentracing::ChildOf(parentSpan.context())}) + // {opentracing::ChildOf(&parentSpan.context())}) // // // All the bells and whistles: // auto span = tracer.StartSpan( // "GetFeed", - // {opentracing::ChildOf(parentSpan.context()), + // {opentracing::ChildOf(&parentSpan.context()), // opentracing::Tag{"user_agent", loggedReq.UserAgent}, // opentracing::StartTimestamp(loggedReq.timestamp())}) // @@ -245,7 +245,7 @@ class SetTag : public StartSpanOption { } private: - string_view key_; + const string_view key_; const Value& value_; }; END_OPENTRACING_ABI_NAMESPACE