| 1 | { |
| 2 | "jsonSchema": { |
| 3 | "$schema": "http://json-schema.org/draft-07/schema#", |
| 4 | "title": "Postgres collector configuration.", |
| 5 | "type": "object", |
| 6 | "properties": { |
| 7 | "update_every": { |
| 8 | "title": "Update every", |
| 9 | "description": "Data collection interval, measured in seconds.", |
| 10 | "type": "integer", |
| 11 | "minimum": 1, |
| 12 | "default": 1 |
| 13 | }, |
| 14 | "autodetection_retry": { |
| 15 | "title": "Detection retry", |
| 16 | "description": "Recheck interval in seconds. Zero means no recheck will be scheduled.", |
| 17 | "type": "integer", |
| 18 | "minimum": 0, |
| 19 | "default": 60 |
| 20 | }, |
| 21 | "dsn": { |
| 22 | "title": "DSN", |
| 23 | "description": "Postgres server Data Source Name in [key/value string](https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING-KEYWORD-VALUE) or [URI](https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING-URIS) format.", |
| 24 | "type": "string", |
| 25 | "default": "postgres://netdata:password@127.0.0.1:5432/postgres" |
| 26 | }, |
| 27 | "cloud_auth": { |
| 28 | "title": "Cloud auth", |
| 29 | "description": "Optional cloud authentication settings for Azure Database for PostgreSQL.", |
| 30 | "type": "object", |
| 31 | "properties": { |
| 32 | "provider": { |
| 33 | "title": "Provider", |
| 34 | "description": "Cloud auth provider. Use `none` to disable cloud authentication.", |
| 35 | "type": "string", |
| 36 | "enum": [ |
| 37 | "none", |
| 38 | "azure_ad" |
| 39 | ], |
| 40 | "default": "none" |
| 41 | } |
| 42 | }, |
| 43 | "dependencies": { |
| 44 | "provider": { |
| 45 | "oneOf": [ |
| 46 | { |
| 47 | "properties": { |
| 48 | "provider": { |
| 49 | "const": "none" |
| 50 | } |
| 51 | } |
| 52 | }, |
| 53 | { |
| 54 | "properties": { |
| 55 | "provider": { |
| 56 | "const": "azure_ad" |
| 57 | }, |
| 58 | "azure_ad": { |
| 59 | "title": "Azure AD", |
| 60 | "description": "Microsoft Entra (Azure AD) settings used when provider is `azure_ad`.", |
| 61 | "type": "object", |
| 62 | "properties": { |
| 63 | "mode": { |
| 64 | "title": "Mode", |
| 65 | "description": "Azure AD credential mode.", |
| 66 | "type": "string", |
| 67 | "enum": [ |
| 68 | "service_principal", |
| 69 | "managed_identity", |
| 70 | "default" |
| 71 | ], |
| 72 | "default": "default" |
| 73 | } |
| 74 | }, |
| 75 | "dependencies": { |
| 76 | "mode": { |
| 77 | "oneOf": [ |
| 78 | { |
| 79 | "properties": { |
| 80 | "mode": { |
| 81 | "const": "service_principal" |
| 82 | }, |
| 83 | "mode_service_principal": { |
| 84 | "title": "Service Principal", |
| 85 | "description": "Service principal settings used when mode is `service_principal`.", |
| 86 | "type": "object", |
| 87 | "properties": { |
| 88 | "tenant_id": { |
| 89 | "title": "Tenant ID", |
| 90 | "description": "Azure tenant ID.", |
| 91 | "type": "string" |
| 92 | }, |
| 93 | "client_id": { |
| 94 | "title": "Client ID", |
| 95 | "description": "Service principal client ID.", |
| 96 | "type": "string" |
| 97 | }, |
| 98 | "client_secret": { |
| 99 | "title": "Client Secret", |
| 100 | "description": "Service principal client secret.", |
| 101 | "type": "string", |
| 102 | "sensitive": true |
| 103 | } |
| 104 | }, |
| 105 | "required": [ |
| 106 | "tenant_id", |
| 107 | "client_id", |
| 108 | "client_secret" |
| 109 | ] |
| 110 | } |
| 111 | }, |
| 112 | "required": [ |
| 113 | "mode_service_principal" |
| 114 | ] |
| 115 | }, |
| 116 | { |
| 117 | "properties": { |
| 118 | "mode": { |
| 119 | "const": "managed_identity" |
| 120 | }, |
| 121 | "mode_managed_identity": { |
| 122 | "title": "Managed Identity", |
| 123 | "description": "Managed identity settings used when mode is `managed_identity`.", |
| 124 | "type": "object", |
| 125 | "properties": { |
| 126 | "client_id": { |
| 127 | "title": "Client ID", |
| 128 | "description": "Optional client ID of a user-assigned managed identity.", |
| 129 | "type": "string" |
| 130 | } |
| 131 | } |
| 132 | } |
| 133 | } |
| 134 | }, |
| 135 | { |
| 136 | "properties": { |
| 137 | "mode": { |
| 138 | "const": "default" |
| 139 | } |
| 140 | } |
| 141 | } |
| 142 | ] |
| 143 | } |
| 144 | }, |
| 145 | "required": [ |
| 146 | "mode" |
| 147 | ] |
| 148 | } |
| 149 | }, |
| 150 | "required": [ |
| 151 | "azure_ad" |
| 152 | ] |
| 153 | } |
| 154 | ] |
| 155 | } |
| 156 | } |
| 157 | }, |
| 158 | "timeout": { |
| 159 | "title": "Timeout", |
| 160 | "description": "Timeout for queries, in seconds.", |
| 161 | "type": "number", |
| 162 | "minimum": 0.5, |
| 163 | "default": 2 |
| 164 | }, |
| 165 | "vnode": { |
| 166 | "title": "Vnode", |
| 167 | "description": "Associates this data collection job with a [Virtual Node](https://learn.netdata.cloud/docs/netdata-agent/configuration/organize-systems-metrics-and-alerts#virtual-nodes).", |
| 168 | "type": "string" |
| 169 | }, |
| 170 | "collect_databases_matching": { |
| 171 | "title": "Database selector", |
| 172 | "description": "Configuration for monitoring specific databases using [Netdata simple patterns](https://github.com/netdata/netdata/tree/master/src/libnetdata/simple_pattern#readme). If left empty, no database metrics will be collected.", |
| 173 | "type": "string" |
| 174 | }, |
| 175 | "max_db_tables": { |
| 176 | "title": "Table limit", |
| 177 | "description": "Table metrics will not be collected for databases that have more tables than the limit. Set to 0 for no limit.", |
| 178 | "type": "integer", |
| 179 | "minimum": 0, |
| 180 | "default": 50 |
| 181 | }, |
| 182 | "max_db_indexes": { |
| 183 | "title": "Index limit", |
| 184 | "description": "Index metrics will not be collected for databases that have more indexes than the limit. Set to 0 for no limit.", |
| 185 | "type": "integer", |
| 186 | "minimum": 0, |
| 187 | "default": 250 |
| 188 | }, |
| 189 | "transaction_time_histogram": { |
| 190 | "title": "Transaction time histogram", |
| 191 | "description": "Buckets for transaction time histogram in milliseconds.", |
| 192 | "type": [ |
| 193 | "array", |
| 194 | "null" |
| 195 | ], |
| 196 | "items": { |
| 197 | "title": "Bucket", |
| 198 | "type": "number", |
| 199 | "exclusiveMinimum": 0 |
| 200 | }, |
| 201 | "uniqueItems": true, |
| 202 | "default": [ |
| 203 | 0.1, |
| 204 | 0.5, |
| 205 | 1, |
| 206 | 2.5, |
| 207 | 5, |
| 208 | 10 |
| 209 | ] |
| 210 | }, |
| 211 | "query_time_histogram": { |
| 212 | "title": "Query time histogram", |
| 213 | "description": "Buckets for query time histogram in milliseconds.", |
| 214 | "type": [ |
| 215 | "array", |
| 216 | "null" |
| 217 | ], |
| 218 | "items": { |
| 219 | "title": "Bucket", |
| 220 | "type": "number", |
| 221 | "exclusiveMinimum": 0 |
| 222 | }, |
| 223 | "uniqueItems": true, |
| 224 | "default": [ |
| 225 | 0.1, |
| 226 | 0.5, |
| 227 | 1, |
| 228 | 2.5, |
| 229 | 5, |
| 230 | 10 |
| 231 | ] |
| 232 | }, |
| 233 | "functions": { |
| 234 | "title": "Functions", |
| 235 | "description": "Configuration for Netdata functions exposed by this collector.", |
| 236 | "type": "object", |
| 237 | "properties": { |
| 238 | "top_queries": { |
| 239 | "title": "Top Queries", |
| 240 | "description": "Configuration for the top-queries function.", |
| 241 | "type": "object", |
| 242 | "properties": { |
| 243 | "disabled": { |
| 244 | "title": "Disabled", |
| 245 | "description": "Disable the top-queries function.", |
| 246 | "type": "boolean", |
| 247 | "default": false |
| 248 | }, |
| 249 | "timeout": { |
| 250 | "title": "Timeout", |
| 251 | "description": "Query timeout in seconds. Set to 0 to use the collector's timeout.", |
| 252 | "type": "number", |
| 253 | "minimum": 0 |
| 254 | }, |
| 255 | "limit": { |
| 256 | "title": "Limit", |
| 257 | "description": "Maximum number of queries to return. Set to 0 to use the default (500).", |
| 258 | "type": "integer", |
| 259 | "minimum": 0, |
| 260 | "maximum": 5000, |
| 261 | "default": 500 |
| 262 | } |
| 263 | } |
| 264 | } |
| 265 | } |
| 266 | } |
| 267 | }, |
| 268 | "required": [ |
| 269 | "dsn" |
| 270 | ] |
| 271 | }, |
| 272 | "uiSchema": { |
| 273 | "uiOptions": { |
| 274 | "fullPage": true |
| 275 | }, |
| 276 | "ui:flavour": "tabs", |
| 277 | "ui:options": { |
| 278 | "tabs": [ |
| 279 | { |
| 280 | "title": "Base", |
| 281 | "fields": [ |
| 282 | "update_every", |
| 283 | "autodetection_retry", |
| 284 | "dsn", |
| 285 | "timeout", |
| 286 | "vnode" |
| 287 | ] |
| 288 | }, |
| 289 | { |
| 290 | "title": "Cloud Auth", |
| 291 | "fields": [ |
| 292 | "cloud_auth" |
| 293 | ] |
| 294 | }, |
| 295 | { |
| 296 | "title": "Database stats", |
| 297 | "fields": [ |
| 298 | "max_db_tables", |
| 299 | "max_db_indexes", |
| 300 | "collect_databases_matching" |
| 301 | ] |
| 302 | }, |
| 303 | { |
| 304 | "title": "Histograms", |
| 305 | "fields": [ |
| 306 | "transaction_time_histogram", |
| 307 | "query_time_histogram" |
| 308 | ] |
| 309 | }, |
| 310 | { |
| 311 | "title": "Functions", |
| 312 | "fields": [ |
| 313 | "functions" |
| 314 | ] |
| 315 | } |
| 316 | ] |
| 317 | }, |
| 318 | "vnode": { |
| 319 | "ui:placeholder": "To use this option, first create a Virtual Node and then reference its name here." |
| 320 | }, |
| 321 | "autodetection_retry": { |
| 322 | "ui:help": "This option determines how frequently (in seconds) Netdata will retry data collection jobs that failed initially, with the value of 60 meaning it retries to start data collection jobs every 60 seconds, while setting it to 0 disables this retry mechanism entirely." |
| 323 | }, |
| 324 | "dsn": { |
| 325 | "ui:placeholder": "postgres://username:password@host:port/dbname" |
| 326 | }, |
| 327 | "cloud_auth": { |
| 328 | "provider": { |
| 329 | "ui:widget": "radio", |
| 330 | "ui:options": { |
| 331 | "inline": true |
| 332 | } |
| 333 | }, |
| 334 | "azure_ad": { |
| 335 | "mode": { |
| 336 | "ui:widget": "radio", |
| 337 | "ui:options": { |
| 338 | "inline": true |
| 339 | }, |
| 340 | "ui:help": "Choose how Netdata gets Azure credentials.\n\n- `service_principal`: Use an Azure app / service principal. Requires `tenant_id`, `client_id`, and `client_secret` in `mode_service_principal`.\n- `managed_identity`: Use the managed identity attached to the Azure resource running Netdata. Set `mode_managed_identity.client_id` only for a user-assigned identity.\n- `default`: Use the Azure SDK `DefaultAzureCredential` chain. This automatically tries available Azure credential sources, such as environment-based credentials, managed identity, and local developer credentials.\n\nUse `service_principal` for explicit app credentials. Use `managed_identity` when Netdata runs on an Azure resource with an attached identity. Use `default` when you want Azure SDK auto-discovery or local development convenience." |
| 341 | }, |
| 342 | "mode_service_principal": { |
| 343 | "client_secret": { |
| 344 | "ui:widget": "password" |
| 345 | } |
| 346 | } |
| 347 | } |
| 348 | }, |
| 349 | "transaction_time_histogram": { |
| 350 | "ui:listFlavour": "list" |
| 351 | }, |
| 352 | "query_time_histogram": { |
| 353 | "ui:listFlavour": "list" |
| 354 | }, |
| 355 | "functions": { |
| 356 | "top_queries": { |
| 357 | "disabled": { |
| 358 | "ui:help": "WARNING: Query text may contain unmasked sensitive literals (PII). Requires pg_stat_statements extension." |
| 359 | } |
| 360 | } |
| 361 | } |
| 362 | } |
| 363 | } |