-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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 6 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,18 @@ | ||
| 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"; | ||
| option java_multiple_files = true; | ||
|
|
||
| // 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,30 @@ | ||
| 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"; | ||
| option java_multiple_files = true; | ||
|
|
||
| // [#protodoc-title: Tap] | ||
|
mattklein123 marked this conversation as 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package envoy.data.tap.v2alpha; | ||
| option java_package = "io.envoyproxy.envoy.data.tap.v2alpha"; | ||
| option java_multiple_files = true; | ||
|
|
||
| // [#protodoc-title: HTTP tap data] | ||
|
|
||
| // A fully buffered HTTP trace message. | ||
| message HttpBufferedTrace { | ||
| message Header { | ||
|
mattklein123 marked this conversation as resolved.
Outdated
|
||
| // Header key. | ||
| string key = 1; | ||
|
|
||
| // Header value. | ||
| string value = 2; | ||
| } | ||
|
|
||
| // The match ID specified in the :ref:`match_id | ||
| // <envoy_api_field_service.tap.v2alpha.MatchConfig.match_id>` field. | ||
| string match_id = 1; | ||
|
|
||
| // Request headers. | ||
| repeated Header request_headers = 2; | ||
|
|
||
| // Response headers. | ||
| repeated Header 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,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,88 @@ | ||
| 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"; | ||
| option java_multiple_files = true; | ||
|
|
||
| // [#protodoc-title: Common tap configuration] | ||
|
|
||
|
mattklein123 marked this conversation as resolved.
|
||
| // Tap configuration. | ||
| message TapConfig { | ||
| // The match conditions. One or more match configurations can be specified. If any of them | ||
| // match the data source being tapped, a tap will occur, with the result written to the | ||
| // configured output. | ||
| repeated MatchConfig match_configs = 1 [(validate.rules).repeated .min_items = 1]; | ||
|
|
||
| // 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.
|
||
|
|
||
| // [#comment:TODO(mattklein123): Rate limiting] | ||
| } | ||
|
|
||
| // Tap match configuration. Within a single match configuration, all conditions are evaluated as | ||
|
mattklein123 marked this conversation as resolved.
Outdated
|
||
| // a logical AND. Logical OR matching can be implemented via multiple match configurations in the | ||
| // top level tap configuration. | ||
| message MatchConfig { | ||
|
mattklein123 marked this conversation as resolved.
Outdated
|
||
| // Match ID used for correlating tap data with the match that produced it. | ||
| string match_id = 1 [(validate.rules).string.min_bytes = 1]; | ||
|
|
||
| // HTTP match configuration. Only useful for HTTP aware tap extensions such as the | ||
| // :ref:`HTTP tap filter <config_http_filters_tap>`. | ||
| HttpMatchConfig http_match_config = 2; | ||
| } | ||
|
|
||
| // HTTP match configuration. | ||
| message HttpMatchConfig { | ||
| // HTTP request match configuration. | ||
| HttpRequestMatchConfig request_match_config = 1; | ||
|
|
||
| // HTTP response match configuration. | ||
| HttpResponseMatchConfig response_match_config = 2; | ||
| } | ||
|
|
||
| // HTTP request match configuration. | ||
| message HttpRequestMatchConfig { | ||
| // HTTP request headers to match. | ||
| repeated api.v2.route.HeaderMatcher headers = 1; | ||
| } | ||
|
|
||
| // HTTP response match configuration. | ||
| message HttpResponseMatchConfig { | ||
| // 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.
|
||
| } | ||
| } | ||
|
|
||
| // 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.