Skip to content

WIP - Dynamically configurable Tap filter#7194

Closed
yuval-k wants to merge 13 commits intoenvoyproxy:masterfrom
yuval-k:grpc-sink
Closed

WIP - Dynamically configurable Tap filter#7194
yuval-k wants to merge 13 commits intoenvoyproxy:masterfrom
yuval-k:grpc-sink

Conversation

@yuval-k
Copy link
Copy Markdown
Contributor

@yuval-k yuval-k commented Jun 6, 2019

A draft PR for making the tap filter more dynamic. This is PR is not intended to be merged - it is intended for a high-level review, as the features will be broken down via individual small PRs.

The features are covered here are:

  1. A streaming GRPC sink in addition to the admin and file sinks.
  2. Enabled runtime variable (for gradual roll-out \ sampling).
  3. Matching on the destination cluster in addition to headers
  4. More information on the trace: destination cluster and host, Metadata in the filter's namespace that's on the cluster and host.
  5. Dynamic configuration via XDS (allows the filter to be configured from a control plane)

Risk Level: Low-Medium (mostly new opt-in functionality; no core changes)
Testing: Will be added in the per feature PRs.

Part of #6110

@mattklein123 mattklein123 self-assigned this Jun 6, 2019
Copy link
Copy Markdown
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

Thanks for working on this. This is going to be awesome. Can we please start with a full cleanup of the APIs with docs, etc. and then we can go from there? Thank you!

/wait

// Common configuration for all tap extensions.
message CommonExtensionConfig {

message TDSConfig {
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.

Note that @htuch has either taken "TDS" for the runTime Discovery Service. I think we are at the limits of our 3-letter acronyms. Can you maybe just call it "TapDS" or something?

// if trace is streaming, this may only be sent once.
Destination destination = 5;

envoy.api.v2.core.Address downstream_remote_address = 6;
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.

This may not always apply if the tap is for an upstream connection. Can we future proof with this with maybe a message covering downstream connection info, upstream connection info, etc.?

message TraceWrapper {
message Destination {
string cluster_name = 1;
google.protobuf.Struct cluster_metadata = 2;
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.

Docs? How are these set?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

i added more callbacks to HttpPerRequestTapper to support this. cluster_metadata is all the meatadata attached to the cluster under the filter's name

// a tap will occur and the data will be written to the configured output.
OutputConfig output_config = 2 [(validate.rules).message.required = true];

envoy.api.v2.core.RuntimeFractionalPercent filter_enabled = 3;
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.

Docs? What is this doing specifically? Name?

Copy link
Copy Markdown
Contributor Author

@yuval-k yuval-k Jun 13, 2019

Choose a reason for hiding this comment

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

similar to other filters, it allows to gradually enable the filter
i.e the % of requests for which the filter a match is even attempted.

// HTTP response trailers match configuration.
HttpHeadersMatch http_response_trailers_match = 8;

ClusterMatch destination_cluster_match = 9;
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.

How is this populated/matched?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

right now it checks that the destination cluster name is one of those defined in ClusterMatch.
I can change ClusterMatch to have a StringMatcher for more flexibility in matching.

My thinking here was to allow limiting taps to specific services.

@yuval-k
Copy link
Copy Markdown
Contributor Author

yuval-k commented Jun 13, 2019

@mattklein123 should I start a new PR with just the APIs? or change this one?
I slightly prefer to start a new one with just the api and keep this one as a reference.

@mattklein123
Copy link
Copy Markdown
Member

@yuval-k yeah let's just do an API PR and nail that down. That would be great.

@yuval-k yuval-k mentioned this pull request Jun 14, 2019
@stale
Copy link
Copy Markdown

stale bot commented Jun 20, 2019

This pull request has been automatically marked as stale because it has not had activity in the last 7 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@stale stale bot added the stale stalebot believes this issue/PR has not been touched recently label Jun 20, 2019
@stale
Copy link
Copy Markdown

stale bot commented Jun 27, 2019

This pull request has been automatically closed because it has not had activity in the last 14 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@stale stale bot closed this Jun 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale stalebot believes this issue/PR has not been touched recently waiting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants