Skip to content
This repository has been archived by the owner on Jan 26, 2024. It is now read-only.

Commit

Permalink
Store tags in StartSpanOptions as string. Correct comment. (#19)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
pantoss authored and rnburn committed Sep 26, 2017
1 parent 56d89ab commit a16aba1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions include/opentracing/tracer.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ struct StartSpanOptions {
SystemTime start_system_timestamp;
SteadyTime start_steady_timestamp;
std::vector<std::pair<SpanReferenceType, const SpanContext*>> references;
std::vector<std::pair<string_view, Value>> tags;
std::vector<std::pair<std::string, Value>> tags;
};

// StartSpanOption instances (zero or more) may be passed to Tracer.StartSpan.
Expand Down Expand Up @@ -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())})
//
Expand Down Expand Up @@ -245,7 +245,7 @@ class SetTag : public StartSpanOption {
}

private:
string_view key_;
const string_view key_;
const Value& value_;
};
END_OPENTRACING_ABI_NAMESPACE
Expand Down

0 comments on commit a16aba1

Please sign in to comment.