diff --git a/include/opentracing/span.h b/include/opentracing/span.h index 906dd38..aeef3d0 100644 --- a/include/opentracing/span.h +++ b/include/opentracing/span.h @@ -8,6 +8,7 @@ #include #include #include +#include namespace opentracing { BEGIN_OPENTRACING_ABI_NAMESPACE @@ -27,10 +28,27 @@ class SpanContext { const = 0; }; +struct LogRecord { + using Field = std::pair; + + SystemTime timestamp; + std::vector 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 log_records; }; // FinishSpanOption instances (zero or more) may be passed to Span.Finish.