-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add pomerium_otel tracer extension #1
Conversation
ad21acb
to
7bd943c
Compare
a122641
to
2765bc8
Compare
// the query parameters are standard and managed by oauth2 clients | ||
const auto state = params.getFirstValue(Envoy::Http::LowerCaseString("state")); | ||
if (state.has_value()) { | ||
const std::string stateDecoded = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the format of the state
value documented somewhere? It might be helpful to add a comment here describing the format and/or showing an example value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only in the authenticate service here. I can definitely add some comments here and an example.
name_substitutions); | ||
|
||
if (auto tp = pomeriumTraceParentHeader().get(trace_context); | ||
tp.has_value() && tp->size() == 55) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest adding a comment here about where the numbers 55, 3, 32 come from.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, good idea.
This adds a new tracer extension called pomerium_otel, which extends the default opentelemetry tracer and adds a couple of additional pomerium-specific features:
1. Trace ID overriding via header
When starting a span:
x-pomerium-traceparent
orx-pomerium-traceid
header (set in the early header mutation extension), the randomly generated trace ID will be replaced with the trace ID contained in the header value.x-pomerium-sampling-decision
header, the sampling decision will be forced on or off, depending on the value of the header ("1" or "0" respectively).2. Route decorator variables
If configured, Envoy will use a route's decorator as the span operation name for spans created from HTTP requests for that route. This extends the otel Span to override its setOperation with logic to substitute the strings
${path}
,${method}
,${host}
, or${protocol}
with the actual values for that request.