mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 01:25:21 +00:00
This commit is contained in:
parent
f95d0a7c2d
commit
e3de3889e3
@ -202,7 +202,6 @@ bool OpenTelemetryTraceContext::parseTraceparentHeader(const std::string & trace
|
||||
|
||||
++data;
|
||||
UInt128 trace_id_128 = readHex<UInt128>(data);
|
||||
trace_id = trace_id_128;
|
||||
data += 32;
|
||||
|
||||
if (*data != '-')
|
||||
@ -212,7 +211,7 @@ bool OpenTelemetryTraceContext::parseTraceparentHeader(const std::string & trace
|
||||
}
|
||||
|
||||
++data;
|
||||
span_id = readHex<UInt64>(data);
|
||||
UInt64 span_id_64 = readHex<UInt64>(data);
|
||||
data += 16;
|
||||
|
||||
if (*data != '-')
|
||||
@ -222,7 +221,9 @@ bool OpenTelemetryTraceContext::parseTraceparentHeader(const std::string & trace
|
||||
}
|
||||
|
||||
++data;
|
||||
trace_flags = readHex<UInt8>(data);
|
||||
this->trace_flags = readHex<UInt8>(data);
|
||||
this->trace_id = trace_id_128;
|
||||
this->span_id = span_id_64;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -96,7 +96,6 @@ namespace ErrorCodes
|
||||
extern const int REQUIRED_PASSWORD;
|
||||
extern const int AUTHENTICATION_FAILED;
|
||||
|
||||
extern const int BAD_REQUEST_PARAMETER;
|
||||
extern const int INVALID_SESSION_TIMEOUT;
|
||||
extern const int HTTP_LENGTH_REQUIRED;
|
||||
}
|
||||
@ -491,12 +490,9 @@ void HTTPHandler::processQuery(
|
||||
{
|
||||
std::string opentelemetry_traceparent = request.get("traceparent");
|
||||
std::string error;
|
||||
if (!client_info.client_trace_context.parseTraceparentHeader(
|
||||
opentelemetry_traceparent, error))
|
||||
if (!client_info.client_trace_context.parseTraceparentHeader(opentelemetry_traceparent, error))
|
||||
{
|
||||
throw Exception(ErrorCodes::BAD_REQUEST_PARAMETER,
|
||||
"Failed to parse OpenTelemetry traceparent header '{}': {}",
|
||||
opentelemetry_traceparent, error);
|
||||
LOG_DEBUG(log, "Failed to parse OpenTelemetry traceparent header '{}': {}", opentelemetry_traceparent, error);
|
||||
}
|
||||
client_info.client_trace_context.tracestate = request.get("tracestate", "");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user