ClickHouse/src/Common/OpenTelemetryTraceContext.h

22 lines
570 B
C++
Raw Normal View History

2020-11-18 17:43:18 +00:00
#pragma once
2020-11-19 12:30:44 +00:00
namespace DB
{
2020-11-18 17:43:18 +00:00
// The runtime info we need to create new OpenTelemetry spans.
struct OpenTelemetryTraceContext
{
__uint128_t trace_id = 0;
UInt64 span_id = 0;
// The incoming tracestate header and the trace flags, we just pass them
// downstream. See https://www.w3.org/TR/trace-context/
String tracestate;
uint8_t trace_flags = 0;
2020-11-18 17:43:18 +00:00
// Parse/compose OpenTelemetry traceparent header.
bool parseTraceparentHeader(const std::string & traceparent, std::string & error);
std::string composeTraceparentHeader() const;
};
}