Skip to content
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

tracer: add CEL sampler to OpenTelemetry #38182

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

zirain
Copy link
Member

@zirain zirain commented Jan 24, 2025

Commit Message: add CEL sampler to OpenTelemetry tracer
Additional Description: This is initial PR, there are plans to support request headers in the next step, and any suggestions are welcome. cc @wbpcode
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:]

Signed-off-by: zirain <[email protected]>
@zirain zirain requested a review from yanavlasov as a code owner January 24, 2025 12:17
@repokitteh-read-only repokitteh-read-only bot added api deps Approval required for changes to Envoy's external dependencies labels Jan 24, 2025
Copy link

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to (api/envoy/|docs/root/api-docs/).
envoyproxy/api-shepherds assignee is @wbpcode
CC @envoyproxy/api-watchers: FYI only for changes made to (api/envoy/|docs/root/api-docs/).
CC @envoyproxy/dependency-shepherds: Your approval is needed for changes made to (bazel/.*repos.*\.bzl)|(bazel/dependency_imports\.bzl)|(api/bazel/.*\.bzl)|(.*/requirements\.txt)|(.*\.patch).
envoyproxy/dependency-shepherds assignee is @moderation

🐱

Caused by: #38182 was opened by zirain.

see: more, trace.

Signed-off-by: zirain <[email protected]>
Signed-off-by: zirain <[email protected]>
Signed-off-by: zirain <[email protected]>
Signed-off-by: zirain <[email protected]>
@moderation
Copy link
Contributor

/lgtm deps

Metadata changes only

@repokitteh-read-only repokitteh-read-only bot removed the deps Approval required for changes to Envoy's external dependencies label Jan 26, 2025
@alyssawilk
Copy link
Contributor

ping @wbpcode

@adisuissa
Copy link
Contributor

@wbpcode PTAL

Copy link
Member

@wbpcode wbpcode left a comment

Choose a reason for hiding this comment

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

I am basically fine to the API. Please ensure the code owners are willing to maintain this new extension. Thanks.

@wbpcode
Copy link
Member

wbpcode commented Feb 5, 2025

@wbpcode
Copy link
Member

wbpcode commented Feb 5, 2025

/wait-any

@repokitteh-read-only repokitteh-read-only bot added deps Approval required for changes to Envoy's external dependencies and removed waiting:any labels Feb 6, 2025
Copy link
Contributor

@yanavlasov yanavlasov left a comment

Choose a reason for hiding this comment

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

/wait-any

Signed-off-by: zirain <[email protected]>
Signed-off-by: zirain <[email protected]>
Signed-off-by: zirain <[email protected]>
Signed-off-by: zirain <[email protected]>
@zirain zirain requested review from yanavlasov and wbpcode February 7, 2025 03:10
Copy link
Contributor

@yanavlasov yanavlasov left a comment

Choose a reason for hiding this comment

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

/wait-any


message CELSamplerConfig {
// Expression that, when evaluated, will be used to make sample decision.
string expression = 1 [(validate.rules).string = {min_len: 1}];
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, just noticed. Elsewhere in Envoy we are using this proto https://github.com/cncf/xds/blob/main/xds/type/v3/cel.proto for CEL expressions.

The reason is that when control plane is used, the CEL expression will be parsed by the control plane and errors are detected before it reaches Envoy.

I think it is also useful to have an option to just write the expression as is for simpler cases, where control plane is not used.

My suggestion is to use the xds.type.v3.CelExpression here, instead of bare string and add bare string to the xds.type.v3.CelExpression proto.

I know this is more work, but otherwise this feature would be difficult to use with complex control planes.

@htuch

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

xref: cncf/xds#115

Copy link
Contributor

Choose a reason for hiding this comment

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

should we do same thing for https://github.com/envoyproxy/envoy/blob/main/api/envoy/extensions/access_loggers/filters/cel/v3/cel.proto?

Yes, we should. It was not done quite right.

Thanks for driving cncf/xds#115 I think this is the right approach to configure CEL

@yanavlasov
Copy link
Contributor

/wait-any

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api deps Approval required for changes to Envoy's external dependencies waiting:any
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants