wu-sheng commented on code in PR #9575:
URL: https://github.com/apache/skywalking/pull/9575#discussion_r964947369


##########
docs/en/concepts-and-designs/lal.md:
##########
@@ -240,6 +240,61 @@ metrics:
     exp: http_response_time.sum(['le', 'service', 
'instance']).increase('PT5M').histogram().histogram_percentile([50,70,90,99])
 ```
 
+### SlowSql
+
+SlowSql aims to convert LogData to DatabaseSlowStatement. It extracts data 
from `parsed` result and save them as DatabaseSlowStatement. SlowSql will not 
abort or edit logs, you can use other LAL for further processing.
+We need to set a log tag("isSlowSql") to enable it. If logs sent to OAP does 
not have this tag, slowSql processing will be skipped.The example to set the 
tag is following:
+``` json
+[{"tags":{"data":[{"key":"isSlowSql","value":"true"}]},"body":{"json":{"json":"{\"time\":\"20220906153959\",\"id\":\"cb92c1a5b-2691e-fb2f-457a-9c72a392d9ed\",\"service\":\"root[root]@[localhost]\",\"statement\":\"select
 
sleep(2);\",\"layer\":\"MYSQL\",\"query_time\":2000}"}},"service":"root[root]@[localhost]"}]
+```
+
+- `serviceName`
+
+`serviceName` extracts the service name from the `parsed` result, and set it 
into the `DatabaseSlowStatement`, which will be persisted (if
+not dropped) and is used to associate with TopNDatabaseStatement and service.
+
+- `timeBucket`
+
+`timeBucket` extracts the time bucket from the `parsed` result, and set it 
into the `DatabaseSlowStatement`, which will be
+persisted (if not dropped) and is used to associate with TopNDatabaseStatement.
+
+- `statement`
+
+`statement` extracts the time bucket from the `parsed` result, and set it into 
the `DatabaseSlowStatement`, which will be
+persisted (if not dropped) and is used to associate with TopNDatabaseStatement.
+
+- `latency`
+
+`latency` extracts the latency from the `parsed` result, and set it into the 
`DatabaseSlowStatement`, which will be
+persisted (if not dropped) and is used to associate with TopNDatabaseStatement.
+
+- `id`
+
+`id` extracts the id from the `parsed` result, and set it into the 
`DatabaseSlowStatement`, which will be persisted (if not
+dropped) and is used to associate with TopNDatabaseStatement.
+
+- `layer`
+
+`layer` extracts the 
[layer](../../../oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/Layer.java)
 from the `parsed` result, and set it into the `DatabaseSlowStatement`, which 
will be persisted (if
+not dropped) and is used to associate with service.
+
+Example :
+
+```groovy
+filter {
+        json{
+        }
+        slowSql {
+          serviceName parsed.service as String
+          id parsed.id as String
+          statement parsed.statement as String
+          latency parsed.query_time as Long
+          layer parsed.layer as String
+          timeBucket parsed.time as Long
+        }
+      }

Review Comment:
   <img width="545" alt="image" 
src="https://user-images.githubusercontent.com/5441976/188909382-51f3235e-e8ee-4298-a3dd-a06ea8793963.png";>
   
   I noticed this is not well formated.



-- 
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