Compare commits
22 Commits
docker_rel
...
dashboard
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8358ab4b81 | ||
|
|
0fc6cb8ef2 | ||
|
|
e1ab013c45 | ||
|
|
d984ad8bf4 | ||
|
|
86fe3c7c43 | ||
|
|
0f4478318e | ||
|
|
c0d0eb0e69 | ||
|
|
b62762b2e6 | ||
|
|
810ca0e469 | ||
|
|
33e3b224b9 | ||
|
|
24d7b2b1bf | ||
|
|
1d5ff1b28d | ||
|
|
ed5c8c5758 | ||
|
|
01f7860900 | ||
|
|
a6bb03c8ba | ||
|
|
e9150b2ae0 | ||
|
|
30d1ebd808 | ||
|
|
2f69d92055 | ||
|
|
deeb40b4a0 | ||
|
|
37f68fd52b | ||
|
|
73828e50b5 | ||
|
|
7e73850117 |
1
.gitignore
vendored
@@ -41,6 +41,7 @@ _test
|
||||
/docker/pub
|
||||
/docker/n9e
|
||||
/docker/mysqldata
|
||||
/docker/experience_pg_vm/pgdata
|
||||
/etc.local
|
||||
|
||||
.alerts
|
||||
|
||||
@@ -6,6 +6,7 @@ ADD n9e /app/
|
||||
ADD etc /app/
|
||||
ADD integrations /app/integrations/
|
||||
ADD --chmod=755 https://github.com/ufoscout/docker-compose-wait/releases/download/2.11.0/wait_x86_64 /wait
|
||||
RUN chmod +x /wait
|
||||
ADD pub /app/pub/
|
||||
|
||||
EXPOSE 17000
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
FROM flashcatcloud/toolbox:v0.0.1 as toolbox
|
||||
FROM --platform=$TARGETPLATFORM python:3-slim
|
||||
|
||||
|
||||
@@ -5,8 +6,8 @@ WORKDIR /app
|
||||
ADD n9e /app/
|
||||
ADD etc /app/
|
||||
ADD integrations /app/integrations/
|
||||
ADD --chmod=755 https://github.com/ufoscout/docker-compose-wait/releases/download/2.11.0/wait_aarch64 /wait
|
||||
ADD pub /app/pub/
|
||||
COPY --chmod=755 --from=toolbox /toolbox/wait_aarch64 /wait
|
||||
|
||||
EXPOSE 17000
|
||||
|
||||
|
||||
@@ -251,7 +251,6 @@ COMMENT ON COLUMN chart.group_id IS 'chart group id';
|
||||
CREATE TABLE chart_share (
|
||||
id bigserial,
|
||||
cluster varchar(128) not null,
|
||||
dashboard_id bigint not null,
|
||||
datasource_id bigint not null default 0,
|
||||
configs text,
|
||||
create_at bigint not null default 0,
|
||||
|
||||
@@ -167,7 +167,7 @@ CREATE TABLE `busi_group_member` (
|
||||
KEY (`user_group_id`)
|
||||
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4;
|
||||
|
||||
insert into busi_group_member(busi_group_id, user_group_id, perm_flag) values(1, 1, "rw");
|
||||
insert into busi_group_member(busi_group_id, user_group_id, perm_flag) values(1, 1, 'rw');
|
||||
|
||||
-- for dashboard new version
|
||||
CREATE TABLE `board` (
|
||||
@@ -334,7 +334,7 @@ CREATE TABLE `alert_subscribe` (
|
||||
KEY (`update_at`),
|
||||
KEY (`group_id`)
|
||||
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4;
|
||||
|
||||
|
||||
CREATE TABLE `target` (
|
||||
`id` bigint unsigned not null auto_increment,
|
||||
`group_id` bigint not null default 0 comment 'busi group id',
|
||||
@@ -383,7 +383,7 @@ CREATE TABLE `metric_view` (
|
||||
) ENGINE=InnoDB DEFAULT CHARSET = utf8mb4;
|
||||
|
||||
insert into metric_view(name, cate, configs) values('Host View', 0, '{"filters":[{"oper":"=","label":"__name__","value":"cpu_usage_idle"}],"dynamicLabels":[],"dimensionLabels":[{"label":"ident","value":""}]}');
|
||||
|
||||
|
||||
CREATE TABLE `recording_rule` (
|
||||
`id` bigint unsigned not null auto_increment,
|
||||
`group_id` bigint not null default '0' comment 'group_id',
|
||||
@@ -582,15 +582,15 @@ CREATE TABLE `datasource`
|
||||
`updated_by` varchar(64) not null default '',
|
||||
UNIQUE KEY (`name`),
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4;
|
||||
|
||||
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4;
|
||||
|
||||
CREATE TABLE `builtin_cate` (
|
||||
`id` bigint unsigned not null auto_increment,
|
||||
`name` varchar(191) not null,
|
||||
`user_id` bigint not null default 0,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4;
|
||||
|
||||
|
||||
CREATE TABLE `notify_tpl` (
|
||||
`id` bigint unsigned not null auto_increment,
|
||||
`channel` varchar(32) not null,
|
||||
|
||||
5
fe.sh
@@ -8,8 +8,3 @@ curl -o n9e-fe-${VERSION}.tar.gz -L https://github.com/n9e/fe/releases/download/
|
||||
tar zxvf n9e-fe-${VERSION}.tar.gz
|
||||
|
||||
cp ./docker/initsql/a-n9e.sql n9e.sql
|
||||
|
||||
TAG=$(curl -sX GET https://api.github.com/repos/ccfos/nightingale/releases/latest | awk '/tag_name/{print $4;exit}' FS='[""]')
|
||||
VERSION=$(echo $TAG)
|
||||
VERSION=${VERSION/v/}
|
||||
sed -i "s/nightingale:latest/nightingale:${VERSION}/g" ./docker/docker-compose.yaml
|
||||
BIN
integrations/Network/icon/network.png
Normal file
|
After Width: | Height: | Size: 888 B |
614
integrations/canal/dashboards/canal_by_categraf.json
Normal file
@@ -0,0 +1,614 @@
|
||||
{
|
||||
"name": "Canal instances",
|
||||
"tags": "",
|
||||
"configs": {
|
||||
"version": "2.0.0",
|
||||
"links": [],
|
||||
"var": [
|
||||
{
|
||||
"name": "destination",
|
||||
"allOption": false,
|
||||
"multi": false,
|
||||
"definition": "label_values(canal_instance, destination)"
|
||||
}
|
||||
],
|
||||
"panels": [
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"id": "758ed076-0140-4755-bd86-da18d0648fdd",
|
||||
"type": "row",
|
||||
"name": "Instance status",
|
||||
"collapsed": true,
|
||||
"layout": {
|
||||
"h": 1,
|
||||
"w": 24,
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"i": "758ed076-0140-4755-bd86-da18d0648fdd"
|
||||
},
|
||||
"panels": []
|
||||
},
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"id": "0c611d83-9ccb-402f-b3ed-14d53bd3e818",
|
||||
"type": "timeseries",
|
||||
"name": "Basic",
|
||||
"description": "Canal instance <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>",
|
||||
"links": [],
|
||||
"layout": {
|
||||
"h": 5,
|
||||
"w": 6,
|
||||
"x": 0,
|
||||
"y": 1,
|
||||
"i": "0c611d83-9ccb-402f-b3ed-14d53bd3e818"
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "canal_instance{destination=~\"$destination\"}",
|
||||
"legend": "Destination: {{destination}}"
|
||||
},
|
||||
{
|
||||
"refId": "B",
|
||||
"expr": "canal_instance_parser_mode{destination=~\"$destination\"}",
|
||||
"legend": "Parallel parser: {{parallel}}"
|
||||
},
|
||||
{
|
||||
"refId": "C",
|
||||
"expr": "canal_instance_store{destination=~\"$destination\"}",
|
||||
"legend": "Batch mode: {{batchMode}}"
|
||||
},
|
||||
{
|
||||
"refId": "D",
|
||||
"expr": "canal_instance_store{destination=~\"$destination\"}",
|
||||
"legend": "Buffer size: {{size}}"
|
||||
}
|
||||
],
|
||||
"options": {
|
||||
"tooltip": {
|
||||
"mode": "all",
|
||||
"sort": "none"
|
||||
},
|
||||
"legend": {
|
||||
"displayMode": "hidden"
|
||||
}
|
||||
},
|
||||
"custom": {
|
||||
"version": "2.0.0",
|
||||
"drawStyle": "lines",
|
||||
"lineInterpolation": "linear",
|
||||
"fillOpacity": 0.5,
|
||||
"stack": "off"
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"id": "efde62a5-f4ac-4062-80d1-4cc7dd50bb9f",
|
||||
"type": "timeseries",
|
||||
"name": "Network bandwith",
|
||||
"description": "Canal instance <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ռ<EFBFBD>á<EFBFBD>\ninbound: <20><>ȡMySQL binlog.\noutbound: <20><>Client<6E>˴<EFBFBD><CBB4><EFBFBD><EFBFBD>ʽ<EFBFBD><CABD>binlog.",
|
||||
"links": [],
|
||||
"layout": {
|
||||
"h": 5,
|
||||
"w": 6,
|
||||
"x": 6,
|
||||
"y": 1,
|
||||
"i": "efde62a5-f4ac-4062-80d1-4cc7dd50bb9f"
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "rate(canal_instance_received_binlog_bytes{destination=~\"$destination\", parser=\"0\"}[2m]) / 1024",
|
||||
"legend": "inbound"
|
||||
},
|
||||
{
|
||||
"refId": "B",
|
||||
"expr": "rate(canal_instance_client_bytes{destination=~\"$destination\"}[2m]) / 1024",
|
||||
"legend": "outbound"
|
||||
},
|
||||
{
|
||||
"refId": "C",
|
||||
"expr": "rate(canal_instance_received_binlog_bytes{destination=~\"$destination\", parser=\"1\"}[2m]) / 1024",
|
||||
"legend": "inbound-1"
|
||||
},
|
||||
{
|
||||
"refId": "D",
|
||||
"expr": "rate(canal_instance_received_binlog_bytes{destination=~\"$destination\", parser=\"2\"}[2m]) / 1024",
|
||||
"legend": "inbound-2"
|
||||
}
|
||||
],
|
||||
"options": {
|
||||
"tooltip": {
|
||||
"mode": "all",
|
||||
"sort": "none"
|
||||
},
|
||||
"legend": {
|
||||
"displayMode": "hidden"
|
||||
}
|
||||
},
|
||||
"custom": {
|
||||
"version": "2.0.0",
|
||||
"drawStyle": "lines",
|
||||
"lineInterpolation": "linear",
|
||||
"fillOpacity": 0.5,
|
||||
"stack": "off"
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"id": "93d407a9-c1bf-4f9c-b88b-f0a01c023ea4",
|
||||
"type": "timeseries",
|
||||
"name": "Delay",
|
||||
"description": "master: Canal server<65><72><EFBFBD><EFBFBD><EFBFBD>MySQL master<65><72><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>ͨ<EFBFBD><CDA8>master heartbeat<61><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˢ<EFBFBD><CBA2>idle״̬<D7B4>µ<EFBFBD><C2B5><EFBFBD>ʱ<EFBFBD><CAB1>\nput: store put<75><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><D7BC>\nget: client get<65><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><D7BC>\nack: client ack<63><6B><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><D7BC>",
|
||||
"links": [],
|
||||
"layout": {
|
||||
"h": 5,
|
||||
"w": 6,
|
||||
"x": 12,
|
||||
"y": 1,
|
||||
"i": "93d407a9-c1bf-4f9c-b88b-f0a01c023ea4"
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "D",
|
||||
"expr": "canal_instance_traffic_delay{destination=~\"$destination\"} / 1000",
|
||||
"legend": "master"
|
||||
},
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "canal_instance_put_delay{destination=~\"$destination\"} / 1000",
|
||||
"legend": "put"
|
||||
},
|
||||
{
|
||||
"refId": "B",
|
||||
"expr": "canal_instance_get_delay{destination=~\"$destination\"} / 1000",
|
||||
"legend": "get"
|
||||
},
|
||||
{
|
||||
"refId": "C",
|
||||
"expr": "canal_instance_ack_delay{destination=~\"$destination\"} / 1000",
|
||||
"legend": "ack"
|
||||
}
|
||||
],
|
||||
"options": {
|
||||
"tooltip": {
|
||||
"mode": "all",
|
||||
"sort": "none"
|
||||
},
|
||||
"legend": {
|
||||
"displayMode": "hidden"
|
||||
}
|
||||
},
|
||||
"custom": {
|
||||
"version": "2.0.0",
|
||||
"drawStyle": "lines",
|
||||
"lineInterpolation": "linear",
|
||||
"fillOpacity": 0.5,
|
||||
"stack": "off"
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"id": "131cbcbe-29e7-469a-bb17-5914a8471ee7",
|
||||
"type": "timeseries",
|
||||
"name": "Blocking",
|
||||
"description": "sink<6E>߳<EFBFBD>blockingռ<67>ȣ<EFBFBD>dump<6D>߳<EFBFBD>blockingռ<67><D5BC>(<28><>parallel mode)<29><>",
|
||||
"links": [],
|
||||
"layout": {
|
||||
"h": 5,
|
||||
"w": 6,
|
||||
"x": 18,
|
||||
"y": 1,
|
||||
"i": "131cbcbe-29e7-469a-bb17-5914a8471ee7"
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "B",
|
||||
"expr": "clamp_max(rate(canal_instance_publish_blocking_time{destination=~\"$destination\", parser=\"0\"}[2m]), 1000) / 10",
|
||||
"legend": "dump"
|
||||
},
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "clamp_max(rate(canal_instance_sink_blocking_time{destination=~\"$destination\"}[2m]), 1000) / 10",
|
||||
"legend": "sink"
|
||||
},
|
||||
{
|
||||
"refId": "C",
|
||||
"expr": "clamp_max(rate(canal_instance_publish_blocking_time{destination=~\"$destination\", parser=\"1\"}[2m]), 1000) / 10",
|
||||
"legend": "dump-1"
|
||||
},
|
||||
{
|
||||
"refId": "D",
|
||||
"expr": "clamp_max(rate(canal_instance_publish_blocking_time{destination=~\"$destination\", parser=\"2\"}[2m]), 1000) / 10",
|
||||
"legend": "dump-2"
|
||||
}
|
||||
],
|
||||
"options": {
|
||||
"tooltip": {
|
||||
"mode": "all",
|
||||
"sort": "none"
|
||||
},
|
||||
"legend": {
|
||||
"displayMode": "hidden"
|
||||
}
|
||||
},
|
||||
"custom": {
|
||||
"version": "2.0.0",
|
||||
"drawStyle": "lines",
|
||||
"lineInterpolation": "linear",
|
||||
"fillOpacity": 0.5,
|
||||
"stack": "off"
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"id": "de248e75-37cb-4536-874c-fbdd61a4a6a4",
|
||||
"type": "row",
|
||||
"name": "Throughput",
|
||||
"collapsed": true,
|
||||
"layout": {
|
||||
"h": 1,
|
||||
"w": 24,
|
||||
"x": 0,
|
||||
"y": 6,
|
||||
"i": "de248e75-37cb-4536-874c-fbdd61a4a6a4"
|
||||
},
|
||||
"panels": []
|
||||
},
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"id": "16e7b311-3e9e-4c17-874e-4ef3beb8779f",
|
||||
"type": "timeseries",
|
||||
"name": "TPS(table rows)",
|
||||
"description": "Instance<63><65><EFBFBD><EFBFBD>binlog<6F><67>TPS(<28><>master<65><72><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>table rowsΪ<73><CEAA><EFBFBD><D7BC><EFBFBD><EFBFBD>)<29><>\nput: put<75><74><EFBFBD><EFBFBD>TPS<50><53>\nget: get<65><74><EFBFBD><EFBFBD>TPS<50><53>\nack: ack<63><6B><EFBFBD><EFBFBD>TPS<50><53>",
|
||||
"links": [],
|
||||
"layout": {
|
||||
"h": 5,
|
||||
"w": 6,
|
||||
"x": 0,
|
||||
"y": 7,
|
||||
"i": "16e7b311-3e9e-4c17-874e-4ef3beb8779f"
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "rate(canal_instance_put_rows{destination=~\"$destination\"}[2m])",
|
||||
"legend": "put"
|
||||
},
|
||||
{
|
||||
"refId": "B",
|
||||
"expr": "rate(canal_instance_get_rows{destination=~\"$destination\"}[2m])",
|
||||
"legend": "get"
|
||||
},
|
||||
{
|
||||
"refId": "C",
|
||||
"expr": "rate(canal_instance_ack_rows{destination=~\"$destination\"}[2m])",
|
||||
"legend": "ack"
|
||||
}
|
||||
],
|
||||
"options": {
|
||||
"tooltip": {
|
||||
"mode": "all",
|
||||
"sort": "none"
|
||||
},
|
||||
"legend": {
|
||||
"displayMode": "hidden"
|
||||
}
|
||||
},
|
||||
"custom": {
|
||||
"version": "2.0.0",
|
||||
"drawStyle": "lines",
|
||||
"lineInterpolation": "linear",
|
||||
"fillOpacity": 0.5,
|
||||
"stack": "off"
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"id": "791852f6-dad5-43fd-8629-3f84f8b4ae85",
|
||||
"type": "timeseries",
|
||||
"name": "TPS(MySQL transaction)",
|
||||
"description": "Canal instance <20><><EFBFBD><EFBFBD>binlog<6F><67>TPS<50><53><EFBFBD><EFBFBD>MySQL transactionΪ<6E><CEAA>λ<EFBFBD><CEBB><EFBFBD>㡣",
|
||||
"links": [],
|
||||
"layout": {
|
||||
"h": 5,
|
||||
"w": 6,
|
||||
"x": 6,
|
||||
"y": 7,
|
||||
"i": "791852f6-dad5-43fd-8629-3f84f8b4ae85"
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "rate(canal_instance_transactions{destination=~\"$destination\"}[2m])",
|
||||
"legend": "transactions"
|
||||
}
|
||||
],
|
||||
"options": {
|
||||
"tooltip": {
|
||||
"mode": "all",
|
||||
"sort": "none"
|
||||
},
|
||||
"legend": {
|
||||
"displayMode": "hidden"
|
||||
}
|
||||
},
|
||||
"custom": {
|
||||
"version": "2.0.0",
|
||||
"drawStyle": "lines",
|
||||
"lineInterpolation": "linear",
|
||||
"fillOpacity": 0.5,
|
||||
"stack": "off"
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"id": "3de66e9d-a9ad-41a9-8a48-8911e382e1fe",
|
||||
"type": "row",
|
||||
"name": "Client",
|
||||
"collapsed": true,
|
||||
"layout": {
|
||||
"h": 1,
|
||||
"w": 24,
|
||||
"x": 0,
|
||||
"y": 12,
|
||||
"i": "3de66e9d-a9ad-41a9-8a48-8911e382e1fe"
|
||||
},
|
||||
"panels": []
|
||||
},
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"id": "74c61ee7-2c28-4ee4-997d-e9a4bd9e7183",
|
||||
"type": "timeseries",
|
||||
"name": "Client requests",
|
||||
"description": "Canal instance<63><65><EFBFBD>յ<EFBFBD><D5B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͳ<EFBFBD>ƣ<EFBFBD><C6A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>packet type<70><65><EFBFBD>ࡣ",
|
||||
"links": [],
|
||||
"layout": {
|
||||
"h": 5,
|
||||
"w": 6,
|
||||
"x": 0,
|
||||
"y": 13,
|
||||
"i": "74c61ee7-2c28-4ee4-997d-e9a4bd9e7183"
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "canal_instance_client_packets{destination=~\"$destination\"}",
|
||||
"legend": "{{packetType}}"
|
||||
}
|
||||
],
|
||||
"options": {
|
||||
"tooltip": {
|
||||
"mode": "all",
|
||||
"sort": "none"
|
||||
},
|
||||
"legend": {
|
||||
"displayMode": "hidden"
|
||||
}
|
||||
},
|
||||
"custom": {
|
||||
"version": "2.0.0",
|
||||
"drawStyle": "lines",
|
||||
"lineInterpolation": "linear",
|
||||
"fillOpacity": 0.5,
|
||||
"stack": "off"
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"id": "037002c9-dda5-4ce2-b8a3-d14e8ef9440b",
|
||||
"type": "timeseries",
|
||||
"name": "Client QPS",
|
||||
"description": "client <20><><EFBFBD><EFBFBD><EFBFBD>GET<45><54>ACK<43><4B><EFBFBD><EFBFBD>QPS<50><53>",
|
||||
"links": [],
|
||||
"layout": {
|
||||
"h": 5,
|
||||
"w": 6,
|
||||
"x": 6,
|
||||
"y": 13,
|
||||
"i": "037002c9-dda5-4ce2-b8a3-d14e8ef9440b"
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "rate(canal_instance_client_packets{destination=~\"$destination\",packetType=\"GET\"}[2m])",
|
||||
"legend": "GET"
|
||||
},
|
||||
{
|
||||
"refId": "B",
|
||||
"expr": "rate(canal_instance_client_packets{destination=~\"$destination\",packetType=\"CLIENTACK\"}[2m])",
|
||||
"legend": "ACK"
|
||||
}
|
||||
],
|
||||
"options": {
|
||||
"tooltip": {
|
||||
"mode": "all",
|
||||
"sort": "none"
|
||||
},
|
||||
"legend": {
|
||||
"displayMode": "hidden"
|
||||
}
|
||||
},
|
||||
"custom": {
|
||||
"version": "2.0.0",
|
||||
"drawStyle": "lines",
|
||||
"lineInterpolation": "linear",
|
||||
"fillOpacity": 0.5,
|
||||
"stack": "off"
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"id": "2a433709-f08d-404a-acd6-3ef295157b83",
|
||||
"type": "timeseries",
|
||||
"name": "Empty packets",
|
||||
"description": "server<65><72>ӦGET<45><54><EFBFBD><EFBFBD><F3A3ACB5><EFBFBD><EFBFBD>ؿհ<D8BF><D5B0><EFBFBD>ռ<EFBFBD>ȡ<EFBFBD>",
|
||||
"links": [],
|
||||
"layout": {
|
||||
"h": 5,
|
||||
"w": 6,
|
||||
"x": 12,
|
||||
"y": 13,
|
||||
"i": "2a433709-f08d-404a-acd6-3ef295157b83"
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "rate(canal_instance_client_empty_batches{destination=~\"$destination\"}[2m])",
|
||||
"legend": "empty"
|
||||
},
|
||||
{
|
||||
"refId": "B",
|
||||
"expr": "rate(canal_instance_client_packets{destination=~\"$destination\", packetType=\"GET\"}[2m])",
|
||||
"legend": "nonempty"
|
||||
}
|
||||
],
|
||||
"options": {
|
||||
"tooltip": {
|
||||
"mode": "all",
|
||||
"sort": "none"
|
||||
},
|
||||
"legend": {
|
||||
"displayMode": "hidden"
|
||||
}
|
||||
},
|
||||
"custom": {
|
||||
"version": "2.0.0",
|
||||
"drawStyle": "lines",
|
||||
"lineInterpolation": "linear",
|
||||
"fillOpacity": 0.5,
|
||||
"stack": "off"
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"id": "1c262e9e-1dc5-4aae-bf8c-0e4c3e85a84f",
|
||||
"type": "timeseries",
|
||||
"name": "Response time",
|
||||
"description": "Canal client <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧʱ<D3A6><CAB1>ĸſ<C4B8><C5BF><EFBFBD>",
|
||||
"links": [],
|
||||
"layout": {
|
||||
"h": 5,
|
||||
"w": 6,
|
||||
"x": 18,
|
||||
"y": 13,
|
||||
"i": "1c262e9e-1dc5-4aae-bf8c-0e4c3e85a84f"
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "rate(canal_instance_client_request_latency_bucket{destination=~\"$destination\"}[2m])",
|
||||
"legend": "{{le}}ms"
|
||||
}
|
||||
],
|
||||
"options": {
|
||||
"tooltip": {
|
||||
"mode": "all",
|
||||
"sort": "none"
|
||||
},
|
||||
"legend": {
|
||||
"displayMode": "hidden"
|
||||
}
|
||||
},
|
||||
"custom": {
|
||||
"version": "2.0.0",
|
||||
"drawStyle": "lines",
|
||||
"lineInterpolation": "linear",
|
||||
"fillOpacity": 0.5,
|
||||
"stack": "off"
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"id": "ae68fd29-4dd4-445a-86b9-76144d23d27c",
|
||||
"type": "row",
|
||||
"name": "Store",
|
||||
"collapsed": true,
|
||||
"layout": {
|
||||
"h": 1,
|
||||
"w": 24,
|
||||
"x": 0,
|
||||
"y": 18,
|
||||
"i": "ae68fd29-4dd4-445a-86b9-76144d23d27c"
|
||||
},
|
||||
"panels": []
|
||||
},
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"id": "27b7365c-2bca-42b7-836d-33dc769b2a4e",
|
||||
"type": "timeseries",
|
||||
"name": "Store remain events",
|
||||
"description": "Canal instance ringbuffer<65><72>δ<EFBFBD>ͷŵ<CDB7>events<74><73><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
|
||||
"links": [],
|
||||
"layout": {
|
||||
"h": 5,
|
||||
"w": 6,
|
||||
"x": 0,
|
||||
"y": 19,
|
||||
"i": "27b7365c-2bca-42b7-836d-33dc769b2a4e"
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "canal_instance_store_produce_seq{destination=~\"$destination\"} - canal_instance_store_consume_seq{destination=~\"$destination\"}",
|
||||
"legend": "events"
|
||||
}
|
||||
],
|
||||
"options": {
|
||||
"tooltip": {
|
||||
"mode": "all",
|
||||
"sort": "none"
|
||||
},
|
||||
"legend": {
|
||||
"displayMode": "hidden"
|
||||
}
|
||||
},
|
||||
"custom": {
|
||||
"version": "2.0.0",
|
||||
"drawStyle": "lines",
|
||||
"lineInterpolation": "linear",
|
||||
"fillOpacity": 0.5,
|
||||
"stack": "off"
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"id": "f399e86f-8f87-43fe-80a2-5b6f2ef7529f",
|
||||
"type": "timeseries",
|
||||
"name": "Store remain mem",
|
||||
"description": "Canal instance ringbuffer <20><>δ<EFBFBD>ͷ<EFBFBD>eventsռ<73><D5BC><EFBFBD>ڴ档",
|
||||
"links": [],
|
||||
"layout": {
|
||||
"h": 5,
|
||||
"w": 6,
|
||||
"x": 6,
|
||||
"y": 19,
|
||||
"i": "f399e86f-8f87-43fe-80a2-5b6f2ef7529f"
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "(canal_instance_store_produce_mem{destination=~\"$destination\"} - canal_instance_store_consume_mem{destination=~\"$destination\"}) / 1024",
|
||||
"legend": "memsize"
|
||||
}
|
||||
],
|
||||
"options": {
|
||||
"tooltip": {
|
||||
"mode": "all",
|
||||
"sort": "none"
|
||||
},
|
||||
"legend": {
|
||||
"displayMode": "hidden"
|
||||
}
|
||||
},
|
||||
"custom": {
|
||||
"version": "2.0.0",
|
||||
"drawStyle": "lines",
|
||||
"lineInterpolation": "linear",
|
||||
"fillOpacity": 0.5,
|
||||
"stack": "off"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
BIN
integrations/canal/icon/canal.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
@@ -1,41 +1,68 @@
|
||||
{
|
||||
"name": "http detect",
|
||||
"name": "HTTP detect by UlricQin",
|
||||
"tags": "",
|
||||
"ident": "",
|
||||
"configs": {
|
||||
"panels": [
|
||||
{
|
||||
"collapsed": true,
|
||||
"id": "0cd7c8aa-456c-4522-97ef-0b1710e7af8a",
|
||||
"layout": {
|
||||
"h": 1,
|
||||
"i": "0cd7c8aa-456c-4522-97ef-0b1710e7af8a",
|
||||
"w": 24,
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"name": "Default chart group",
|
||||
"type": "row"
|
||||
},
|
||||
{
|
||||
"custom": {
|
||||
"aggrDimension": "target",
|
||||
"calc": "lastNotNull",
|
||||
"displayMode": "labelValuesToRows",
|
||||
"showHeader": true
|
||||
},
|
||||
"type": "table",
|
||||
"id": "3674dbfa-243a-49f6-baa5-b7f887c1afb0",
|
||||
"layout": {
|
||||
"h": 15,
|
||||
"i": "3674dbfa-243a-49f6-baa5-b7f887c1afb0",
|
||||
"w": 24,
|
||||
"x": 0,
|
||||
"y": 1
|
||||
"y": 0,
|
||||
"i": "3674dbfa-243a-49f6-baa5-b7f887c1afb0",
|
||||
"isResizable": true
|
||||
},
|
||||
"version": "3.0.0",
|
||||
"datasourceCate": "prometheus",
|
||||
"datasourceValue": "${Datasource}",
|
||||
"targets": [
|
||||
{
|
||||
"expr": "max(http_response_result_code) by (target)",
|
||||
"legend": "UP?",
|
||||
"refId": "A",
|
||||
"instant": true
|
||||
},
|
||||
{
|
||||
"expr": "max(http_response_response_code) by (target)",
|
||||
"legend": "status code",
|
||||
"refId": "B",
|
||||
"instant": true
|
||||
},
|
||||
{
|
||||
"expr": "max(http_response_response_time) by (target) *1000",
|
||||
"legend": "latency",
|
||||
"refId": "C",
|
||||
"instant": true
|
||||
},
|
||||
{
|
||||
"expr": "max(http_response_cert_expire_timestamp) by (target) - time()",
|
||||
"legend": "cert expire",
|
||||
"refId": "D",
|
||||
"instant": true
|
||||
}
|
||||
],
|
||||
"transformations": [
|
||||
{
|
||||
"id": "organize",
|
||||
"options": {}
|
||||
}
|
||||
],
|
||||
"name": "URL Details",
|
||||
"custom": {
|
||||
"showHeader": true,
|
||||
"colorMode": "background",
|
||||
"calc": "lastNotNull",
|
||||
"displayMode": "labelValuesToRows",
|
||||
"aggrDimension": "target",
|
||||
"sortColumn": "target",
|
||||
"sortOrder": "ascend"
|
||||
},
|
||||
"options": {
|
||||
"standardOptions": {},
|
||||
"valueMappings": []
|
||||
"valueMappings": [],
|
||||
"standardOptions": {}
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
@@ -76,43 +103,115 @@
|
||||
"properties": {
|
||||
"standardOptions": {
|
||||
"util": "humantimeSeconds"
|
||||
}
|
||||
},
|
||||
"valueMappings": [
|
||||
{
|
||||
"type": "range",
|
||||
"result": {
|
||||
"color": "#f60c0c"
|
||||
},
|
||||
"match": {
|
||||
"to": 604800
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "range",
|
||||
"result": {
|
||||
"color": "#ffae39"
|
||||
},
|
||||
"match": {
|
||||
"to": 2592000
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"type": "special"
|
||||
},
|
||||
{
|
||||
"type": "special",
|
||||
"matcher": {
|
||||
"value": "B"
|
||||
},
|
||||
"properties": {
|
||||
"valueMappings": [
|
||||
{
|
||||
"type": "range",
|
||||
"result": {
|
||||
"color": "#2c9d3d"
|
||||
},
|
||||
"match": {
|
||||
"to": 399
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "range",
|
||||
"result": {
|
||||
"color": "#ff656b"
|
||||
},
|
||||
"match": {
|
||||
"to": 499
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "range",
|
||||
"result": {
|
||||
"color": "#f10808"
|
||||
},
|
||||
"match": {
|
||||
"from": 500
|
||||
}
|
||||
}
|
||||
],
|
||||
"standardOptions": {}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "special",
|
||||
"matcher": {
|
||||
"value": "C"
|
||||
},
|
||||
"properties": {
|
||||
"valueMappings": [
|
||||
{
|
||||
"type": "range",
|
||||
"result": {
|
||||
"color": "#2c9d3d"
|
||||
},
|
||||
"match": {
|
||||
"to": 400
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "range",
|
||||
"result": {
|
||||
"color": "#ff656b"
|
||||
},
|
||||
"match": {
|
||||
"from": 400
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "range",
|
||||
"result": {
|
||||
"color": "#f11313"
|
||||
},
|
||||
"match": {
|
||||
"from": 2000
|
||||
}
|
||||
}
|
||||
],
|
||||
"standardOptions": {
|
||||
"util": "milliseconds"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"targets": [
|
||||
{
|
||||
"expr": "max(http_response_result_code) by (target)",
|
||||
"legend": "UP?",
|
||||
"refId": "A"
|
||||
},
|
||||
{
|
||||
"expr": "max(http_response_response_code) by (target)",
|
||||
"legend": "status code",
|
||||
"refId": "B"
|
||||
},
|
||||
{
|
||||
"expr": "max(http_response_response_time) by (target)",
|
||||
"legend": "latency(s)",
|
||||
"refId": "C"
|
||||
},
|
||||
{
|
||||
"expr": "max(http_response_cert_expire_timestamp) by (target) - time()",
|
||||
"legend": "cert expire",
|
||||
"refId": "D"
|
||||
}
|
||||
],
|
||||
"type": "table",
|
||||
"version": "2.0.0",
|
||||
"datasourceCate": "prometheus",
|
||||
"datasourceValue": "${prom}"
|
||||
]
|
||||
}
|
||||
],
|
||||
"version": "3.0.0",
|
||||
"var": [
|
||||
{
|
||||
"name": "prom",
|
||||
"name": "Datasource",
|
||||
"type": "datasource",
|
||||
"definition": "prometheus"
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 975 B |
BIN
integrations/n9e/icon/n9e-circle.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 23 KiB |
@@ -20,3 +20,4 @@ configuration file: `conf/input.processes/processes.toml`
|
||||
```
|
||||
force_ps = true
|
||||
```
|
||||
|
||||
|
||||
62
integrations/procstat/alerts/categraf-procstat.json
Normal file
@@ -0,0 +1,62 @@
|
||||
[
|
||||
{
|
||||
"name": "there is a process count of 0, indicating that a certain process may have crashed",
|
||||
"note": "",
|
||||
"severity": 1,
|
||||
"disabled": 0,
|
||||
"prom_for_duration": 60,
|
||||
"prom_ql": "procstat_lookup_count == 0",
|
||||
"prom_eval_interval": 15,
|
||||
"enable_stime": "00:00",
|
||||
"enable_etime": "23:59",
|
||||
"enable_days_of_week": [
|
||||
"1",
|
||||
"2",
|
||||
"3",
|
||||
"4",
|
||||
"5",
|
||||
"6",
|
||||
"0"
|
||||
],
|
||||
"notify_recovered": 1,
|
||||
"notify_channels": [
|
||||
"email",
|
||||
"dingtalk",
|
||||
"wecom"
|
||||
],
|
||||
"notify_repeat_step": 60,
|
||||
"callbacks": [],
|
||||
"runbook_url": "",
|
||||
"append_tags": []
|
||||
},
|
||||
{
|
||||
"name": "process handle limit is too low",
|
||||
"note": "",
|
||||
"severity": 3,
|
||||
"disabled": 0,
|
||||
"prom_for_duration": 60,
|
||||
"prom_ql": "procstat_rlimit_num_fds_soft < 2048",
|
||||
"prom_eval_interval": 15,
|
||||
"enable_stime": "00:00",
|
||||
"enable_etime": "23:59",
|
||||
"enable_days_of_week": [
|
||||
"1",
|
||||
"2",
|
||||
"3",
|
||||
"4",
|
||||
"5",
|
||||
"6",
|
||||
"0"
|
||||
],
|
||||
"notify_recovered": 1,
|
||||
"notify_channels": [
|
||||
"email",
|
||||
"dingtalk",
|
||||
"wecom"
|
||||
],
|
||||
"notify_repeat_step": 60,
|
||||
"callbacks": [],
|
||||
"runbook_url": "",
|
||||
"append_tags": []
|
||||
}
|
||||
]
|
||||
642
integrations/procstat/dashboards/categraf-procstat.json
Normal file
@@ -0,0 +1,642 @@
|
||||
{
|
||||
"name": "Procstat by UlricQin",
|
||||
"tags": "Categraf OS",
|
||||
"ident": "",
|
||||
"configs": {
|
||||
"var": [
|
||||
{
|
||||
"name": "Datasource",
|
||||
"type": "datasource",
|
||||
"definition": "prometheus",
|
||||
"defaultValue": 37
|
||||
},
|
||||
{
|
||||
"name": "ident",
|
||||
"label": "Host",
|
||||
"type": "query",
|
||||
"datasource": {
|
||||
"cate": "prometheus",
|
||||
"value": "${Datasource}"
|
||||
},
|
||||
"definition": "label_values(system_load_norm_1, ident)",
|
||||
"multi": true,
|
||||
"allOption": true
|
||||
},
|
||||
{
|
||||
"name": "search_string",
|
||||
"label": "Proc",
|
||||
"type": "query",
|
||||
"datasource": {
|
||||
"cate": "prometheus",
|
||||
"value": "${Datasource}"
|
||||
},
|
||||
"definition": "label_values(procstat_lookup_count{ident=~\"$ident\"}, search_string)",
|
||||
"multi": true,
|
||||
"allOption": true
|
||||
}
|
||||
],
|
||||
"panels": [
|
||||
{
|
||||
"type": "stat",
|
||||
"id": "be9aac6c-4401-4c61-8c43-574cf314ffef",
|
||||
"layout": {
|
||||
"h": 4,
|
||||
"w": 5,
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"i": "be9aac6c-4401-4c61-8c43-574cf314ffef",
|
||||
"isResizable": true
|
||||
},
|
||||
"version": "3.0.0",
|
||||
"datasourceCate": "prometheus",
|
||||
"datasourceValue": "${Datasource}",
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "procstat_lookup_count{ident=~\"$ident\", search_string=~\"$search_string\"}",
|
||||
"legend": "{{ident}} {{search_string}}",
|
||||
"instant": true
|
||||
}
|
||||
],
|
||||
"transformations": [
|
||||
{
|
||||
"id": "organize",
|
||||
"options": {}
|
||||
}
|
||||
],
|
||||
"name": "Proc Count Now",
|
||||
"custom": {
|
||||
"textMode": "valueAndName",
|
||||
"colorMode": "background",
|
||||
"calc": "lastNotNull",
|
||||
"valueField": "Value",
|
||||
"colSpan": 1,
|
||||
"textSize": {}
|
||||
},
|
||||
"options": {
|
||||
"standardOptions": {},
|
||||
"thresholds": {
|
||||
"steps": [
|
||||
{
|
||||
"color": "#634CD9",
|
||||
"value": null,
|
||||
"type": "base"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "table",
|
||||
"id": "da621e2c-ae2b-4375-9a66-2bec7832490b",
|
||||
"layout": {
|
||||
"h": 4,
|
||||
"w": 9,
|
||||
"x": 5,
|
||||
"y": 0,
|
||||
"i": "79db82d9-5f46-4c45-bb9f-c23f94d99e0a",
|
||||
"isResizable": true
|
||||
},
|
||||
"version": "3.0.0",
|
||||
"datasourceCate": "prometheus",
|
||||
"datasourceValue": "${Datasource}",
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "procstat_lookup_count{ident=~\"$ident\", search_string=~\"$search_string\"}",
|
||||
"legend": "{{ident}} {{search_string}}",
|
||||
"instant": true
|
||||
}
|
||||
],
|
||||
"transformations": [
|
||||
{
|
||||
"id": "organize",
|
||||
"options": {}
|
||||
}
|
||||
],
|
||||
"name": "Proc Count Table",
|
||||
"custom": {
|
||||
"showHeader": true,
|
||||
"colorMode": "background",
|
||||
"calc": "lastNotNull",
|
||||
"displayMode": "labelsOfSeriesToRows",
|
||||
"columns": [
|
||||
"ident",
|
||||
"search_string",
|
||||
"value"
|
||||
],
|
||||
"sortColumn": "ident",
|
||||
"sortOrder": "ascend"
|
||||
},
|
||||
"options": {
|
||||
"valueMappings": [
|
||||
{
|
||||
"type": "special",
|
||||
"result": {
|
||||
"color": "#fa0c0c"
|
||||
},
|
||||
"match": {
|
||||
"special": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "range",
|
||||
"result": {
|
||||
"color": "#2c9d3d"
|
||||
},
|
||||
"match": {
|
||||
"from": 1
|
||||
}
|
||||
}
|
||||
],
|
||||
"standardOptions": {}
|
||||
},
|
||||
"overrides": [
|
||||
{}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "timeseries",
|
||||
"id": "881c04fd-8804-432e-9b34-b4761590de20",
|
||||
"layout": {
|
||||
"h": 4,
|
||||
"w": 10,
|
||||
"x": 14,
|
||||
"y": 0,
|
||||
"i": "24b55362-d900-43c0-98d5-f2e994bf22a6",
|
||||
"isResizable": true
|
||||
},
|
||||
"version": "3.0.0",
|
||||
"datasourceCate": "prometheus",
|
||||
"datasourceValue": "${Datasource}",
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "procstat_lookup_count{ident=~\"$ident\", search_string=~\"$search_string\"}",
|
||||
"legend": "{{ident}} {{search_string}}",
|
||||
"instant": false
|
||||
}
|
||||
],
|
||||
"transformations": [
|
||||
{
|
||||
"id": "organize",
|
||||
"options": {}
|
||||
}
|
||||
],
|
||||
"name": "Proc Count Trend",
|
||||
"options": {
|
||||
"tooltip": {
|
||||
"mode": "all",
|
||||
"sort": "none"
|
||||
},
|
||||
"legend": {
|
||||
"displayMode": "hidden"
|
||||
},
|
||||
"standardOptions": {},
|
||||
"thresholds": {
|
||||
"steps": [
|
||||
{
|
||||
"color": "#634CD9",
|
||||
"value": null,
|
||||
"type": "base"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"custom": {
|
||||
"drawStyle": "lines",
|
||||
"lineInterpolation": "smooth",
|
||||
"spanNulls": false,
|
||||
"lineWidth": 1,
|
||||
"fillOpacity": 0.5,
|
||||
"gradientMode": "none",
|
||||
"stack": "off",
|
||||
"scaleDistribution": {
|
||||
"type": "linear"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "stat",
|
||||
"id": "ffeb0fc6-ee02-4fdd-a8e3-ec2b9db9c23c",
|
||||
"layout": {
|
||||
"h": 4,
|
||||
"w": 5,
|
||||
"x": 0,
|
||||
"y": 4,
|
||||
"i": "acd6e7b5-99f5-4d9b-9124-8072c14e5fea",
|
||||
"isResizable": true
|
||||
},
|
||||
"version": "3.0.0",
|
||||
"datasourceCate": "prometheus",
|
||||
"datasourceValue": "${Datasource}",
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "procstat_uptime_minimum{ident=~\"$ident\", search_string=~\"$search_string\"}",
|
||||
"legend": "{{ident}} {{search_string}}",
|
||||
"instant": true
|
||||
}
|
||||
],
|
||||
"transformations": [
|
||||
{
|
||||
"id": "organize",
|
||||
"options": {}
|
||||
}
|
||||
],
|
||||
"name": "Proc Uptime",
|
||||
"custom": {
|
||||
"textMode": "valueAndName",
|
||||
"colorMode": "value",
|
||||
"calc": "lastNotNull",
|
||||
"valueField": "Value",
|
||||
"colSpan": 1,
|
||||
"textSize": {}
|
||||
},
|
||||
"options": {
|
||||
"standardOptions": {
|
||||
"util": "humantimeSeconds"
|
||||
},
|
||||
"thresholds": {
|
||||
"steps": [
|
||||
{
|
||||
"color": "#2c9d3d",
|
||||
"value": null,
|
||||
"type": "base"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "timeseries",
|
||||
"id": "c642a30a-da86-402c-87bf-c2f98616bf95",
|
||||
"layout": {
|
||||
"h": 4,
|
||||
"w": 9,
|
||||
"x": 5,
|
||||
"y": 4,
|
||||
"i": "c642a30a-da86-402c-87bf-c2f98616bf95",
|
||||
"isResizable": true
|
||||
},
|
||||
"version": "3.0.0",
|
||||
"datasourceCate": "prometheus",
|
||||
"datasourceValue": "${Datasource}",
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "procstat_cpu_usage_total{ident=~\"$ident\", search_string=~\"$search_string\"}"
|
||||
}
|
||||
],
|
||||
"transformations": [
|
||||
{
|
||||
"id": "organize",
|
||||
"options": {}
|
||||
}
|
||||
],
|
||||
"name": "CPU Util",
|
||||
"options": {
|
||||
"tooltip": {
|
||||
"mode": "all",
|
||||
"sort": "none"
|
||||
},
|
||||
"legend": {
|
||||
"displayMode": "hidden"
|
||||
},
|
||||
"standardOptions": {
|
||||
"util": "percent"
|
||||
},
|
||||
"thresholds": {
|
||||
"steps": [
|
||||
{
|
||||
"color": "#634CD9",
|
||||
"value": null,
|
||||
"type": "base"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"custom": {
|
||||
"drawStyle": "lines",
|
||||
"lineInterpolation": "smooth",
|
||||
"spanNulls": false,
|
||||
"lineWidth": 1,
|
||||
"fillOpacity": 0.5,
|
||||
"gradientMode": "none",
|
||||
"stack": "off",
|
||||
"scaleDistribution": {
|
||||
"type": "linear"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "timeseries",
|
||||
"id": "cbc2444e-49c7-45e1-b64e-cd1282b5a419",
|
||||
"layout": {
|
||||
"h": 4,
|
||||
"w": 10,
|
||||
"x": 14,
|
||||
"y": 4,
|
||||
"i": "198846a2-4794-4ba9-9c2d-137bce22f266",
|
||||
"isResizable": true
|
||||
},
|
||||
"version": "3.0.0",
|
||||
"datasourceCate": "prometheus",
|
||||
"datasourceValue": "${Datasource}",
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "procstat_mem_usage_total{ident=~\"$ident\", search_string=~\"$search_string\"}"
|
||||
}
|
||||
],
|
||||
"transformations": [
|
||||
{
|
||||
"id": "organize",
|
||||
"options": {}
|
||||
}
|
||||
],
|
||||
"name": "Mem Util",
|
||||
"options": {
|
||||
"tooltip": {
|
||||
"mode": "all",
|
||||
"sort": "none"
|
||||
},
|
||||
"legend": {
|
||||
"displayMode": "hidden"
|
||||
},
|
||||
"standardOptions": {
|
||||
"util": "percent"
|
||||
},
|
||||
"thresholds": {
|
||||
"steps": [
|
||||
{
|
||||
"color": "#634CD9",
|
||||
"value": null,
|
||||
"type": "base"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"custom": {
|
||||
"drawStyle": "lines",
|
||||
"lineInterpolation": "smooth",
|
||||
"spanNulls": false,
|
||||
"lineWidth": 1,
|
||||
"fillOpacity": 0.5,
|
||||
"gradientMode": "none",
|
||||
"stack": "off",
|
||||
"scaleDistribution": {
|
||||
"type": "linear"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "timeseries",
|
||||
"id": "d2bff162-5801-4d85-94d7-d63145d5b935",
|
||||
"layout": {
|
||||
"h": 4,
|
||||
"w": 12,
|
||||
"x": 0,
|
||||
"y": 8,
|
||||
"i": "a208e192-cf74-468b-9bcb-cb81c8d78d24",
|
||||
"isResizable": true
|
||||
},
|
||||
"version": "3.0.0",
|
||||
"datasourceCate": "prometheus",
|
||||
"datasourceValue": "${Datasource}",
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "procstat_num_fds_total{ident=~\"$ident\", search_string=~\"$search_string\"}/procstat_rlimit_num_fds_soft_minimum{ident=~\"$ident\", search_string=~\"$search_string\"}*100"
|
||||
}
|
||||
],
|
||||
"transformations": [
|
||||
{
|
||||
"id": "organize",
|
||||
"options": {}
|
||||
}
|
||||
],
|
||||
"name": "FD soft Util",
|
||||
"options": {
|
||||
"tooltip": {
|
||||
"mode": "all",
|
||||
"sort": "none"
|
||||
},
|
||||
"legend": {
|
||||
"displayMode": "hidden"
|
||||
},
|
||||
"standardOptions": {
|
||||
"util": "percent"
|
||||
},
|
||||
"thresholds": {
|
||||
"steps": [
|
||||
{
|
||||
"color": "#634CD9",
|
||||
"value": null,
|
||||
"type": "base"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"custom": {
|
||||
"drawStyle": "lines",
|
||||
"lineInterpolation": "smooth",
|
||||
"spanNulls": false,
|
||||
"lineWidth": 1,
|
||||
"fillOpacity": 0.5,
|
||||
"gradientMode": "none",
|
||||
"stack": "off",
|
||||
"scaleDistribution": {
|
||||
"type": "linear"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "timeseries",
|
||||
"id": "46a71143-84b5-4dde-87db-2f0403df6519",
|
||||
"layout": {
|
||||
"h": 4,
|
||||
"w": 12,
|
||||
"x": 12,
|
||||
"y": 8,
|
||||
"i": "22dfb5e4-1d17-4e06-a9b4-b25cb33d1c20",
|
||||
"isResizable": true
|
||||
},
|
||||
"version": "3.0.0",
|
||||
"datasourceCate": "prometheus",
|
||||
"datasourceValue": "${Datasource}",
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "procstat_num_fds_total{ident=~\"$ident\", search_string=~\"$search_string\"}/procstat_rlimit_num_fds_hard_minimum{ident=~\"$ident\", search_string=~\"$search_string\"}*100"
|
||||
}
|
||||
],
|
||||
"transformations": [
|
||||
{
|
||||
"id": "organize",
|
||||
"options": {}
|
||||
}
|
||||
],
|
||||
"name": "FD hard Util",
|
||||
"options": {
|
||||
"tooltip": {
|
||||
"mode": "all",
|
||||
"sort": "none"
|
||||
},
|
||||
"legend": {
|
||||
"displayMode": "hidden"
|
||||
},
|
||||
"standardOptions": {
|
||||
"util": "percent"
|
||||
},
|
||||
"thresholds": {
|
||||
"steps": [
|
||||
{
|
||||
"color": "#634CD9",
|
||||
"value": null,
|
||||
"type": "base"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"custom": {
|
||||
"drawStyle": "lines",
|
||||
"lineInterpolation": "smooth",
|
||||
"spanNulls": false,
|
||||
"lineWidth": 1,
|
||||
"fillOpacity": 0.5,
|
||||
"gradientMode": "none",
|
||||
"stack": "off",
|
||||
"scaleDistribution": {
|
||||
"type": "linear"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "timeseries",
|
||||
"id": "3dda4eb5-a27f-4d54-9547-ae8f0ac9bb96",
|
||||
"layout": {
|
||||
"h": 4,
|
||||
"w": 12,
|
||||
"x": 0,
|
||||
"y": 12,
|
||||
"i": "3dda4eb5-a27f-4d54-9547-ae8f0ac9bb96",
|
||||
"isResizable": true
|
||||
},
|
||||
"version": "3.0.0",
|
||||
"datasourceCate": "prometheus",
|
||||
"datasourceValue": "${Datasource}",
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "procstat_read_bytes_total{ident=~\"$ident\", search_string=~\"$search_string\"}"
|
||||
}
|
||||
],
|
||||
"transformations": [
|
||||
{
|
||||
"id": "organize",
|
||||
"options": {}
|
||||
}
|
||||
],
|
||||
"name": "Read bytes",
|
||||
"options": {
|
||||
"tooltip": {
|
||||
"mode": "all",
|
||||
"sort": "none"
|
||||
},
|
||||
"legend": {
|
||||
"displayMode": "hidden"
|
||||
},
|
||||
"standardOptions": {
|
||||
"util": "bytesIEC",
|
||||
"decimals": 1
|
||||
},
|
||||
"thresholds": {
|
||||
"steps": [
|
||||
{
|
||||
"color": "#634CD9",
|
||||
"value": null,
|
||||
"type": "base"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"custom": {
|
||||
"drawStyle": "lines",
|
||||
"lineInterpolation": "smooth",
|
||||
"spanNulls": false,
|
||||
"lineWidth": 1,
|
||||
"fillOpacity": 0.5,
|
||||
"gradientMode": "none",
|
||||
"stack": "off",
|
||||
"scaleDistribution": {
|
||||
"type": "linear"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "timeseries",
|
||||
"id": "c97403f4-618d-4037-8ea7-5deb32eb8d56",
|
||||
"layout": {
|
||||
"h": 4,
|
||||
"w": 12,
|
||||
"x": 12,
|
||||
"y": 12,
|
||||
"i": "ae0dc449-8263-4f38-8c52-d50b3cb3f1b4",
|
||||
"isResizable": true
|
||||
},
|
||||
"version": "3.0.0",
|
||||
"datasourceCate": "prometheus",
|
||||
"datasourceValue": "${Datasource}",
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "procstat_read_bytes_total{ident=~\"$ident\", search_string=~\"$search_string\"}"
|
||||
}
|
||||
],
|
||||
"transformations": [
|
||||
{
|
||||
"id": "organize",
|
||||
"options": {}
|
||||
}
|
||||
],
|
||||
"name": "Write bytes",
|
||||
"options": {
|
||||
"tooltip": {
|
||||
"mode": "all",
|
||||
"sort": "none"
|
||||
},
|
||||
"legend": {
|
||||
"displayMode": "hidden"
|
||||
},
|
||||
"standardOptions": {
|
||||
"util": "bytesIEC",
|
||||
"decimals": 1
|
||||
},
|
||||
"thresholds": {
|
||||
"steps": [
|
||||
{
|
||||
"color": "#634CD9",
|
||||
"value": null,
|
||||
"type": "base"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"custom": {
|
||||
"drawStyle": "lines",
|
||||
"lineInterpolation": "smooth",
|
||||
"spanNulls": false,
|
||||
"lineWidth": 1,
|
||||
"fillOpacity": 0.5,
|
||||
"gradientMode": "none",
|
||||
"stack": "off",
|
||||
"scaleDistribution": {
|
||||
"type": "linear"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"version": "3.0.0"
|
||||
}
|
||||
}
|
||||
BIN
integrations/procstat/icon/processwire.png
Normal file
|
After Width: | Height: | Size: 848 B |
80
integrations/procstat/markdown/readme.md
Normal file
@@ -0,0 +1,80 @@
|
||||
## Categraf as collector
|
||||
|
||||
configuration file: `conf/input.procstat/procstat.toml`
|
||||
|
||||
进程监控插件,两个核心作用,监控进程是否存活、监控进程使用了多少资源(CPU、内存、文件句柄等)
|
||||
|
||||
### 存活监控
|
||||
|
||||
如果进程监听了端口,就直接用 net_response 来做存活性监控即可,无需使用 procstat 来做,因为:端口在监听,说明进程一定活着,反之则不一定。
|
||||
|
||||
### 进程筛选
|
||||
|
||||
机器上进程很多,我们要做进程监控,就要想办法告诉 Categraf 要监控哪些进程,通过 search 打头的那几个配置,可以做进程过滤筛选:
|
||||
|
||||
```toml
|
||||
[[instnaces]]
|
||||
# # executable name (ie, pgrep <search_exec_substring>)
|
||||
search_exec_substring = "nginx"
|
||||
|
||||
# # pattern as argument for pgrep (ie, pgrep -f <search_cmdline_substring>)
|
||||
# search_cmdline_substring = "n9e server"
|
||||
|
||||
# # windows service name
|
||||
# search_win_service = ""
|
||||
```
|
||||
|
||||
上面三个 search 相关的配置,每个采集目标选用其中一个。有一个额外的配置:search_user,配合search_exec_substring 或者 search_cmdline_substring 使用,表示匹配指定 username 的特定进程。如果不需要指定username,保持配置注释即可。
|
||||
|
||||
```toml
|
||||
# # search process with specific user, option with exec_substring or cmdline_substring
|
||||
# search_user = ""
|
||||
```
|
||||
|
||||
默认的进程监控的配置,`[[instnaces]]` 是注释掉的,记得打开。
|
||||
|
||||
### mode
|
||||
|
||||
mode 配置有两个值供选择,一个是 solaris,一个是 irix,默认是 irix,用这个配置来决定使用哪种 cpu 使用率的计算方法:
|
||||
|
||||
```go
|
||||
func (ins *Instance) gatherCPU(slist *types.SampleList, procs map[PID]Process, tags map[string]string, solarisMode bool) {
|
||||
var value float64
|
||||
for pid := range procs {
|
||||
v, err := procs[pid].Percent(time.Duration(0))
|
||||
if err == nil {
|
||||
if solarisMode {
|
||||
value += v / float64(runtime.NumCPU())
|
||||
slist.PushFront(types.NewSample("cpu_usage", v/float64(runtime.NumCPU()), map[string]string{"pid": fmt.Sprint(pid)}, tags))
|
||||
} else {
|
||||
value += v
|
||||
slist.PushFront(types.NewSample("cpu_usage", v, map[string]string{"pid": fmt.Sprint(pid)}, tags))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ins.GatherTotal {
|
||||
slist.PushFront(types.NewSample("cpu_usage_total", value, tags))
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### gather_total
|
||||
|
||||
比如进程名字是 mysql 的进程,同时可能运行了多个,我们想知道这个机器上的所有 mysql 的进程占用的总的 cpu、mem、fd 等,就设置 gather_total = true,当然,对于 uptime 和 limit 的采集,gather_total 的时候是取的多个进程的最小值
|
||||
|
||||
### gather_per_pid
|
||||
|
||||
还是拿 mysql 举例,一个机器上可能同时运行了多个,我们可能想知道每个 mysql 进程的资源占用情况,此时就要启用 gather_per_pid 的配置,设置为 true,此时会采集每个进程的资源占用情况,并附上 pid 作为标签来区分
|
||||
|
||||
### gather_more_metrics
|
||||
|
||||
默认 procstat 插件只是采集进程数量,如果想采集进程占用的资源,就要启用 gather_more_metrics 中的项,启用哪个就额外采集哪个
|
||||
|
||||
### jvm
|
||||
|
||||
gather_more_metrics 中有个 jvm,如果是 Java 的进程可以选择开启,非 Java 的进程就不要开启了。需要注意的是,这个监控需要依赖机器上的 jstat 命令,这是社区小伙伴贡献的采集代码,感谢 [@lsy1990](https://github.com/lsy1990)
|
||||
|
||||
### One more thing
|
||||
|
||||
要监控什么进程就去目标机器修改 Categraf 的配置 `conf/input.procstat/procstat.toml` ,如果嫌麻烦,可以联系我们采购专业版,专业版支持在服务端 WEB 上统一做配置,不需要登录目标机器修改 Categraf 的配置。
|
||||
55
integrations/victoriametrics/alerts/alerts.json
Normal file
@@ -0,0 +1,55 @@
|
||||
[
|
||||
{
|
||||
"cate": "prometheus",
|
||||
"name": "VictoriaMetrics服务宕机",
|
||||
"note": "当前采集所有实例存活状态",
|
||||
"prod": "",
|
||||
"algorithm": "",
|
||||
"algo_params": null,
|
||||
"delay": 0,
|
||||
"severity": 1,
|
||||
"disabled": 0,
|
||||
"prom_for_duration": 60,
|
||||
"prom_ql": "up{service=~\"vm.+\"} < 1",
|
||||
"prom_eval_interval": 60,
|
||||
"enable_stime": "00:00",
|
||||
"enable_stimes": [
|
||||
"00:00"
|
||||
],
|
||||
"enable_etime": "23:59",
|
||||
"enable_etimes": [
|
||||
"23:59"
|
||||
],
|
||||
"enable_days_of_week": [
|
||||
"1",
|
||||
"2",
|
||||
"3",
|
||||
"4",
|
||||
"5",
|
||||
"6",
|
||||
"0"
|
||||
],
|
||||
"enable_days_of_weeks": [
|
||||
[
|
||||
"1",
|
||||
"2",
|
||||
"3",
|
||||
"4",
|
||||
"5",
|
||||
"6",
|
||||
"0"
|
||||
]
|
||||
],
|
||||
"enable_in_bg": 0,
|
||||
"notify_recovered": 1,
|
||||
"notify_channels": [
|
||||
"dingtalk"
|
||||
],
|
||||
"notify_repeat_step": 60,
|
||||
"notify_max_number": 0,
|
||||
"recover_duration": 0,
|
||||
"callbacks": [],
|
||||
"runbook_url": "",
|
||||
"append_tags": []
|
||||
}
|
||||
]
|
||||
4921
integrations/victoriametrics/dashboard/victoriametrics.json
Normal file
BIN
integrations/victoriametrics/icon/VictoriaMetrics.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
47
integrations/victoriametrics/markdown/README.md
Normal file
@@ -0,0 +1,47 @@
|
||||
## VictoriaMetrics Dashboard & Alerts
|
||||
|
||||
使用[categraf](https://github.com/flashcatcloud/categraf)中[inputs.prometheus](https://github.com/flashcatcloud/categraf/tree/main/inputs/prometheus)插件采集[VictoriaMetrics](https://docs.victoriametrics.com/)三个服务组件默认暴露的指标数据:
|
||||
|
||||
写入模块: `vminsert` 端口:`8480` URI:`metrics`
|
||||
|
||||
查询模块: `vmselect` 端口:`8481` URI:`metrics`
|
||||
|
||||
存储模块: `vmstorage` 端口:`8482` URI:`metrics`
|
||||
|
||||
### 配置文件示例:
|
||||
|
||||
其中label_key: `instance` ,label: `service` 为[dashboard](../dashboard/victoriametrics.json)中选择变量,制作版本为v1.83.0,已经在1.90.0进行过验证,理论上适配当前1.70.0以上所有版本,指标描述全部补齐,并调整为中文,这个仪表盘为官方推荐的集群仪表盘,一直在持续更新,推荐使用这个;
|
||||
|
||||
```toml
|
||||
# vmstorage
|
||||
[[instances]]
|
||||
urls = [
|
||||
"http://127.0.0.1:8482/metrics"
|
||||
]
|
||||
url_label_key = "instance"
|
||||
url_label_value = "{{.Host}}"
|
||||
labels = {service="vmstorage"}
|
||||
|
||||
# vmselect
|
||||
[[instances]]
|
||||
urls = [
|
||||
"http://127.0.0.1:8481/metrics"
|
||||
]
|
||||
|
||||
url_label_key = "instance"
|
||||
url_label_value = "{{.Host}}"
|
||||
labels = {service="vmselect"}
|
||||
|
||||
# vminsert
|
||||
[[instances]]
|
||||
urls = [
|
||||
"http://127.0.0.1:8480/metrics"
|
||||
]
|
||||
url_label_key = "instance"
|
||||
url_label_value = "{{.Host}}"
|
||||
labels = {service="vminsert"}
|
||||
```
|
||||
|
||||
### 告警规则
|
||||
|
||||
[alerts](../alerts/alerts.json)
|
||||