Skip to content

Add per db metrics #4183

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 29, 2025
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
13 changes: 13 additions & 0 deletions config/crd/bases/postgres-operator.crunchydata.com_pgadmins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2120,6 +2120,13 @@ spec:
type: string
x-kubernetes-validations:
- rule: duration("0") <= self && self <= duration("60m")
databases:
description: |-
The databases to target with added custom queries.
Default behavior is to target `postgres`.
items:
type: string
type: array
name:
description: |-
The name of this batch of queries, which will be used in naming the OTel
Expand Down Expand Up @@ -2165,6 +2172,12 @@ spec:
type: string
type: array
type: object
perDBMetricTargets:
Copy link
Member

@cbandy cbandy May 20, 2025

Choose a reason for hiding this comment

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

🤔 IIUC, this and customQueries only make sense at/on Postgres. Is there a way to arrange structs so the PGAdmin API doesn't have these fields? Not a blocker; v1beta1.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't want to make any too big changes with the spec, but I wonder if the pgadmin and postgrescluster versions will diverge even more (or if we'll eventually want to slice up instrumentation by target-type, eg., postgres-instrumentation, pgbouncer-instrumentation, pgadmin-instrumentation).

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm yeah good point... Probably makes sense to at least have a pgadmin-instrumentation and a postgrescluster-instrumentation and then pick and choose which structs make sense in each

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should I add "taking apart the instrumentation struct" to this PR?

Copy link
Contributor

Choose a reason for hiding this comment

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

Might make sense if you have the bandwidth...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Given the other work due this sprint, I'm going to make a ticket for this topic and not include it in this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Made that other ticket.

description: User defined databases to target for default
per-db metrics
items:
type: string
type: array
type: object
resources:
description: Resources holds the resource requirements for the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11965,6 +11965,13 @@ spec:
type: string
x-kubernetes-validations:
- rule: duration("0") <= self && self <= duration("60m")
databases:
description: |-
The databases to target with added custom queries.
Default behavior is to target `postgres`.
items:
type: string
type: array
name:
description: |-
The name of this batch of queries, which will be used in naming the OTel
Expand Down Expand Up @@ -12010,6 +12017,12 @@ spec:
type: string
type: array
type: object
perDBMetricTargets:
description: User defined databases to target for default
per-db metrics
items:
type: string
type: array
type: object
resources:
description: Resources holds the resource requirements for the
Expand Down
1 change: 0 additions & 1 deletion internal/collector/generated/gte_pg16_slow_metrics.json

This file was deleted.

1 change: 0 additions & 1 deletion internal/collector/generated/lt_pg16_slow_metrics.json

This file was deleted.

1 change: 0 additions & 1 deletion internal/collector/generated/pgbackrest_metrics.json

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading