dm同步监控问题

你是直接添加了一个表达式吗?去掉参数可以吗?

是的 当source_id 用表达式的时候。就不对, source_id直接写死。就是正常的。不知道为什么不能通过"$source"获取 source_id?

可以去 prometheus的配置文件中,查看该 task 对应的 source id 配置是否正确。

这个是数据源mysql source,promethus不用做这个配置吧,我的其他task任务是正常的。
这几个任务 不正常

嗯,我搞混淆了,只会记录 instance的,能发一下,正常的 task 该监控指标的 panel json 吗

{
“cacheTimeout”: null,
“colorBackground”: false,
“colorValue”: false,
“colors”: [
#299c46”,
“rgba(237, 129, 40, 0.89)”,
#d44a3a
],
“datasource”: “dm-test”,
“description”: “The current state of the subtask in the instance”,
“format”: “none”,
“gauge”: {
“maxValue”: 100,
“minValue”: 0,
“show”: false,
“thresholdLabels”: false,
“thresholdMarkers”: true
},
“gridPos”: {
“h”: 7,
“w”: 24,
“x”: 0,
“y”: 18
},
“id”: 40,
“interval”: null,
“links”: [],
“mappingType”: 1,
“mappingTypes”: [
{
“name”: “value to text”,
“value”: 1
},
{
“name”: “range to text”,
“value”: 2
}
],
“maxDataPoints”: 100,
“nullPointMode”: “connected”,
“nullText”: null,
“postfix”: “”,
“postfixFontSize”: “50%”,
“prefix”: “”,
“prefixFontSize”: “50%”,
“rangeMaps”: [
{
“from”: “null”,
“text”: “N/A”,
“to”: “null”
}
],
“sparkline”: {
“fillColor”: “rgba(31, 118, 189, 0.18)”,
“full”: false,
“lineColor”: “rgb(31, 120, 193)”,
“show”: false
},
“tableColumn”: “”,
“targets”: [
{
“expr”: “dm_worker_task_state{task=”$task",source_id="$source"}",
“format”: “time_series”,
“intervalFactor”: 2,
“refId”: “A”
}
],
“thresholds”: “”,
“title”: “task state”,
“type”: “singlestat”,
“valueFontSize”: “80%”,
“valueMaps”: [
{
“op”: “=”,
“text”: “invalid”,
“value”: “0”
},
{
“op”: “=”,
“text”: “new”,
“value”: “1”
},
{
“op”: “=”,
“text”: “running”,
“value”: “2”
},
{
“op”: “=”,
“text”: “paused”,
“value”: “3”
},
{
“op”: “=”,
“text”: “stopped”,
“value”: “4”
},
{
“op”: “=”,
“text”: “finished”,
“value”: “5”
}
],
“valueName”: “current”
}

上面这个是正常的

好像和不正常的json 是一样的

部署的 dm 版本是多少,tiup 版本是多少? 监控中,应该有多个 task state 的指标,其他的正常吗? 另外,帮把上面的表达式,改成如下试试: “expr”: “dm_worker_task_state{task=”$task",source_id="$source"}"

Cluster type: dm
Cluster name: dm-test
Cluster version: v2.0.0-rc.2

tiup也应该是最新的吧 到现在才安装半个月

这个表达式 和我上面发的json 是一样的吧。

应该有多个 task state 的指标,其他的正常吗?
其他指标也不是正常的 基本都是这样

1、现在主要是怀疑 sourceid 变量获取的有问题,可以检查一下 如图所示。!


2、如果上面没问题,帮把表达式改成 “expr”: “dm_worker_task_state{task=”$task",source_id=“$source_id”}"

这样的,

改了source_id 更不行了

这样

1、问一下,现在有哪些指标是 正常的?
2、帮在 panel json 中的的 source 前面添加 ~查看一下效果,eg: source_id=~"$source"