SkyWalking 慢sql 数据获取 ,graphQL 接口 例子
所属分类 skywalking
浏览量 294
https://skywalking.apache.org/docs/main/v9.7.0/en/api/query-protocol/
Virtual-Database-Root / Virtual-Database-Service
Slow Statements (ms) 右上角 生成链接
单独打开
chrome 里查看请求和返回信息
postman
post
http://127.0.0.1:12800/graphql
query
query queryData($duration: Duration!,$expression0: String!,$entity0: Entity!) {expression0: execExpression(expression: $expression0, entity: $entity0, duration: $duration){ type results { metric { labels { key value } } values { name: id value refId: traceID } } error }}
GRAPHQL VARIABLES
{
"duration": {
"start": "2024-03-25 1725",
"end": "2024-03-25 1755",
"step": "MINUTE"
},
"expression0": "top_n(top_n_database_statement,10,des)",
"entity0": {
"serviceName": "127.0.0.1:3306",
"normal": false
}
}
{
"data": {
"expression0": {
"type": "RECORD_LIST",
"results": [
{
"metric": {
"labels": []
},
"values": [
{
"name": "UPDATE table001 SET col1 = ?, col2 = ?, col3 = ? WHERE id = ? AND valid = 1",
"value": "25",
"refId": "c0618c8f7640411b8bef2ea8465e7b7f.247.17113587369608867"
},
{
"name": "INSERT INTO ...",
"value": "24",
"refId": "c0618c8f7640411b8bef2ea8465e7b7f.247.17113587369608867"
},
{
"name": "UPDATE ...",
"value": "20",
"refId": "bd6d488bb368483786f2c26848df467b.245.17113598083048929"
},
{
"name": "insert ...",
"value": "17",
"refId": "bd6d488bb368483786f2c26848df467b.245.17113598083048929"
},
{
"name": "insert ... ",
"value": "8",
"refId": "c0618c8f7640411b8bef2ea8465e7b7f.247.17113587369608867"
},
{
"name": "SELECT ... ",
"value": "6",
"refId": "9fcda36d3fa04e79a8c00606d6537a95.158.17113592619010107"
}
]
}
],
"error": null
}
}
}
上一篇
下一篇
zookeeper3.4 prometheus监控
grafana Dashboard SpringBoot2 micrometer-prometheus
mysql监控 mysqld_exporter
西湖古诗词
SkyWalking GraphQL API 查询实例
Java实现GraphQL服务