Skip to content

Allow trace instrumentation to sample requests decoupled from x-request-id #16530

Closed

Description

@basvanbeek

If you are reporting any crash or any potential security issue, do not
open an issue in this repo. Please report the issue via emailing
[email protected] where the issue will be triaged appropriately.

Description:
Envoy couples its sampling logic to the x-request-id header which it expects to be a valid UUID. In case of a pre-existing x-request-id which is of a different format, Envoy will allow the value to be propagated but disables various features, including distributed tracing (e.g. by explicitly setting a x-b3-sampled: 0 in case of Zipkin instrumentation).

In brown field systems using the x-request-id, it is very well possible for it to hold different non UUID compliant values as it is generally described to hold an opaque random value. A good example is Nginx which typically uses a randomly generated 32 hexadecimal characters value.

This poses a problem to onboard a brown field platform that already utilizes the x-request-id without it being a UUID and needs distributed tracing to start from the first Envoy sidecar. Example being an existing Nginx ingress with an Envoy sidecar on its egress.

It would be great if Envoy could be configured or adjusted in behavior to allow x-request-ids it doesn't understand to not disable the sampling logic. Since distributed tracing has its own trace context there is no requirement for Envoy to tie it to the x-request-id nibble logic. This is a blocker for migrating an existing ecosystem into a service mesh environment with an Nginx ingress.

I also think the default assumption for a newcomer to Envoy would be that distributed trace sampling would not be affected by x-request-id as it has no meaning in existing tracing ecosystems.

[optional Relevant Links:]
Envoy also allows decoupling of UUID mangling and trace sampling:
https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/request_id/uuid/v3/uuid.proto.html?highlight=pack_trace_reason

Activity

  1. added
    triage
    on May 17, 2021
  2. added
    enhancement
    help wanted
    and removed
    triage
    on May 21, 2021
  3. pinned this issue on May 22, 2021
  4. unpinned this issue on May 22, 2021
  5. self-assigned this
    on Jun 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/tracingenhancementhelp wanted

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions