Skip to content

Commit 6957050

Browse files
committed
Change API for per-db metrics
1 parent d3ea3a9 commit 6957050

File tree

4 files changed

+38
-0
lines changed

4 files changed

+38
-0
lines changed

config/crd/bases/postgres-operator.crunchydata.com_pgadmins.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2120,6 +2120,11 @@ spec:
21202120
type: string
21212121
x-kubernetes-validations:
21222122
- rule: duration("0") <= self && self <= duration("60m")
2123+
database:
2124+
description: |-
2125+
The database to target with added custom queries.
2126+
Default behavior is to target `postgres`.
2127+
type: string
21232128
name:
21242129
description: |-
21252130
The name of this batch of queries, which will be used in naming the OTel
@@ -2165,6 +2170,12 @@ spec:
21652170
type: string
21662171
type: array
21672172
type: object
2173+
perDBMetricTargets:
2174+
description: User defined databases to target for default
2175+
per-db metrics
2176+
items:
2177+
type: string
2178+
type: array
21682179
type: object
21692180
resources:
21702181
description: Resources holds the resource requirements for the

config/crd/bases/postgres-operator.crunchydata.com_postgresclusters.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11963,6 +11963,11 @@ spec:
1196311963
type: string
1196411964
x-kubernetes-validations:
1196511965
- rule: duration("0") <= self && self <= duration("60m")
11966+
database:
11967+
description: |-
11968+
The database to target with added custom queries.
11969+
Default behavior is to target `postgres`.
11970+
type: string
1196611971
name:
1196711972
description: |-
1196811973
The name of this batch of queries, which will be used in naming the OTel
@@ -12008,6 +12013,12 @@ spec:
1200812013
type: string
1200912014
type: array
1201012015
type: object
12016+
perDBMetricTargets:
12017+
description: User defined databases to target for default
12018+
per-db metrics
12019+
items:
12020+
type: string
12021+
type: array
1201112022
type: object
1201212023
resources:
1201312024
description: Resources holds the resource requirements for the

pkg/apis/postgres-operator.crunchydata.com/v1beta1/instrumentation_types.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,11 @@ type InstrumentationMetricsSpec struct {
107107
// ---
108108
// +optional
109109
CustomQueries *InstrumentationCustomQueriesSpec `json:"customQueries,omitempty"`
110+
111+
// User defined databases to target for default per-db metrics
112+
// ---
113+
// +optional
114+
PerDBMetricTargets []string `json:"perDBMetricTargets,omitempty"`
110115
}
111116

112117
type InstrumentationCustomQueriesSpec struct {
@@ -159,6 +164,12 @@ type InstrumentationCustomQueries struct {
159164
// +default="5s"
160165
// +optional
161166
CollectionInterval *Duration `json:"collectionInterval,omitempty"`
167+
168+
// The database to target with added custom queries.
169+
// Default behavior is to target `postgres`.
170+
// ---
171+
// +optional
172+
Database string `json:"database,omitempty"`
162173
}
163174

164175
// ---

pkg/apis/postgres-operator.crunchydata.com/v1beta1/zz_generated.deepcopy.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)