kezhenxu94 commented on code in PR #9673:
URL: https://github.com/apache/skywalking/pull/9673#discussion_r978305128


##########
test/e2e-v2/cases/postgresql/postgres-exporter/docker-compose.yml:
##########
@@ -20,23 +20,42 @@ services:
     extends:
       file: ../../../script/docker-compose/base-compose.yml
       service: oap
+    entrypoint: ['sh', '-c', '/download-mysql.sh && chmod 777 
/skywalking/docker-entrypoint.sh && /skywalking/docker-entrypoint.sh']

Review Comment:
   This is only needed when we use mysql driver, but psql does not use mysql 
driver, right?
   
   ```suggestion
   ```



##########
docs/en/setup/backend/backend-postgresql-monitoring.md:
##########
@@ -44,8 +45,33 @@ PostgreSQL monitoring provides monitoring of the status and 
resources of the Pos
 | Idle Sessions |      | meter_pg_idle_sessions | The number of connections 
which state is idle,idle in transaction or idle in transaction (aborted)  | 
postgres-exporter|
 | Locks Count |      | meter_pg_locks_count | Number of locks  | 
postgres-exporter|
 
-
-## Customizations
+### Customizations
 You can customize your own metrics/expression/dashboard panel.
 The metrics definition and expression rules are found in 
`/config/otel-rules/postgresql.yaml`.
 The PostgreSQL dashboard panel configurations are found in 
`/config/ui-initialized-templates/postgresql`.
+
+## Collect sampled slow SQLs
+SkyWalking leverages [fluentbit](https://fluentbit.io/) or other log agents 
for collecting slow SQL statements from PostgreSQL.
+
+### Data flow
+1. fluentbit agent collects slow sql logs from PostgreSQL.
+2. fluentbit agent sends data to SkyWalking OAP Server using native meter APIs 
via HTTP.

Review Comment:
   ```suggestion
   2. fluentbit agent sends data to SkyWalking OAP Server using native log APIs 
via HTTP.
   ```



##########
docs/en/setup/backend/backend-postgresql-monitoring.md:
##########
@@ -44,8 +45,33 @@ PostgreSQL monitoring provides monitoring of the status and 
resources of the Pos
 | Idle Sessions |      | meter_pg_idle_sessions | The number of connections 
which state is idle,idle in transaction or idle in transaction (aborted)  | 
postgres-exporter|
 | Locks Count |      | meter_pg_locks_count | Number of locks  | 
postgres-exporter|
 
-
-## Customizations
+### Customizations
 You can customize your own metrics/expression/dashboard panel.
 The metrics definition and expression rules are found in 
`/config/otel-rules/postgresql.yaml`.
 The PostgreSQL dashboard panel configurations are found in 
`/config/ui-initialized-templates/postgresql`.
+
+## Collect sampled slow SQLs
+SkyWalking leverages [fluentbit](https://fluentbit.io/) or other log agents 
for collecting slow SQL statements from PostgreSQL.
+
+### Data flow
+1. fluentbit agent collects slow sql logs from PostgreSQL.
+2. fluentbit agent sends data to SkyWalking OAP Server using native meter APIs 
via HTTP.
+3. The SkyWalking OAP Server parses the expression with 
[LAL](../../concepts-and-designs/lal.md) to parse/extract and store the results.
+
+### Set up
+1. Set up [fluentbit](https://docs.fluentbit.io/manual/installation/docker).
+2. Config 
[fluentbit](../../../../test/e2e-v2/cases/postgresql/postgres-exporter/fluent-bit.conf)
+3. Config PostgreSQL to enable slow 
log.[example](../../../../test/e2e-v2/cases/postgresql/postgres-exporter/postgresql.conf).

Review Comment:
   ```suggestion
   3. Config PostgreSQL to enable slow log. 
[Example](../../../../test/e2e-v2/cases/postgresql/postgres-exporter/postgresql.conf).
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to