-
Notifications
You must be signed in to change notification settings - Fork 130
Add PostgreSQL observability telemetry exposure via ServiceMonitors #1808
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
base: feature/database-controllers
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -108,6 +108,27 @@ type PostgresClusterSpec struct { | |
| // +kubebuilder:default=Retain | ||
| // +optional | ||
| ClusterDeletionPolicy *string `json:"clusterDeletionPolicy,omitempty"` | ||
|
|
||
| // Observability contains configuration for metrics exposure features. | ||
| // +optional | ||
| Observability *PostgresObservabilityOverride `json:"observability,omitempty"` | ||
| } | ||
|
|
||
| // PostgresObservabilityOverride overrides observability configuration options for PostgresClusterClass. | ||
| type PostgresObservabilityOverride struct { | ||
|
|
||
| // +optional | ||
| PostgreSQL *FeatureDisableOverride `json:"postgresql,omitempty"` | ||
|
|
||
| // +optional | ||
| PgBouncer *FeatureDisableOverride `json:"pgbouncer,omitempty"` | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in other provider we might not have pgbouncer ( aws for example) lets call it generic way ( connectionPooler). Also we should probably have CEL logic that doesnt allow connection pooler metrics enabled if connection pooler itself is disabled |
||
| } | ||
|
|
||
| type FeatureDisableOverride struct { | ||
| // Disable set to true will disable the feature even if it's enabled in the class. | ||
| // +kubebuilder:default=false | ||
| // +optional | ||
| Disabled *bool `json:"disabled,omitempty"` | ||
| } | ||
|
|
||
| // PostgresClusterResources defines references to Kubernetes resources related to the PostgresCluster, such as ConfigMaps and Secrets. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -99,6 +99,13 @@ type PostgresClusterClassConfig struct { | |
| // +kubebuilder:default=false | ||
| // +optional | ||
| ConnectionPoolerEnabled *bool `json:"connectionPoolerEnabled,omitempty"` | ||
|
|
||
| // Observability contains configuration for metrics exposure. | ||
| // When enabled, creates metrics resources for clusters using this class. | ||
| // Can be overridden in PostgresCluster CR. | ||
| // +kubebuilder:default={} | ||
| // +optional | ||
| Observability *PostgresObservabilityClassConfig `json:"observability,omitempty"` | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar to previous comment :-) |
||
| } | ||
|
|
||
| // ConnectionPoolerMode defines the PgBouncer connection pooling strategy. | ||
|
|
@@ -172,6 +179,20 @@ type PostgresClusterClassStatus struct { | |
| Phase *string `json:"phase,omitempty"` | ||
| } | ||
|
|
||
| type PostgresObservabilityClassConfig struct { | ||
| // +optional | ||
| PostgreSQL *MetricsClassConfig `json:"postgresql,omitempty"` | ||
| // +optional | ||
| PgBouncer *MetricsClassConfig `json:"pgbouncer,omitempty"` | ||
| } | ||
|
|
||
| type MetricsClassConfig struct { | ||
| // Enabled controls whether metrics resources should be created for this target. | ||
| // +kubebuilder:default=false | ||
| // +optional | ||
| Enabled *bool `json:"enabled,omitempty"` | ||
| } | ||
|
|
||
| // +kubebuilder:object:root=true | ||
| // +kubebuilder:subresource:status | ||
| // +kubebuilder:resource:scope=Cluster | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PostgresObservabilityOverride we should follow the same pattern we have for ConnectionPoolerEnabled
So maybe ConnectionPoolerMetricsEnabled and PostgreSQLMetricsEnabled?