-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
filter: postgres statistics network filter #10642
Conversation
@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>
source/extensions/filters/network/postgres_proxy/postgres_decoder.h
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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>
/lgtm api |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, can you merge master to resolve conflict and fix CI?
@lizan now all CI tests are ok. |
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 |
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