Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
263 changes: 260 additions & 3 deletions contrib/grafana-dashboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,6 @@
},
"editorMode": "code",
"expr": "sectracker_cache_regeneration_duration_seconds{job=\"node\", instance=\"$Instance\"}",
"legendFormat": "{{mode}}",
"range": true,
"refId": "A"
}
Expand Down Expand Up @@ -1027,6 +1026,264 @@
],
"title": "Cache regeneration suggestions",
"type": "stat"
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"description": "Duration of the last garbage collection run (oneshot batch job)",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": 0
}
]
},
"unit": "s"
},
"overrides": []
},
"gridPos": {
"h": 5,
"w": 6,
"x": 12,
"y": 18
},
"id": 23,
"options": {
"colorMode": "none",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"percentChangeColorMode": "standard",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"showPercentChange": false,
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "12.1.1",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"editorMode": "code",
"expr": "sectracker_garbage_collect_duration_seconds{job=\"node\", instance=\"$Instance\", step=\"total\"}",
"range": true,
"refId": "A"
}
],
"title": "Garbage collection duration",
"type": "stat"
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"description": "Duration of the last CVE delta ingest run (oneshot batch job)",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": 0
}
]
},
"unit": "s"
},
"overrides": []
},
"gridPos": {
"h": 5,
"w": 6,
"x": 18,
"y": 18
},
"id": 24,
"options": {
"colorMode": "none",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"percentChangeColorMode": "standard",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"showPercentChange": false,
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "12.1.1",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"editorMode": "code",
"expr": "sectracker_cve_delta_ingest_duration_seconds{job=\"node\", instance=\"$Instance\"}",
"range": true,
"refId": "A"
}
],
"title": "CVE delta ingest duration",
"type": "stat"
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"description": "Total rows deleted in the last garbage collection run",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": 0
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 5,
"w": 6,
"x": 0,
"y": 23
},
"id": 25,
"options": {
"colorMode": "none",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"percentChangeColorMode": "standard",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"showPercentChange": false,
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "12.1.1",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"editorMode": "code",
"expr": "sum(sectracker_garbage_collect_deleted{job=\"node\", instance=\"$Instance\"})",
"range": true,
"refId": "A"
}
],
"title": "Garbage collection deleted",
"type": "stat"
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"description": "CVEs ingested in the last CVE delta ingest run",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": 0
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 5,
"w": 6,
"x": 6,
"y": 23
},
"id": 26,
"options": {
"colorMode": "none",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"percentChangeColorMode": "standard",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"showPercentChange": false,
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "12.1.1",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"editorMode": "code",
"expr": "sectracker_cve_delta_ingest_cves{job=\"node\", instance=\"$Instance\"}",
"range": true,
"refId": "A"
}
],
"title": "CVE delta ingest CVEs",
"type": "stat"
}
],
"schemaVersion": 41,
Expand All @@ -1035,13 +1292,13 @@
"list": [
{
"current": {},
"definition": "label_values(sql_delta,instance)",
"definition": "label_values(up, instance)",
"label": "Instance",
"name": "Instance",
"options": [],
"query": {
"qryType": 1,
"query": "label_values(sql_delta,instance)",
"query": "label_values(up, instance)",
"refId": "PrometheusVariableQueryEditor-VariableQuery"
},
"refresh": 1,
Expand Down
12 changes: 10 additions & 2 deletions nix/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,11 @@ in
"postgresql.service"
"nix-security-tracker-worker.service"
];
serviceConfig.Type = "oneshot";
serviceConfig = {
Type = "oneshot";
# Make performance metrics file, produced as a side effect, readable by Prometheus node exporter
UMask = "0027";
};

script = ''
wst-manage ingest_delta_cve "$(date --date='yesterday' --iso)" ${
Expand All @@ -450,7 +454,11 @@ in
];
wantedBy = [ "multi-user.target" ];

serviceConfig.Type = "oneshot";
serviceConfig = {
Type = "oneshot";
# Make performance metrics file, produced as a side effect, readable by Prometheus node exporter
UMask = "0027";
};
script = ''
wst-manage garbage_collect
'';
Expand Down
Loading