Skip to content

feat(observability): merge the Grafana dashboards into one schema v2 dashboard - #475

Open
gabriele-wolfox wants to merge 11 commits into
mainfrom
dev/461
Open

gabriele-wolfox wants to merge 11 commits into
mainfrom
dev/461

Conversation

@gabriele-wolfox

@gabriele-wolfox gabriele-wolfox commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Replace the Klio Grafana dashboard with a single dashboard in the schema v2 format, which needs Grafana 13.1 or later.
A Clusters and a Servers section each have their own filters, and every filter applies to all the panels of its section. Klio servers are identified by namespace and Server name.

Closes #461

Assisted-by: Claude

@gabriele-wolfox
gabriele-wolfox requested a review from a team as a code owner October 22, 2026 08:09
@gabriele-wolfox
gabriele-wolfox force-pushed the dev/461 branch 3 times, most recently from d794d10 to acc8f68 Compare October 22, 2026 13:29
@gabriele-wolfox
gabriele-wolfox enabled auto-merge (squash) October 22, 2026 13:30

@joao00001 joao00001 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small UX thing: from Klio Clusters there’s no way to see which server backs a cluster, and the dashboard link doesn’t carry the selection over. A small “served by” panel plus includeVars on the link would help, but fine as a follow-up

Comment thread observability/grafana/build.go Outdated
Comment on lines +46 to +47
WithVariable(labelVariable("cluster", "Cluster",
`label_values({__name__=~"klio_(plugin|client)_.+",k8s_namespace_name=~"$namespace"}, cluster_name)`)).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While testing this, I noticed that with namespace=team-c and cluster=All, the server-side panels show all clusters, not just cluster-c. Picking cluster-c explicitly works fine. I think dropping AllValue(".+") for this variable would fix it, unless it is an expected behavior.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you open a PR against this one, so that I can look at the suggestions and eventually apply them?
Thanks a lot!

Comment thread observability/grafana/build.go Outdated
Comment on lines +103 to +104
WithVariable(labelVariable("cluster", "Served cluster",
`label_values(klio_server_wal_written_total{service_name=~"$server"}, cluster_name)`))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since Served cluster comes from klio_server_wal_written_total, a server that doesn’t receive WAL (e.g. read-only mode) won’t list any clusters. Maybe source it from {__name__=~"klio_server_.+"} instead? Same idea as the restore-only fix on the Clusters side

Comment on lines +145 to +153
On the Klio Clusters dashboard:

- `namespace`: the namespace where the PostgreSQL cluster runs, matched
against `k8s.namespace.name`.
- `cluster`: the PostgreSQL cluster, matched against `cluster_name`. It
lists every cluster that emits Klio plugin metrics, including clusters
that only restore from a Klio server.
- `pod` (*Instance*): the PostgreSQL pod, matched against `k8s.pod.name`.
It scopes the panels built from the plugin metrics.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These variables are now described here, but the validation steps in operator/config/samples/opentelemetry/README.md still describe the single dashboard ($server offering klio-a-klio-0, etc.). Might be worth updating them too

@joao00001

Copy link
Copy Markdown

Aside comment: OLM Bundle & Catalog failed in olm:catalog. This PR doesn’t touch anything under operator/, and the job passes on main, so it looks unrelated. Could you re-run it?

@joao00001

Copy link
Copy Markdown

Opened #496 against dev/461 with the suggestions

@fcanovai

Copy link
Copy Markdown
Contributor

Metrics coming from the server are in the client dashboard. If the distinction between what should be in the client and in the server is not clear, it is worth trying a single dashboard with different filters per group. It has the benefit of keeping a single self-contained dashboard with all the data. It will require Grafana 13.1.

@gabriele-wolfox gabriele-wolfox changed the title feat(observability): split the Grafana dashboard by cluster and server feat(observability): merge the Grafana dashboards into one schema v2 dashboard Oct 27, 2026
gabriele-wolfox and others added 10 commits October 27, 2026 14:54
The single dashboard applied the same namespace, server and cluster
filters to every section, but each matched only part of the panels, and
clusters that only restore were missing from the cluster list.

Replace it with a Klio Clusters and a Klio Servers dashboard, each with
filters that apply to all of its panels, and refresh the documentation
screenshots.

Assisted-by: Claude

Signed-off-by: Gabriele Quaresima <gabriele.quaresima@enterprisedb.com>
On the Klio Clusters dashboard, selecting a namespace and leaving the
cluster variable on "All" still showed every cluster on the panels
built from the Klio server metrics, because "All" matched any value
(`.+`) instead of the clusters of the selected namespace. The server
variable of the Klio Servers dashboard had the same problem with the
servers.

Let "All" expand to the values listed by these two variables, which
are already filtered by their parents. The other variables keep
matching any value.

Source the clusters listed by the "Served cluster" variable from all the
Klio server metrics, so a server that does not receive WAL, such as a
read-only one, still lists the clusters it serves.

Signed-off-by: Joao Detomini <joao.detomini@enterprisedb.com>
…sample

The validation steps still described the single dashboard. Split them
between the Klio Clusters and the Klio Servers dashboards, and add the
checks for the "All" value of the cluster and server variables.

Also fix what the sample README said about the server variable: it
matches the OpenTelemetry service.name, which the multi sample sets
differently for each server, so the two independent klio-a servers are
not conflated.

Signed-off-by: Joao Detomini <joao.detomini@enterprisedb.com>
The Klio Clusters dashboard did not tell which Klio server retains the
backups of a cluster. Group the retained backups panel by server too,
and show the server in its legend. The same panel on the Klio Servers
dashboard gets the same legend.

Signed-off-by: Joao Detomini <joao.detomini@enterprisedb.com>
… time range

Now that "All" of the cluster and server variables expands to the listed
values, a cluster or server that appears after the dashboard loads stays
out of every panel until the page is reloaded. Refresh both variables when
the time range changes, which also happens at every auto-refresh.

Assisted-by: Claude

Signed-off-by: Gabriele Quaresima <gabriele.quaresima@enterprisedb.com>
Two servers reading the same repository, such as a read-only one, both
report its snapshots, so the Retained snapshots panel counted them twice.
Group it by server too, as the Retained backups panel already does, and
widen the Kopia snapshot tiles so the longer legend fits.

Assisted-by: Claude

Signed-off-by: Gabriele Quaresima <gabriele.quaresima@enterprisedb.com>
Capture the Klio Clusters and Klio Servers dashboards again after the
changes to the variables and the per-server snapshot panel.

Assisted-by: Claude

Signed-off-by: Gabriele Quaresima <gabriele.quaresima@enterprisedb.com>
…dashboard

Replace the Klio Clusters and Klio Servers dashboards with a single Klio
dashboard in the schema v2 format, which needs Grafana 13.1 or later. A
Clusters and a Servers section each declare their own variables, and every
panel query applies all the variables of its section, through a join where
the series lack the label a variable selects on. Klio servers are
identified by namespace and Server name instead of the OpenTelemetry
service name.

Assisted-by: Claude
Signed-off-by: Gabriele Quaresima <gabriele.quaresima@enterprisedb.com>
Show the retained backups and the backup maintenance in the Servers
section, where their series carry the server and cluster labels the
filters select on, and keep the time since the last WAL and the WAL bytes
written only there, so no panel appears twice.

Assisted-by: Claude
Signed-off-by: Gabriele Quaresima <gabriele.quaresima@enterprisedb.com>
Capture the Clusters and Servers sections of the single Klio dashboard,
rendered with gcx over the last 30 minutes of pgbench load, backups and
WAL archiving with tier 2 enabled.

Assisted-by: Claude
Signed-off-by: Gabriele Quaresima <gabriele.quaresima@enterprisedb.com>
Assisted-by: Claude
Signed-off-by: Gabriele Quaresima <gabriele.quaresima@enterprisedb.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rework the Grafana dashboard and evaluate splitting it by selection scope

3 participants