-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Description
Description:
Envoy currently enforces specific format of x-request-id header, and piggybacks tracing decisions into it.
However this approach does not play well with existing setups, which already heavily use both request ids and tracing, and rely on transmission of this data in different form (e.g. using explicit distinct headers for tracing-related metadata).
In short we would like to have an ability to use Envoy's tracing configuration (sample ratio, x-force-tracing header, skipping health checks, statistics, etc) with different data format.
Is it reasonable to make this behavior configurable, e.g. by ability to create native extensions which would override behavior of Envoy::UuidUtils?
Relevant Links:
envoy/source/common/runtime/uuid_util.cc
Lines 24 to 39 in 3a596a4
| UuidTraceStatus UuidUtils::isTraceableUuid(absl::string_view uuid) { | |
| if (uuid.length() != Runtime::RandomGeneratorImpl::UUID_LENGTH) { | |
| return UuidTraceStatus::NoTrace; | |
| } | |
| switch (uuid[TRACE_BYTE_POSITION]) { | |
| case TRACE_FORCED: | |
| return UuidTraceStatus::Forced; | |
| case TRACE_SAMPLED: | |
| return UuidTraceStatus::Sampled; | |
| case TRACE_CLIENT: | |
| return UuidTraceStatus::Client; | |
| default: | |
| return UuidTraceStatus::NoTrace; | |
| } | |
| } |
envoy/source/common/runtime/uuid_util.cc
Lines 41 to 59 in 3a596a4
| bool UuidUtils::setTraceableUuid(std::string& uuid, UuidTraceStatus trace_status) { | |
| if (uuid.length() != Runtime::RandomGeneratorImpl::UUID_LENGTH) { | |
| return false; | |
| } | |
| switch (trace_status) { | |
| case UuidTraceStatus::Forced: | |
| uuid[TRACE_BYTE_POSITION] = TRACE_FORCED; | |
| break; | |
| case UuidTraceStatus::Client: | |
| uuid[TRACE_BYTE_POSITION] = TRACE_CLIENT; | |
| break; | |
| case UuidTraceStatus::Sampled: | |
| uuid[TRACE_BYTE_POSITION] = TRACE_SAMPLED; | |
| break; | |
| case UuidTraceStatus::NoTrace: | |
| uuid[TRACE_BYTE_POSITION] = NO_TRACE; | |
| break; | |
| } |