envoy icon indicating copy to clipboard operation
envoy copied to clipboard

Postgres filter: not generating stats properly

Open shiponcs opened this issue 2 years ago • 15 comments

Title: Postgres filter: not generating stats properly

Description: I have been testing postgres filter and discovers that the stats counter are not right. As there is sandbox ready for this filter I used it so that I can show the difference more concisely. Here is the link of the sandbox.

After running this what I got in stats:

postgres.egress_postgres.errors: 0
postgres.egress_postgres.errors_error: 0
postgres.egress_postgres.errors_fatal: 0
postgres.egress_postgres.errors_panic: 0
postgres.egress_postgres.errors_unknown: 0
postgres.egress_postgres.messages: 52
postgres.egress_postgres.messages_backend: 45
postgres.egress_postgres.messages_frontend: 7
postgres.egress_postgres.messages_unknown: 0
postgres.egress_postgres.notices: 0
postgres.egress_postgres.notices_debug: 0
postgres.egress_postgres.notices_info: 0
postgres.egress_postgres.notices_log: 0
postgres.egress_postgres.notices_notice: 0
postgres.egress_postgres.notices_unknown: 0
postgres.egress_postgres.notices_warning: 0
postgres.egress_postgres.sessions: 2
postgres.egress_postgres.sessions_encrypted: 0
postgres.egress_postgres.sessions_terminated_ssl: 0
postgres.egress_postgres.sessions_unencrypted: 2
postgres.egress_postgres.statements: 5
postgres.egress_postgres.statements_delete: 0
postgres.egress_postgres.statements_insert: 1
postgres.egress_postgres.statements_other: 2
postgres.egress_postgres.statements_parse_error: 5
postgres.egress_postgres.statements_parsed: 1
postgres.egress_postgres.statements_select: 1
postgres.egress_postgres.statements_update: 1
postgres.egress_postgres.transactions: 5
postgres.egress_postgres.transactions_commit: 5
postgres.egress_postgres.transactions_rollback: 0

But I was supposed to get:

postgres.egress_postgres.errors: 1
postgres.egress_postgres.errors_error: 1
postgres.egress_postgres.errors_fatal: 0
postgres.egress_postgres.errors_panic: 0
postgres.egress_postgres.errors_unknown: 0
postgres.egress_postgres.messages: 42
postgres.egress_postgres.messages_backend: 32
postgres.egress_postgres.messages_frontend: 10
postgres.egress_postgres.messages_unknown: 0
postgres.egress_postgres.notices: 0
postgres.egress_postgres.notices_debug: 0
postgres.egress_postgres.notices_info: 0
postgres.egress_postgres.notices_log: 0
postgres.egress_postgres.notices_notice: 0
postgres.egress_postgres.notices_unknown: 0
postgres.egress_postgres.notices_warning: 0
postgres.egress_postgres.sessions: 1
postgres.egress_postgres.sessions_encrypted: 0
postgres.egress_postgres.sessions_unencrypted: 1
postgres.egress_postgres.statements: 7
postgres.egress_postgres.statements_delete: 1
postgres.egress_postgres.statements_insert: 2
postgres.egress_postgres.statements_other: 2
postgres.egress_postgres.statements_parse_error: 4
postgres.egress_postgres.statements_parsed: 4
postgres.egress_postgres.statements_select: 1
postgres.egress_postgres.statements_update: 1
postgres.egress_postgres.transactions: 7
postgres.egress_postgres.transactions_commit: 7
postgres.egress_postgres.transactions_rollback: 0

I have tested it multiple times by replacing the envoy proxy image with some earlier versions, but the problem retains. It is a real issue.

Relevant Links:

  • https://www.envoyproxy.io/docs/envoy/latest/configuration/listeners/network_filters/postgres_proxy_filter#config-network-filters-postgres-proxy

shiponcs avatar Nov 17 '23 14:11 shiponcs

@fabriziomello @cpakulski

htuch avatar Nov 20 '23 04:11 htuch

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.

github-actions[bot] avatar Dec 20 '23 08:12 github-actions[bot]

@shiponcs seems our sandobox docs page is wrong because in Step 2: Issue commands using psql we do:

  1. connect to the database (inc 1 session),
  2. create a database (inc 1 statement),
  3. connect to the created database (inc 1 sessions)
  4. ...

Executing only the first three steps we should end up with 2 sessions and 1 statement, and in the docs we see only 1 session in postgres.egress_postgres.sessions so definitely the output mentioned in Step 3: Check egress stats is definetely wrong.

fabriziomello avatar Dec 20 '23 11:12 fabriziomello

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.

github-actions[bot] avatar Jan 19 '24 16:01 github-actions[bot]

WIP.

cpakulski avatar Jan 20 '24 00:01 cpakulski

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.

github-actions[bot] avatar Feb 19 '24 08:02 github-actions[bot]

This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted" or "no stalebot". Thank you for your contributions.

github-actions[bot] avatar Feb 26 '24 12:02 github-actions[bot]

@htuch can u please reopen this issue. Now we have https://github.com/envoyproxy/envoy/pull/31850 merged I'll send a PR to fix this sandbox mistakes.

fabriziomello avatar Feb 26 '24 13:02 fabriziomello

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.

github-actions[bot] avatar Mar 28 '24 08:03 github-actions[bot]

CC: @fabriziomello What is the status here?

shiponcs avatar Mar 28 '24 08:03 shiponcs

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.

github-actions[bot] avatar Apr 27 '24 16:04 github-actions[bot]

Wip

fabriziomello avatar Apr 28 '24 01:04 fabriziomello

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.

github-actions[bot] avatar May 28 '24 04:05 github-actions[bot]

Wip

fabriziomello avatar May 28 '24 21:05 fabriziomello

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.

github-actions[bot] avatar Jun 28 '24 00:06 github-actions[bot]

This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted" or "no stalebot". Thank you for your contributions.

github-actions[bot] avatar Jul 05 '24 00:07 github-actions[bot]