filter: postgres statistics network filter#10642
Merged
lizan merged 58 commits intoenvoyproxy:masterfrom Apr 21, 2020
Merged
Conversation
Member
|
@cpakulski can you merge master to resolve conflicts? |
Signed-off-by: Dhi Aurrahman <dio@tetrate.io>
…ce code. Signed-off-by: Christoph Pakulski <christoph@tetrate.io>
… messages spread over more than one buffer. Added unit tests for parsing single, multiple and large messages. Signed-off-by: Christoph Pakulski <christoph@tetrate.io>
Signed-off-by: Christoph Pakulski <christoph@tetrate.io>
Added hash map to find the message type and related actions based on the first byte of the message. Signed-off-by: Christoph Pakulski <christoph@tetrate.io>
Signed-off-by: Fabrízio de Royes Mello <fabrizio@ongres.com>
Signed-off-by: Christoph Pakulski <christoph@tetrate.io>
Signed-off-by: Christoph Pakulski <christoph@tetrate.io>
successful authentication. Other R messages are ignored. Signed-off-by: Christoph Pakulski <christoph@tetrate.io>
Formatted code with format and spell checkers. Signed-off-by: Christoph Pakulski <christoph@tetrate.io>
Signed-off-by: Christoph Pakulski <christoph@tetrate.io>
Signed-off-by: Christoph Pakulski <christoph@tetrate.io>
configuration. Signed-off-by: Christoph Pakulski <christoph@tetrate.io>
INFO: From ProtoGenValidateCcGenerate external/envoy_api/envoy/config/filter/network/postgresql_proxy/v2alpha/postgresql_proxy.pb.h: envoy/config/filter/network/postgresql_proxy/v2alpha/postgresql_proxy.proto: warning: Import udpa/annotations/migrate.proto but not used. envoy/config/filter/network/postgresql_proxy/v2alpha/postgresql_proxy.proto: warning: Import validate/validate.proto but not used. envoy/config/filter/network/postgresql_proxy/v2alpha/postgresql_proxy.proto: warning: Import udpa/annotations/status.proto but not used. INFO: From ProtoGenValidateCcGenerate external/envoy_api/envoy/extensions/filters/network/postgresql_proxy/v3alpha/postgresql_proxy.pb.h: envoy/extensions/filters/network/postgresql_proxy/v3alpha/postgresql_proxy.proto: warning: Import udpa/annotations/versioning.proto but not used. envoy/extensions/filters/network/postgresql_proxy/v3alpha/postgresql_proxy.proto: warning: Import validate/validate.proto but not used. envoy/extensions/filters/network/postgresql_proxy/v3alpha/postgresql_proxy.proto: warning: Import udpa/annotations/status.proto but not used. Signed-off-by: Fabrízio de Royes Mello <fabrizio@ongres.com>
This reverts commit 83bb9b4. Signed-off-by: Fabrízio de Royes Mello <fabrizio@ongres.com>
Signed-off-by: Fabrízio de Royes Mello <fabrizio@ongres.com>
…d messages. Signed-off-by: Christoph Pakulski <christoph@tetrate.io>
Moved logic from multi-level if..else to hash map. Updated documention. Signed-off-by: Christoph Pakulski <christoph@tetrate.io>
Signed-off-by: Christoph Pakulski <christoph@tetrate.io>
Signed-off-by: Christoph Pakulski <christoph@tetrate.io>
- sessions: Number of successful logins - sessions_encrypted: Number of times the proxy detected encrypted sessions - sessions_unencrypted: Number of messages indicating unencrypted successful login Signed-off-by: Fabrízio de Royes Mello <fabrizio@ongres.com>
- errors: Total number of backend decoded errors (ErrorResponse) - errors_error: Number of ERROR severity errors detected by the filter - errors_fatal: Number of FATAL severity errors detected by the filter - errors_panic: Number of PANIC severity errors detected by the filter - errors_unknown: Number of severity errors that filter can't detected Signed-off-by: Fabrízio de Royes Mello <fabrizio@ongres.com>
Signed-off-by: Christoph Pakulski <christoph@tetrate.io>
to use enums, not separate methods. Error and Notice parser searches for S and V prefixes. Signed-off-by: Christoph Pakulski <christoph@tetrate.io>
for keywords with S and V prefixes. Signed-off-by: Christoph Pakulski <christoph@tetrate.io>
Signed-off-by: Christoph Pakulski <christoph@tetrate.io>
- file names - directory names - variables and class names - config items - documentation Signed-off-by: Christoph Pakulski <christoph@tetrate.io>
Signed-off-by: Christoph Pakulski <christoph@tetrate.io>
Signed-off-by: Christoph Pakulski <christoph@tetrate.io>
Shikugawa
reviewed
Apr 15, 2020
source/extensions/filters/network/postgres_proxy/postgres_decoder.h
Outdated
Show resolved
Hide resolved
lizan
reviewed
Apr 15, 2020
Member
lizan
left a comment
There was a problem hiding this comment.
Thanks, structurally looks good. Mostly C++ style/readability nits.
source/extensions/filters/network/postgres_proxy/postgres_decoder.h
Outdated
Show resolved
Hide resolved
source/extensions/filters/network/postgres_proxy/postgres_decoder.h
Outdated
Show resolved
Hide resolved
source/extensions/filters/network/postgres_proxy/postgres_decoder.h
Outdated
Show resolved
Hide resolved
test/extensions/filters/network/postgres_proxy/postgres_filter_test.cc
Outdated
Show resolved
Hide resolved
test/extensions/filters/network/postgres_proxy/postgres_filter_test.cc
Outdated
Show resolved
Hide resolved
test/extensions/filters/network/postgres_proxy/postgres_filter_test.cc
Outdated
Show resolved
Hide resolved
source/extensions/filters/network/postgres_proxy/postgres_decoder.cc
Outdated
Show resolved
Hide resolved
source/extensions/filters/network/postgres_proxy/postgres_decoder.h
Outdated
Show resolved
Hide resolved
Signed-off-by: Fabrízio de Royes Mello <fabrizio@ongres.com>
Use writeBEInt templates to write integers in network format to buffer. Signed-off-by: Christoph Pakulski <christoph@tetrate.io>
… into postgresql-cp Signed-off-by: Christoph Pakulski <christoph@tetrate.io>
Member
|
/lgtm api |
lizan
previously approved these changes
Apr 20, 2020
Member
lizan
left a comment
There was a problem hiding this comment.
LGTM, can you merge master to resolve conflict and fix CI?
Contributor
|
@lizan now all CI tests are ok. |
lizan
approved these changes
Apr 21, 2020
penguingao
pushed a commit
to penguingao/envoy
that referenced
this pull request
Apr 22, 2020
Description: The filter implements decoding postgres wire protocol and parses messages exchanged between postgres server and client. Based on the decoded messages the filter generates statistics (counters) indicating how many messages of a specific type were exchanged. envoyproxy#9107 Risk Level: Low: The filter is implemented as extension and the code is not executed unless inserted into filter chain. Testing: Added unit and integration tests. Docs Changes: Yes - added architecture overview chapter and configuration specific sections Release Notes: Yes Signed-off-by: Christoph Pakulski <christoph@tetrate.io> Co-authored-by: Dhi Aurrahman <dio@tetrate.io> Co-authored-by: Fabrízio de Royes Mello <fabrizio@ongres.com> Signed-off-by: pengg <pengg@google.com>
|
Typo: sesions |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description:
The filter implements decoding postgres wire protocol and parses messages exchanged between postgres server and client. Based on the decoded messages the filter generates statistics (counters) indicating how many messages of a specific type were exchanged.
Risk Level:
Low: The filter is implemented as extension and the code is not executed unless inserted into filter chain.
Testing:
Added unit and integration tests.
Docs Changes:
Yes - added architecture overview chapter and configuration specific sections
Release Notes:
Yes
Partially fixes: #9107