Skip to content

opentelemetry: Move traceparent size constants into common lib - #48516

Merged
yanavlasov merged 1 commit into
envoyproxy:mainfrom
dmcardle:otel-traceparent-constants
Dec 2, 2026
Merged

yanavlasov merged 1 commit into
envoyproxy:mainfrom
dmcardle:otel-traceparent-constants

Conversation

@dmcardle

@dmcardle dmcardle commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Commit Message: opentelemetry: Move traceparent size constants into common lib

This commit deduplicates constants related to W3C traceparent into source/common/tracing/tracing_validation.h.

Additional Description:

This PR was created with help from generative AI (Gemini). I fully understand the code.

For reference, here is the full PR chain:

  1. api: Add mode field to TraceContextPropagationConfig in mcp.proto #48249
  2. envoy/tracing: Add method Envoy::Tracing::Span::updateParent() #48250
  3. opentelemetry: Add traceparent parse/serialize methods to SpanContextExtractor #48449
  4. opentelemetry: Override Span::updateParent() #48448
  5. opentelemetry: Move traceparent size constants into common lib #48516
  6. mcp: Reparent active span based on body's traceparent #48038
  7. opentelemetry: Add bool field resample_on_update_parent to OpenTelemetryConfig #48450
  8. opentelemetry: Resample in Span::updateParent() #48451

Risk Level:
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]

@repokitteh-read-only

Copy link
Copy Markdown

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #48516 was opened by dmcardle.

see: more, trace.

@repokitteh-read-only

Copy link
Copy Markdown

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to (api/envoy/|docs/root/api-docs/).
envoyproxy/api-shepherds assignee is @htuch
CC @envoyproxy/api-watchers: FYI only for changes made to (api/envoy/|docs/root/api-docs/).

🐱

Caused by: #48516 was ready_for_review by dmcardle.

see: more, trace.

@dmcardle

Copy link
Copy Markdown
Contributor Author

@paul-r-gall FYI

@dmcardle
dmcardle force-pushed the otel-traceparent-constants branch 4 times, most recently from e5c04dd to 15e4e54 Compare October 23, 2026 22:55

@htuch htuch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, just one small nit.

@dmcardle
dmcardle force-pushed the otel-traceparent-constants branch from 15e4e54 to fffcc9b Compare October 26, 2026 15:59
@dmcardle dmcardle changed the title opentelemetry: Move traceparent size constants into span_context_extractor.h opentelemetry: Move traceparent size constants into common lib Oct 26, 2026
@dmcardle
dmcardle force-pushed the otel-traceparent-constants branch 2 times, most recently from 4518fc3 to d06e0af Compare October 28, 2026 14:06
botengyao pushed a commit that referenced this pull request Oct 29, 2026
…48249)

<!--
!!!ATTENTION!!!

If you are fixing **any** crash or **any** potential security issue,
**do not
open a pull request**.

Instead, please
[open a GitHub Security
Advisory](https://github.com/envoyproxy/envoy/security/advisories/new)
(preferred). Alternatively, you may email
[email protected].

Thank you in advance for helping to keep Envoy secure.

!!!ATTENTION!!!

For an explanation of how to fill out the fields, please see the
relevant section
in
[PULL_REQUESTS.md](https://github.com/envoyproxy/envoy/blob/main/PULL_REQUESTS.md)

!!!ATTENTION!!!

Please check the [use of generative AI
policy](https://github.com/envoyproxy/envoy/blob/main/CONTRIBUTING.md?plain=1#L41).

You may use generative AI only if you fully understand the code. You
need to disclose
this usage in the PR description to ensure transparency.
-->

Commit Message:
Additional Description:

This is the first PR in a chain, with the high-level goal of getting
McpFilter to reparent the active span based on the request body's trace
context.

For reference, here is the full PR chain:

1. #48249
1. #48250
1. #48449
1. #48448
1. #48516
1. #48038
1. #48450
1. #48451

This PR was created with help from generative AI (Gemini). I fully
understand the code.

Risk Level:
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional [API
Considerations](https://github.com/envoyproxy/envoy/blob/main/api/review_checklist.md):]

Signed-off-by: dmcardle <[email protected]>
@dmcardle
dmcardle force-pushed the otel-traceparent-constants branch 2 times, most recently from 7ff54ed to 3d7e80c Compare October 30, 2026 21:35
@htuch

htuch commented Oct 31, 2026

Copy link
Copy Markdown
Member

/retest

htuch
htuch previously approved these changes Nov 1, 2026

@htuch htuch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current build failures come from #48448's commit: tracer.cc:91 assigns preserve_headers_, which is not declared. Please also update the Commit Message field, which still names span_context_extractor.h rather than tracing_validation.h.

@dmcardle
dmcardle force-pushed the otel-traceparent-constants branch 2 times, most recently from 0c2050f to 0a3f47a Compare November 2, 2026 15:46
@dmcardle

dmcardle commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

The current build failures come from #48448's commit: tracer.cc:91 assigns preserve_headers_, which is not declared.

Thanks, @htuch! This should be fixed now.

Please also update the Commit Message field, which still names span_context_extractor.h rather than tracing_validation.h.

Also done.

@dmcardle
dmcardle force-pushed the otel-traceparent-constants branch from 0a3f47a to 9ecd313 Compare November 2, 2026 17:59
@htuch

htuch commented Nov 3, 2026

Copy link
Copy Markdown
Member

/retest

htuch
htuch previously approved these changes Nov 3, 2026
botengyao pushed a commit that referenced this pull request Nov 3, 2026
<!--
!!!ATTENTION!!!

If you are fixing **any** crash or **any** potential security issue,
**do not
open a pull request**.

Instead, please
[open a GitHub Security
Advisory](https://github.com/envoyproxy/envoy/security/advisories/new)
(preferred). Alternatively, you may email
[email protected].

Thank you in advance for helping to keep Envoy secure.

!!!ATTENTION!!!

For an explanation of how to fill out the fields, please see the
relevant section
in
[PULL_REQUESTS.md](https://github.com/envoyproxy/envoy/blob/main/PULL_REQUESTS.md)

!!!ATTENTION!!!

Please check the [use of generative AI
policy](https://github.com/envoyproxy/envoy/blob/main/CONTRIBUTING.md?plain=1#L41).

You may use generative AI only if you fully understand the code. You
need to disclose
this usage in the PR description to ensure transparency.
-->

Commit Message:
Additional Description: This change supports
#48038

This PR was created with help from generative AI (Gemini). I fully
understand the code.

For reference, here is the full PR chain:

1. #48249
1. #48250
1. #48449
1. #48448
1. #48516
1. #48038
1. #48450
1. #48451

Risk Level:
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional [API
Considerations](https://github.com/envoyproxy/envoy/blob/main/api/review_checklist.md):]

Signed-off-by: dmcardle <[email protected]>
@dmcardle
dmcardle force-pushed the otel-traceparent-constants branch from 9ecd313 to 00fe015 Compare November 3, 2026 16:14

@paul-r-gall paul-r-gall left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR currently includes the unmerged commits from #48449 and #48448 against main, so squash-merging it now would fold all three PRs into one commit. Since moving W3cTraceConstants into tracing_validation.h does not actually depend on #48449 or #48448, you can either cherry-pick 00fe015 directly onto main to land it standalone now, or hold this until #48449 and #48448 merge and rebase. Also please fill out the Risk Level / Testing / Docs Changes / Release Notes fields in the PR description.

@dmcardle
dmcardle force-pushed the otel-traceparent-constants branch from 00fe015 to 1a30fea Compare November 19, 2026 19:29
botengyao pushed a commit that referenced this pull request Nov 19, 2026
…Extractor (#48449)

<!--
!!!ATTENTION!!!

If you are fixing **any** crash or **any** potential security issue,
**do not
open a pull request**.

Instead, please
[open a GitHub Security
Advisory](https://github.com/envoyproxy/envoy/security/advisories/new)
(preferred). Alternatively, you may email
[email protected].

Thank you in advance for helping to keep Envoy secure.

!!!ATTENTION!!!

For an explanation of how to fill out the fields, please see the
relevant section
in
[PULL_REQUESTS.md](https://github.com/envoyproxy/envoy/blob/main/PULL_REQUESTS.md)

!!!ATTENTION!!!

Please check the [use of generative AI
policy](https://github.com/envoyproxy/envoy/blob/main/CONTRIBUTING.md?plain=1#L41).

You may use generative AI only if you fully understand the code. You
need to disclose
this usage in the PR description to ensure transparency.
-->

Commit Message: opentelemetry: Add traceparent parse/serialize methods
to SpanContextExtractor

This new override will be used by McpFilter in PR #48038.

Additional Description: This PR was created with help from generative AI
(Gemini). I fully understand the code.

For reference, here is the full PR chain:

1. #48249
1. #48250
1. #48449
1. #48448
1. #48516
1. #48038
1. #48450
1. #48451

Risk Level:
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional [API
Considerations](https://github.com/envoyproxy/envoy/blob/main/api/review_checklist.md):]

Signed-off-by: dmcardle <[email protected]>
@dmcardle
dmcardle force-pushed the otel-traceparent-constants branch from 1a30fea to c04ffbd Compare November 19, 2026 19:59
@dmcardle

Copy link
Copy Markdown
Contributor Author

Annoyingly, I think this touches some of the same files as its parent PR (#48448). I think if we get that one in first, I'll have zero conflicts to resolve.

@dmcardle
dmcardle force-pushed the otel-traceparent-constants branch 4 times, most recently from 42ba7d2 to dce0147 Compare November 24, 2026 17:43
yanavlasov pushed a commit that referenced this pull request Dec 1, 2026
This new override will be used by McpFilter in PR #48038.

Additional Description: This PR was created with help from generative AI
(Gemini). I fully understand the code.

For reference, here is the full PR chain:

1. #48249
1. #48250
1. #48449
1. #48448
1. #48516
1. #48038
1. #48450
1. #48451

Risk Level:
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional [API
Considerations](https://github.com/envoyproxy/envoy/blob/main/api/review_checklist.md):]

---------

Signed-off-by: dmcardle <[email protected]>
@dmcardle
dmcardle force-pushed the otel-traceparent-constants branch from dce0147 to e292502 Compare December 2, 2026 15:52
@dmcardle

dmcardle commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

This is next on the docket now. PTAL, @htuch!

@yanavlasov
yanavlasov merged commit 96fb25b into envoyproxy:main Dec 2, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants