Compare commits

...

3 Commits

Author SHA1 Message Date
Mathias Palmersheim
3735608db7 Update dashboards/cardinality-explorer.json
good bot

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Signed-off-by: Mathias Palmersheim <mathias@victoriametrics.com>
2026-03-01 18:06:11 -06:00
Mathias Palmersheim
579472da65 Made Victoriametrics url a variable 2026-03-01 12:04:52 -06:00
hagen1778
18d252e404 dashboards: experimental - add cardinality explorer dashboard
This dashboard mimics VictoriaMetrics Cardinality Explorer via
Grafana dashboard. It uses Infinity datasource to request and parse
`/api/v1/status/tsdb` API.

This is an experimental dashboard to explore capabilities of what
can be achieved and whether it can be useful.

To try it yourself simply run `make docker-vm-cluster-up` or
`make docker-vm-single-up` and visit `http://localhost:3000`.

Signed-off-by: hagen1778 <roman@victoriametrics.com>
2026-02-27 14:59:10 +01:00
5 changed files with 872 additions and 0 deletions

View File

@@ -0,0 +1,848 @@
{
"__inputs": [
{
"name": "DS_VICTORIAMETRICS-INFINITY",
"label": "VictoriaMetrics-Infinity",
"description": "",
"type": "datasource",
"pluginId": "yesoreyeram-infinity-datasource",
"pluginName": "Infinity"
}
],
"__elements": {},
"__requires": [
{
"type": "grafana",
"id": "grafana",
"name": "Grafana",
"version": "12.2.0"
},
{
"type": "panel",
"id": "table",
"name": "Table",
"version": ""
},
{
"type": "panel",
"id": "text",
"name": "Text",
"version": ""
},
{
"type": "datasource",
"id": "yesoreyeram-infinity-datasource",
"name": "Infinity",
"version": "3.7.2"
}
],
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": null,
"links": [
{
"asDropdown": false,
"icon": "bolt",
"includeVars": false,
"keepTime": false,
"tags": [],
"targetBlank": false,
"title": "RESET FILTERS",
"tooltip": "",
"type": "link",
"url": "/d/add4lqn/cardinality-explorer?var-topN=$topN&var-match={__name__!=\"\"}&var-focus="
}
],
"panels": [
{
"gridPos": {
"h": 4,
"w": 24,
"x": 0,
"y": 0
},
"id": 5,
"options": {
"code": {
"language": "plaintext",
"showLineNumbers": false,
"showMiniMap": false
},
"content": "This dashboard mimics [VictoriaMetrics Cardinality Explorer](https://docs.victoriametrics.com/victoriametrics/#cardinality-explorer). Dashboard is in `Work in Progress` status.\nDashboard always show cardinality for **TODAY ONLY**. Can't find a good way to allow selecting date.\n\n- `Limit entries` - show N entries in tables\n- `Time series selector` - automatically updates with click on table rows. Can be manually edited.\n- `Focus label` - automatically updates with click on table rows. Can be manually edited.\n- `RESET FILTERS` - resets the filters.\n\n",
"mode": "markdown"
},
"pluginVersion": "12.2.0",
"transparent": true,
"type": "text"
},
{
"datasource": {
"type": "yesoreyeram-infinity-datasource",
"uid": "${ds}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {
"align": "auto",
"cellOptions": {
"type": "auto"
},
"footer": {
"reducers": []
},
"hideFrom": {
"viz": false
},
"inspect": false
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": 0
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "value"
},
"properties": [
{
"id": "displayName",
"value": "Number of series"
}
]
},
{
"matcher": {
"id": "byName",
"options": "name"
},
"properties": [
{
"id": "displayName",
"value": "Metric name"
},
{
"id": "links",
"value": [
{
"title": "Filter by metric name",
"url": "/d/add4lqn/cardinality-explorer?var-topN=$topN&var-match={__name__=\"${__value.raw}\"}&var-ds=$ds"
}
]
}
]
},
{
"matcher": {
"id": "byName",
"options": "requestsCount"
},
"properties": [
{
"id": "displayName",
"value": "Requests count"
}
]
},
{
"matcher": {
"id": "byName",
"options": "lastReqTS"
},
"properties": [
{
"id": "displayName",
"value": "Last request"
},
{
"id": "mappings",
"value": [
{
"options": {
"0": {
"color": "dark-red",
"index": 0,
"text": "Never"
}
},
"type": "value"
}
]
},
{
"id": "unit",
"value": "dateTimeFromNow"
}
]
},
{
"matcher": {
"id": "byName",
"options": "lastRequestTimestamp"
},
"properties": [
{
"id": "custom.hideFrom.viz",
"value": true
}
]
}
]
},
"gridPos": {
"h": 12,
"w": 24,
"x": 0,
"y": 4
},
"id": 1,
"options": {
"cellHeight": "sm",
"showHeader": true,
"sortBy": [
{
"desc": true,
"displayName": "Number of series"
}
]
},
"pluginVersion": "12.2.0",
"targets": [
{
"columns": [],
"computed_columns": [],
"datasource": {
"type": "yesoreyeram-infinity-datasource",
"uid": "$ds"
},
"filters": [],
"format": "table",
"global_query_id": "",
"parser": "backend",
"refId": "A",
"root_selector": "data.seriesCountByMetricName",
"source": "url",
"type": "json",
"url": "$victoriametrics_url/api/v1/status/tsdb?topN=$topN&match[]=$match",
"url_options": {
"data": "",
"method": "GET"
}
}
],
"title": "Metric names with the highest number of series",
"transformations": [
{
"id": "calculateField",
"options": {
"alias": "lastReqTS",
"binary": {
"left": {
"matcher": {
"id": "byName",
"options": "lastRequestTimestamp"
}
},
"operator": "*",
"right": {
"fixed": "1000"
}
},
"mode": "binary",
"reduce": {
"reducer": "sum"
},
"replaceFields": false
}
}
],
"type": "table"
},
{
"datasource": {
"type": "yesoreyeram-infinity-datasource",
"uid": "$ds"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {
"align": "auto",
"cellOptions": {
"type": "auto"
},
"footer": {
"reducers": []
},
"hideFrom": {
"viz": false
},
"inspect": false
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": 0
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "value"
},
"properties": [
{
"id": "displayName",
"value": "Number of series"
}
]
},
{
"matcher": {
"id": "byName",
"options": "name"
},
"properties": [
{
"id": "displayName",
"value": "Metric name"
},
{
"id": "links",
"value": [
{
"title": "Filter by metric name",
"url": "/d/add4lqn/cardinality-explorer?var-topN=$topN&var-match={\"${__value.raw}\"!=\"\"}&var-focus=${__value.raw}&var-ds=$ds"
}
]
}
]
}
]
},
"gridPos": {
"h": 12,
"w": 12,
"x": 0,
"y": 16
},
"id": 2,
"options": {
"cellHeight": "sm",
"showHeader": true,
"sortBy": [
{
"desc": true,
"displayName": "Number of series"
}
]
},
"pluginVersion": "12.2.0",
"targets": [
{
"columns": [],
"computed_columns": [],
"datasource": {
"type": "yesoreyeram-infinity-datasource",
"uid": "$ds"
},
"filters": [],
"format": "table",
"global_query_id": "",
"parser": "backend",
"refId": "A",
"root_selector": "data.seriesCountByLabelName",
"source": "url",
"type": "json",
"url": "$victoriametrics_url/api/v1/status/tsdb?topN=$topN&match[]=$match",
"url_options": {
"data": "",
"method": "GET"
}
}
],
"title": "Labels with the highest number of series",
"transformations": [
{
"id": "calculateField",
"options": {
"alias": "lastReqTS",
"binary": {
"left": {
"matcher": {
"id": "byName",
"options": "lastRequestTimestamp"
}
},
"operator": "*",
"right": {
"fixed": "1000"
}
},
"mode": "binary",
"reduce": {
"reducer": "sum"
},
"replaceFields": false
}
}
],
"type": "table"
},
{
"datasource": {
"type": "yesoreyeram-infinity-datasource",
"uid": "$ds"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {
"align": "auto",
"cellOptions": {
"type": "auto"
},
"footer": {
"reducers": []
},
"hideFrom": {
"viz": false
},
"inspect": false
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": 0
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "value"
},
"properties": [
{
"id": "displayName",
"value": "Number of series"
}
]
},
{
"matcher": {
"id": "byName",
"options": "name"
},
"properties": [
{
"id": "displayName",
"value": "Metric name"
},
{
"id": "links",
"value": [
{
"title": "Filter by metric name",
"url": "/d/add4lqn/cardinality-explorer?var-topN=$topN&var-match={\"${__value.raw}\"!=\"\"}&var-focus=${__value.raw}&var-ds=$ds"
}
]
}
]
}
]
},
"gridPos": {
"h": 24,
"w": 12,
"x": 12,
"y": 16
},
"id": 3,
"options": {
"cellHeight": "sm",
"showHeader": true,
"sortBy": [
{
"desc": true,
"displayName": "Number of series"
}
]
},
"pluginVersion": "12.2.0",
"targets": [
{
"columns": [],
"computed_columns": [],
"datasource": {
"type": "yesoreyeram-infinity-datasource",
"uid": "$ds"
},
"filters": [],
"format": "table",
"global_query_id": "",
"parser": "backend",
"refId": "A",
"root_selector": "data.seriesCountByFocusLabelValue",
"source": "url",
"type": "json",
"url": "$victoriametrics_url/api/v1/status/tsdb?topN=$topN&match[]=$match&focusLabel=$focus",
"url_options": {
"data": "",
"method": "GET"
}
}
],
"title": "Values for \"$focus\" label with the highest number of series",
"transformations": [
{
"id": "calculateField",
"options": {
"alias": "lastReqTS",
"binary": {
"left": {
"matcher": {
"id": "byName",
"options": "lastRequestTimestamp"
}
},
"operator": "*",
"right": {
"fixed": "1000"
}
},
"mode": "binary",
"reduce": {
"reducer": "sum"
},
"replaceFields": false
}
}
],
"type": "table"
},
{
"datasource": {
"type": "yesoreyeram-infinity-datasource",
"uid": "$ds"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {
"align": "auto",
"cellOptions": {
"type": "auto"
},
"footer": {
"reducers": []
},
"hideFrom": {
"viz": false
},
"inspect": false
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": 0
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "value"
},
"properties": [
{
"id": "displayName",
"value": "Number of series"
}
]
},
{
"matcher": {
"id": "byName",
"options": "name"
},
"properties": [
{
"id": "displayName",
"value": "Metric name"
},
{
"id": "links",
"value": [
{
"title": "Filter by metric name",
"url": "/d/add4lqn/cardinality-explorer?var-topN=$topN&var-match={\"${__value.raw}\"!=\"\"}&var-focus=${__value.raw}&var-ds=$ds"
}
]
}
]
}
]
},
"gridPos": {
"h": 12,
"w": 12,
"x": 0,
"y": 28
},
"id": 4,
"options": {
"cellHeight": "sm",
"showHeader": true,
"sortBy": [
{
"desc": true,
"displayName": "Number of series"
}
]
},
"pluginVersion": "12.2.0",
"targets": [
{
"columns": [],
"computed_columns": [],
"datasource": {
"type": "yesoreyeram-infinity-datasource",
"uid": "$ds"
},
"filters": [],
"format": "table",
"global_query_id": "",
"parser": "backend",
"refId": "A",
"root_selector": "data.labelValueCountByLabelName",
"source": "url",
"type": "json",
"url": "$victoriametrics_url/api/v1/status/tsdb?topN=$topN&match[]=$match",
"url_options": {
"data": "",
"method": "GET"
}
}
],
"title": "Labels with the highest number of unique values",
"transformations": [
{
"id": "calculateField",
"options": {
"alias": "lastReqTS",
"binary": {
"left": {
"matcher": {
"id": "byName",
"options": "lastRequestTimestamp"
}
},
"operator": "*",
"right": {
"fixed": "1000"
}
},
"mode": "binary",
"reduce": {
"reducer": "sum"
},
"replaceFields": false
}
}
],
"type": "table"
}
],
"preload": false,
"schemaVersion": 42,
"tags": [],
"templating": {
"list": [
{
"current": {
"text": "",
"value": "${DS_SHIFT-INFINITY}",
"selected": true
},
"name": "ds",
"options": [],
"query": "yesoreyeram-infinity-datasource",
"refresh": 1,
"regex": "",
"type": "datasource"
},
{
"current": {
"text": "10",
"value": "10"
},
"label": "Limit entries",
"name": "topN",
"options": [
{
"selected": false,
"text": "5",
"value": "5"
},
{
"selected": true,
"text": "10",
"value": "10"
},
{
"selected": false,
"text": "20",
"value": "20"
},
{
"selected": false,
"text": "30",
"value": "30"
},
{
"selected": false,
"text": "40",
"value": "40"
},
{
"selected": false,
"text": "50",
"value": "50"
}
],
"query": "5,10,20,30,40,50",
"type": "custom",
"valuesFormat": "csv"
},
{
"current": {
"text": "{__name__!=\"\"}",
"value": "{__name__!=\"\"}"
},
"label": "Time series selector",
"name": "match",
"options": [
{
"selected": true,
"text": "{__name__!=\"\"}",
"value": "{__name__!=\"\"}"
}
],
"query": "{__name__!=\"\"}",
"type": "textbox"
},
{
"current": {
"text": "",
"value": ""
},
"label": "Focus label",
"name": "focus",
"options": [
{
"selected": true,
"text": "",
"value": ""
}
],
"query": "",
"type": "textbox"
},
{
"current": {
"text": "http://victoriametrics:8428",
"value": "http://victoriametrics:8428"
},
"description": "URL of the Victoriametrics API instance",
"label": "Victoriametrics URL",
"name": "victoriametrics_url",
"options": [
{
"selected": true,
"text": "http://victoriametrics:8428",
"value": "http://victoriametrics:8428"
}
],
"query": "http://victoriametrics:8428",
"type": "textbox"
}
]
},
"time": {
"from": "now-5m",
"to": "now"
},
"timepicker": {},
"timezone": "browser",
"title": "VictoriMetrics - Cardinality Explorer",
"uid": "add4lqn",
"version": 2,
"weekStart": ""
}

View File

@@ -25,15 +25,19 @@ services:
ports:
- 3000:3000
restart: always
environment:
- GF_PLUGINS_PREINSTALL=yesoreyeram-infinity-datasource
volumes:
- grafanadata:/var/lib/grafana
- ./provisioning/datasources/prometheus-datasource/cluster.yml:/etc/grafana/provisioning/datasources/cluster.yml
- ./provisioning/datasources/infinity-datasource/cluster.yml:/etc/grafana/provisioning/datasources/infinity-cluster.yml
- ./provisioning/dashboards:/etc/grafana/provisioning/dashboards
- ./../../dashboards/victoriametrics-cluster.json:/var/lib/grafana/dashboards/vm.json
- ./../../dashboards/vmagent.json:/var/lib/grafana/dashboards/vmagent.json
- ./../../dashboards/vmalert.json:/var/lib/grafana/dashboards/vmalert.json
- ./../../dashboards/vmauth.json:/var/lib/grafana/dashboards/vmauth.json
- ./../../dashboards/alert-statistics.json:/var/lib/grafana/dashboards/alert-statistics.json
- ./../../dashboards/cardinality-explorer.json:/var/lib/grafana/dashboards/cardinality-explorer.json
# vmstorage shards. Each shard receives 1/N of all metrics sent to vminserts,
# where N is number of vmstorages (2 in this case).

View File

@@ -43,14 +43,18 @@ services:
- "victoriametrics"
ports:
- 3000:3000
environment:
- GF_PLUGINS_PREINSTALL=yesoreyeram-infinity-datasource
volumes:
- grafanadata:/var/lib/grafana
- ./provisioning/datasources/prometheus-datasource/single.yml:/etc/grafana/provisioning/datasources/single.yml
- ./provisioning/datasources/infinity-datasource/single.yml:/etc/grafana/provisioning/datasources/infinity-single.yml
- ./provisioning/dashboards:/etc/grafana/provisioning/dashboards
- ./../../dashboards/victoriametrics.json:/var/lib/grafana/dashboards/vm.json
- ./../../dashboards/vmagent.json:/var/lib/grafana/dashboards/vmagent.json
- ./../../dashboards/vmalert.json:/var/lib/grafana/dashboards/vmalert.json
- ./../../dashboards/alert-statistics.json:/var/lib/grafana/dashboards/alert-statistics.json
- ./../../dashboards/cardinality-explorer.json:/var/lib/grafana/dashboards/cardinality-explorer.json
restart: always
# vmalert executes alerting and recording rules

View File

@@ -0,0 +1,10 @@
apiVersion: 1
datasources:
- name: VictoriaMetrics-Infinity
type: yesoreyeram-infinity-datasource
url: "http://vmauth:8427/select/0/prometheus"
basicAuth: true
basicAuthUser: foo
secureJsonData:
basicAuthPassword: bar

View File

@@ -0,0 +1,6 @@
apiVersion: 1
datasources:
- name: VictoriaMetrics-Infinity
type: yesoreyeram-infinity-datasource
url: "http://victoriametrics:8428"