-
Notifications
You must be signed in to change notification settings - Fork 5.3k
tap: introduce HTTP tap filter #5515
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
Merged
Merged
Changes from all commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
17972da
tap: introduce HTTP tap filter
mattklein123 68a8371
release notes
mattklein123 67334c8
fix build
mattklein123 fffb471
Merge remote-tracking branch 'origin/master' into tap_mvp
mattklein123 8d20a53
Merge remote-tracking branch 'origin/master' into tap_mvp
mattklein123 426b10d
tidy fixes
mattklein123 0280cac
bump googletest to try to workaround clang-tidy warning
mattklein123 a07b7b6
Merge remote-tracking branch 'origin/master' into tap_mvp
mattklein123 e2c5c2b
comments
mattklein123 9571b05
Merge remote-tracking branch 'origin/master' into tap_mvp
mattklein123 9d6ee45
revert googletest update
mattklein123 b7259c6
Merge remote-tracking branch 'origin/master' into tap_mvp
mattklein123 4b9a669
tidy fixes
mattklein123 6f5da99
tidy fix
mattklein123 bc2d396
Merge remote-tracking branch 'origin/master' into tap_mvp
mattklein123 4941d3d
fix test flake
mattklein123 0f4f392
another try at test fix
mattklein123 149e908
fix osx
mattklein123 2193d30
Merge remote-tracking branch 'origin/master' into tap_mvp
mattklein123 ee5f0e2
Merge remote-tracking branch 'origin/master' into tap_mvp
mattklein123 eb25d48
use HTTP/2 for admin
mattklein123 407ac60
fix
mattklein123 ca0b1de
run HTTP/2 integration tests for admin
mattklein123 25d416c
Merge remote-tracking branch 'origin/master' into tap_mvp
mattklein123 7563e54
alpha
mattklein123 6888f9b
comments
mattklein123 9af7850
Merge branch 'master' into tap_mvp
mattklein123 38e22c7
Merge branch 'master' into tap_mvp
mattklein123 4b0acb4
fix release notes
mattklein123 513f74d
Merge branch 'master' into tap_mvp
mattklein123 7515eef
comments
mattklein123 937092a
rewrite tap matchers
mattklein123 6c6ac9d
Merge remote-tracking branch 'origin/master' into tap_mvp
mattklein123 7f05199
Merge branch 'master' into tap_mvp
mattklein123 433c8f1
fix release notes
mattklein123 f355b5c
fix build
mattklein123 f7d2d93
Merge remote-tracking branch 'origin/master' into tap_mvp
mattklein123 259384c
comments
mattklein123 e9abe73
use wrapper message for trace output
mattklein123 d17e284
Merge branch 'master' into tap_mvp
mattklein123 9092655
fix format
mattklein123 855506c
Merge remote-tracking branch 'origin/master' into tap_mvp
mattklein123 96e8748
comments
mattklein123 a1b20df
Merge branch 'master' into tap_mvp
mattklein123 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| import "envoy/service/tap/v2alpha/common.proto"; | ||
| import "validate/validate.proto"; | ||
|
|
||
| package envoy.admin.v2alpha; | ||
| option java_package = "io.envoyproxy.envoy.admin.v2alpha"; | ||
|
|
||
| // The /tap admin request body that is used to configure an active tap session. | ||
| message TapRequest { | ||
| // The opaque configuration ID used to match the configuration to a loaded extension. | ||
| // A tap extension configures a similar opaque ID that is used to match. | ||
| string config_id = 1 [(validate.rules).string.min_bytes = 1]; | ||
|
|
||
| // The tap configuration to load. | ||
| service.tap.v2alpha.TapConfig tap_config = 2 [(validate.rules).message.required = true]; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| load("//bazel:api_build_system.bzl", "api_proto_library_internal") | ||
|
|
||
| licenses(["notice"]) # Apache 2 | ||
|
|
||
| api_proto_library_internal( | ||
| name = "tap", | ||
| srcs = ["tap.proto"], | ||
| deps = [ | ||
| "//envoy/service/tap/v2alpha:common", | ||
| ], | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| import "envoy/service/tap/v2alpha/common.proto"; | ||
|
|
||
| import "validate/validate.proto"; | ||
|
|
||
| package envoy.config.filter.http.tap.v2alpha; | ||
| option java_package = "io.envoyproxy.envoy.config.filter.http.tap.v2alpha"; | ||
|
|
||
| // [#protodoc-title: Tap] | ||
mattklein123 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| // Tap :ref:`configuration overview <config_http_filters_tap>`. | ||
|
|
||
| // Top level configuration for the tap filter. | ||
| message Tap { | ||
| oneof config_type { | ||
| option (validate.required) = true; | ||
|
|
||
| // If specified, the tap filter will be configured via an admin handler. | ||
| AdminConfig admin_config = 1; | ||
| } | ||
| } | ||
|
|
||
| // Configuration for the admin handler. See :ref:`here <config_http_filters_tap_admin_handler>` for | ||
| // more information. | ||
| message AdminConfig { | ||
| // Opaque configuration ID. When requests are made to the admin handler, the passed opaque ID is | ||
| // matched to the configured filter opaque ID to determine which filter to configure. | ||
| string config_id = 1 [(validate.rules).string.min_bytes = 1]; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package envoy.data.tap.v2alpha; | ||
| option java_package = "io.envoyproxy.envoy.data.tap.v2alpha"; | ||
|
|
||
| import "envoy/api/v2/core/base.proto"; | ||
|
|
||
| // [#protodoc-title: HTTP tap data] | ||
|
|
||
| // A fully buffered HTTP trace message. | ||
| message HttpBufferedTrace { | ||
| // Request headers. | ||
| repeated api.v2.core.HeaderValue request_headers = 2; | ||
|
|
||
| // Response headers. | ||
| repeated api.v2.core.HeaderValue response_headers = 3; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| import "envoy/data/tap/v2alpha/http.proto"; | ||
|
|
||
| import "validate/validate.proto"; | ||
|
|
||
| package envoy.data.tap.v2alpha; | ||
| option java_package = "io.envoyproxy.envoy.data.tap.v2alpha"; | ||
|
|
||
| // [#protodoc-title: Tap data wrappers] | ||
|
|
||
| // Wrapper for all fully buffered tap traces that Envoy emits. This is required for sending traces | ||
| // over gRPC APIs or more easily persisting binary messages to files. | ||
| message BufferedTraceWrapper { | ||
| oneof trace { | ||
| option (validate.required) = true; | ||
|
|
||
| // An HTTP buffered tap trace. | ||
| HttpBufferedTrace http_buffered_trace = 1; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| load("//bazel:api_build_system.bzl", "api_proto_library_internal") | ||
|
|
||
| licenses(["notice"]) # Apache 2 | ||
|
|
||
| api_proto_library_internal( | ||
| name = "common", | ||
| srcs = ["common.proto"], | ||
| visibility = ["//visibility:public"], | ||
| deps = [ | ||
| "//envoy/api/v2/route", | ||
| ], | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| import "envoy/api/v2/route/route.proto"; | ||
|
|
||
| import "validate/validate.proto"; | ||
|
|
||
| package envoy.service.tap.v2alpha; | ||
| option java_package = "io.envoyproxy.envoy.service.tap.v2alpha"; | ||
|
|
||
| // [#protodoc-title: Common tap configuration] | ||
|
|
||
mattklein123 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| // Tap configuration. | ||
| message TapConfig { | ||
| // The match configuration. If the configuration matches the data source being tapped, a tap will | ||
| // occur, with the result written to the configured output. | ||
| MatchPredicate match_config = 1 [(validate.rules).message.required = true]; | ||
|
|
||
| // The tap output configuration. If a match configuration matches a data source being tapped, | ||
| // a tap will occur and the data will be written to the configured output. | ||
| OutputConfig output_config = 2 [(validate.rules).message.required = true]; | ||
htuch marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| // [#comment:TODO(mattklein123): Rate limiting] | ||
| } | ||
|
|
||
| // Tap match configuration. This is a recursive structure which allows complex nested match | ||
| // configurations to be built using various logical operators. | ||
| message MatchPredicate { | ||
| // A set of match configurations used for logical operations. | ||
| message MatchSet { | ||
| // The list of rules that make up the set. | ||
| repeated MatchPredicate rules = 1 [(validate.rules).repeated .min_items = 2]; | ||
| } | ||
|
|
||
| oneof rule { | ||
| option (validate.required) = true; | ||
|
|
||
| // A set that describes a logical OR. If any member of the set matches, the match configuration | ||
| // matches. | ||
| MatchSet or_match = 1; | ||
|
|
||
| // A set that describes a logical AND. If all members of the set match, the match configuration | ||
| // matches. | ||
| MatchSet and_match = 2; | ||
|
|
||
| // A negation match. The match configuration will match if the negated match condition matches. | ||
| MatchPredicate not_match = 3; | ||
|
|
||
| // The match configuration will always match. | ||
| bool any_match = 4 [(validate.rules).bool.const = true]; | ||
|
|
||
| // HTTP request match configuration. | ||
| HttpRequestMatch http_request_match = 5; | ||
|
|
||
| // HTTP response match configuration. | ||
| HttpResponseMatch http_response_match = 6; | ||
| } | ||
| } | ||
|
|
||
| // HTTP request match configuration. | ||
| message HttpRequestMatch { | ||
| // HTTP request headers to match. | ||
| repeated api.v2.route.HeaderMatcher headers = 1; | ||
| } | ||
|
|
||
| // HTTP response match configuration. | ||
| message HttpResponseMatch { | ||
| // HTTP response headers to match. | ||
| repeated api.v2.route.HeaderMatcher headers = 1; | ||
| } | ||
|
|
||
| // Tap output configuration. | ||
| message OutputConfig { | ||
| // Output sinks for tap data. Currently a single sink is allowed in the list. Once multiple | ||
| // sink types are supported this constraint will be relaxed. | ||
| repeated OutputSink sinks = 1 [(validate.rules).repeated = {min_items: 1, max_items: 1}]; | ||
|
|
||
| // [#comment:TODO(mattklein123): Output filtering. E.g., certain headers, truncated body, etc.] | ||
| } | ||
|
|
||
| // Tap output sink configuration. | ||
| message OutputSink { | ||
| oneof output_sink_type { | ||
| option (validate.required) = true; | ||
|
|
||
| // Tap output will be streamed out the :http:post:`/tap` admin endpoint. | ||
| // | ||
| // .. attention:: | ||
| // | ||
| // It is only allowed to specify the streaming admin output sink if the tap is being | ||
| // configured from the :http:post:`/tap` admin endpoint. Thus, if an extension has | ||
| // been configured to receive tap configuration from some other source (e.g., static | ||
| // file, XDS, etc.) configuring the streaming admin output type will fail. | ||
| StreamingAdminSink streaming_admin = 1; | ||
mattklein123 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
| } | ||
|
|
||
| // Streaming admin sink configuration. | ||
| message StreamingAdminSink { | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,4 +5,4 @@ Tap | |
| :glob: | ||
| :maxdepth: 2 | ||
|
|
||
| v2alpha/capture.proto | ||
| v2alpha/* | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,3 +7,4 @@ Services | |
|
|
||
| accesslog/v2/* | ||
| ratelimit/v2/* | ||
| tap/v2alpha/* | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,3 +25,4 @@ HTTP filters | |
| rbac_filter | ||
| router_filter | ||
| squash_filter | ||
| tap_filter | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.