Skip to content
Merged
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
26 changes: 21 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,29 @@ For an in-cluster Prometheus (e.g. `kube-prometheus-stack`), set `prometheus.ser

Set `prometheus.grafanaDashboard.enabled=true` to ship the bundled "Memgraph OpenMetrics" dashboard as a ConfigMap (labelled `grafana_dashboard`) for the Grafana sidecar to auto-load. It uses a datasource template variable, so it binds to Grafana's default Prometheus. The ConfigMap must live in a namespace the sidecar watches — set `prometheus.grafanaDashboard.namespace` to Grafana's namespace (or run the sidecar with `searchNamespace: ALL`).

### Example Grafana dashboards
Ready-to-import dashboards live under [`examples/dashboards/`](./examples/dashboards/):
### Grafana dashboards
Both charts bundle two dashboards under `charts/<chart>/dashboards/`, each shipped as a `ConfigMap` (labelled `grafana_dashboard`) for a Grafana sidecar to auto-load, and each behind its own flag:

- [`memgraph_openmetrics.json`](./examples/dashboards/memgraph_openmetrics.json) — Memgraph metrics scraped directly from the OpenMetrics endpoint (`scrapeMemgraphDirectly=true`).
- [`memgraph_victorialogs.json`](./examples/dashboards/memgraph_victorialogs.json) — Memgraph logs shipped by `vectorRemote`, queried from VictoriaLogs.
| Dashboard | Enable with | Shows |
| --- | --- | --- |
| **Memgraph OpenMetrics** ([standalone](./charts/memgraph/dashboards/memgraph_openmetrics.json), [HA](./charts/memgraph-high-availability/dashboards/memgraph_openmetrics.json)) | `prometheus.grafanaDashboard.enabled=true` | Memgraph metrics from the OpenMetrics endpoint (`scrapeMemgraphDirectly=true`) |
| **Memgraph Logs** ([standalone](./charts/memgraph/dashboards/memgraph_victorialogs.json), [HA](./charts/memgraph-high-availability/dashboards/memgraph_victorialogs.json)) | `vectorRemote.grafanaDashboard.enabled=true` | Memgraph logs shipped by `vectorRemote`, queried from VictoriaLogs |

Both use datasource template variables, so pick your Prometheus-compatible ("Metrics data source") and VictoriaLogs ("Logs data source") datasources after importing.
```yaml
prometheus:
grafanaDashboard:
enabled: true
namespace: monitoring # must be a namespace the Grafana sidecar watches

vectorRemote:
grafanaDashboard:
enabled: true
namespace: monitoring
```

Each `ConfigMap` must live in a namespace the sidecar watches — set `namespace` to Grafana's namespace (or run the sidecar with `searchNamespace: ALL`). Both default to `prometheus.namespace`, else the release namespace.

If you do not run a Grafana sidecar, import the JSON files above by hand instead. Both use datasource template variables rather than hardcoded datasource UIDs. The OpenMetrics dashboard needs a Prometheus-compatible datasource ("Data source"); the logs dashboard needs a VictoriaLogs datasource ("Logs data source") plus a Prometheus-compatible one ("Metrics data source") that populates its filters.

### Standalone chart example
```yaml
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{- if .Values.vectorRemote.grafanaDashboard.enabled }}
# The "Memgraph Logs" dashboard, provisioned as a ConfigMap for a Grafana sidecar
# (e.g. kube-prometheus-stack) to discover via the grafana_dashboard label.
# It queries the logs shipped by the Vector sidecars from VictoriaLogs, and uses
# datasource template variables rather than hardcoded UIDs: a VictoriaLogs
# datasource for the panels and a Prometheus datasource for the filter variables.
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "memgraph.fullname" . }}-grafana-dashboard-logs
namespace: {{ .Values.vectorRemote.grafanaDashboard.namespace | default .Values.prometheus.namespace | default .Release.Namespace }}
labels:
{{ .Values.vectorRemote.grafanaDashboard.label | default "grafana_dashboard" }}: "1"
data:
memgraph_victorialogs.json: |
{{ .Files.Get "dashboards/memgraph_victorialogs.json" | indent 4 }}
{{- end }}
12 changes: 12 additions & 0 deletions charts/memgraph-high-availability/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,18 @@ vectorRemote:
usernameKey: username
passwordKey: password
extraLabels: {} # e.g. cluster_id, service_name, cluster_env; role is set per pod type (data/coordinator)
# Provision the "Memgraph Logs" Grafana dashboard as a ConfigMap for a Grafana
# sidecar (e.g. kube-prometheus-stack) to auto-load. The dashboard queries the logs
# shipped by the Vector sidecars from VictoriaLogs, and uses datasource template
# variables: a VictoriaLogs datasource for the panels and a Prometheus datasource
# for the filter variables.
grafanaDashboard:
enabled: false
# Namespace for the ConfigMap; must be one the Grafana sidecar watches (default:
# prometheus.namespace, else the release namespace).
namespace: ""
# Label the Grafana sidecar selects dashboards by.
label: grafana_dashboard
resources: {}

extraEnv:
Expand Down
Loading
Loading