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

Commit

Permalink
Add LogRecord API from Go client (#43)
Browse files Browse the repository at this point in the history
* Add LogRecord API from Go client

* Fix comment

* Change undefined to unspecified in docs
  • Loading branch information
isaachier authored and rnburn committed Jan 4, 2018
1 parent 4503c12 commit e9fdc60
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions include/opentracing/span.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <chrono>
#include <functional>
#include <string>
#include <vector>

namespace opentracing {
BEGIN_OPENTRACING_ABI_NAMESPACE
Expand All @@ -27,10 +28,27 @@ class SpanContext {
const = 0;
};

struct LogRecord {
using Field = std::pair<std::string, Value>;

SystemTime timestamp;
std::vector<Field> fields;
};

// FinishOptions allows Span.Finish callers to override the finish
// timestamp.
struct FinishSpanOptions {
SteadyTime finish_steady_timestamp;

// log_records allows the caller to specify the contents of many Log() calls
// with a single vector. May be empty.
//
// None of the LogRecord.timestamp values may be SystemTime() (i.e., they must
// be set explicitly). Also, they must be >= the Span's start system timestamp
// and <= the finish_steady_timestamp converted to system timestamp
// (or SystemTime::now() if finish_steady_timestamp is default-constructed).
// Otherwise the behavior of FinishWithOptions() is unspecified.
std::vector<LogRecord> log_records;
};

// FinishSpanOption instances (zero or more) may be passed to Span.Finish.
Expand Down

0 comments on commit e9fdc60

Please sign in to comment.