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

Add LogRecord API from Go client #43

Merged
merged 3 commits into from
Jan 4, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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