You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add support for user-defined custom SQL metric queries in the OTel monitoring feature, allowing users to extend the built-in metrics without requiring operator upgrades.
Motivation
The current OTel monitoring (added in #342) embeds metric queries in base_config.yaml via go:embed. Users cannot add custom SQLmetric mappings without an operator upgrade. CNPG provides this extensibility via customQueriesConfigMap / customQueriesSecret.
Where queries.yaml uses the OTel sqlquery receiver format:
queries:
- sql: "SELECT count(*) as total FROM pg_stat_activity WHERE state = 'active'"metrics:
- metric_name: documentdb.postgres.active_connectionsvalue_column: totaldata_type: gauge
Implementation Notes
The operator would merge user-provided queries into the generated ConfigMap alongside base_config.yaml
Summary
Add support for user-defined custom SQL metric queries in the OTel monitoring feature, allowing users to extend the built-in metrics without requiring operator upgrades.
Motivation
The current OTel monitoring (added in #342) embeds metric queries in
base_config.yamlviago:embed. Users cannot add custom SQLmetric mappings without an operator upgrade. CNPG provides this extensibility viacustomQueriesConfigMap/customQueriesSecret.Proposed API
Where
queries.yamluses the OTelsqlqueryreceiver format:Implementation Notes
base_config.yamlbase_config.yamlwith more built-in queries (backends, replication lag, database size) as a prerequisiteContext
Raised by @xgerman in PR #342 review: #342 (comment)