diff options
author | Ilya Mashchenko <ilya@netdata.cloud> | 2024-03-07 14:14:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-07 14:14:18 +0200 |
commit | 7add1121d2e14f9f61a6c88fb483943402aca300 (patch) | |
tree | 25d12325369cf7624daad9080dfff7d5c6dbff35 | |
parent | 8e446dc58575757e529d91d4a64b68beeb2f98bb (diff) |
improve go.d.plugin dyncfg config schemas (#17124)
62 files changed, 494 insertions, 202 deletions
diff --git a/src/go/collectors/go.d.plugin/agent/functions/manager.go b/src/go/collectors/go.d.plugin/agent/functions/manager.go index 1537c21b27..365d0670b5 100644 --- a/src/go/collectors/go.d.plugin/agent/functions/manager.go +++ b/src/go/collectors/go.d.plugin/agent/functions/manager.go @@ -51,8 +51,6 @@ func (m *Manager) Run(ctx context.Context) { defer func() { m.Info("instance is stopped") }() if !isTerminal { - var wg sync.WaitGroup - r, err := cancelreader.NewReader(m.Input) if err != nil { m.Errorf("fail to create cancel reader: %v", err) @@ -61,6 +59,8 @@ func (m *Manager) Run(ctx context.Context) { go func() { <-ctx.Done(); r.Cancel() }() + var wg sync.WaitGroup + wg.Add(1) go func() { defer wg.Done(); m.run(r) }() diff --git a/src/go/collectors/go.d.plugin/modules/activemq/config_schema.json b/src/go/collectors/go.d.plugin/modules/activemq/config_schema.json index 3eb9715f73..ccef5a804b 100644 --- a/src/go/collectors/go.d.plugin/modules/activemq/config_schema.json +++ b/src/go/collectors/go.d.plugin/modules/activemq/config_schema.json @@ -109,17 +109,20 @@ "tls_ca": { "title": "TLS CA", "description": "The path to the CA certificate file for TLS verification.", - "type": "string" + "type": "string", + "pattern": "^/" }, "tls_cert": { "title": "TLS certificate", "description": "The path to the client certificate file for TLS authentication.", - "type": "string" + "type": "string", + "pattern": "^/" }, "tls_key": { "title": "TLS key", "description": "The path to the client key file for TLS authentication.", - "type": "string" + "type": "string", + "pattern": "^/" } }, "required": [ @@ -188,6 +191,12 @@ "timeout": { "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." }, + "queues_filter": { + "ui:help": "Use `*` to collect all queues. To exclude all queues from collection, use `!*`." + }, + "topics_filter": { + "ui:help": "Use `*` to collect all topics. To exclude all topics from collection, use `!*`." + }, "password": { "ui:widget": "password" }, diff --git a/src/go/collectors/go.d.plugin/modules/apache/config_schema.json b/src/go/collectors/go.d.plugin/modules/apache/config_schema.json index 50e9c418e1..809dae1b11 100644 --- a/src/go/collectors/go.d.plugin/modules/apache/config_schema.json +++ b/src/go/collectors/go.d.plugin/modules/apache/config_schema.json @@ -75,17 +75,20 @@ "tls_ca": { "title": "TLS CA", "description": "The path to the CA certificate file for TLS verification.", - "type": "string" + "type": "string", + "pattern": "^/" }, "tls_cert": { "title": "TLS certificate", "description": "The path to the client certificate file for TLS authentication.", - "type": "string" + "type": "string", + "pattern": "^/" }, "tls_key": { "title": "TLS key", "description": "The path to the client key file for TLS authentication.", - "type": "string" + "type": "string", + "pattern": "^/" } }, "required": [ diff --git a/src/go/collectors/go.d.plugin/modules/bind/config_schema.json b/src/go/collectors/go.d.plugin/modules/bind/config_schema.json index 1b5409c7bd..d4d32852cd 100644 --- a/src/go/collectors/go.d.plugin/modules/bind/config_schema.json +++ b/src/go/collectors/go.d.plugin/modules/bind/config_schema.json @@ -75,17 +75,20 @@ "tls_ca": { "title": "TLS CA", "description": "The path to the CA certificate file for TLS verification.", - "type": "string" + "type": "string", + "pattern": "^/" }, "tls_cert": { "title": "TLS certificate", "description": "The path to the client certificate file for TLS authentication.", - "type": "string" + "type": "string", + "pattern": "^/" }, "tls_key": { "title": "TLS key", "description": "The path to the client key file for TLS authentication.", - "type": "string" + "type": "string", + "pattern": "^/" } }, "required": [ diff --git a/src/go/collectors/go.d.plugin/modules/cassandra/config_schema.json b/src/go/collectors/go.d.plugin/modules/cassandra/config_schema.json index 2cac98e3fd..b1ded50baa 100644 --- a/src/go/collectors/go.d.plugin/modules/cassandra/config_schema.json +++ b/src/go/collectors/go.d.plugin/modules/cassandra/config_schema.json @@ -75,17 +75,20 @@ "tls_ca": { "title": "TLS CA", "description": "The path to the CA certificate file for TLS verification.", - "type": "string" + "type": "string", + "pattern": "^/" }, "tls_cert": { "title": "TLS certificate", "description": "The path to the client certificate file for TLS authentication.", - "type": "string" + "type": "string", + "pattern": "^/" }, "tls_key": { "title": "TLS key", "description": "The path to the client key file for TLS authentication.", - "type": "string" + "type": "string", + "pattern": "^/" } }, "required": [ diff --git a/src/go/collectors/go.d.plugin/modules/cockroachdb/config_schema.json b/src/go/collectors/go.d.plugin/modules/cockroachdb/config_schema.json index 1149c0f179..2b9b32bed7 100644 --- a/src/go/collectors/go.d.plugin/modules/cockroachdb/config_schema.json +++ b/src/go/collectors/go.d.plugin/modules/cockroachdb/config_schema.json @@ -75,17 +75,20 @@ "tls_ca": { "title": "TLS CA", "description": "The path to the CA certificate file for TLS verification.", - "type": "string" + "type": "string", + "pattern": "^/" }, "tls_cert": { "title": "TLS certificate", "description": "The path to the client certificate file for TLS authentication.", - "type": "string" + "type": "string", + "pattern": "^/" }, "tls_key": { "title": "TLS key", "description": "The path to the client key file for TLS authentication.", - "type": "string" + "type": "string", + "pattern": "^/" } }, "required": [ diff --git a/src/go/collectors/go.d.plugin/modules/consul/config_schema.json b/src/go/collectors/go.d.plugin/modules/consul/config_schema.json index 709221522a..17de0d1cdb 100644 --- a/src/go/collectors/go.d.plugin/modules/consul/config_schema.json +++ b/src/go/collectors/go.d.plugin/modules/consul/config_schema.json @@ -81,17 +81,20 @@ "tls_ca": { "title": "TLS CA", "description": "The path to the CA certificate file for TLS verification.", - "type": "string" + "type": "string", + "pattern": "^/" }, "tls_cert": { "title": "TLS certificate", "description": "The path to the client certificate file for TLS authentication.", - "type": "string" + "type": "string", + "pattern": "^/" }, "tls_key": { "title": "TLS key", "description": "The path to the client key file for TLS authentication.", - "type": "string" + "type": "string", + "pattern": "^/" } }, "required": [ diff --git a/src/go/collectors/go.d.plugin/modules/coredns/config_schema.json b/src/go/collectors/go.d.plugin/modules/coredns/config_schema.json index 9c0397e085..d62ef5d69b 100644 --- a/src/go/collectors/go.d.plugin/modules/coredns/config_schema.json +++ b/src/go/collectors/go.d.plugin/modules/coredns/config_schema.json @@ -30,6 +30,60 @@ "description": "If set, the client will not follow HTTP redirects automatically.", "type": "boolean" }, + "per_server_stats": { + "title": "Server selector", + "description": "Configures collection of per-server statistics. If left empty, no stats will be collected. Matching is performed against the `server` label value.", + "type": "object", + "properties": { + "includes": { + "title": "Include", + "description": "Include servers whose names match any of the specified inclusion [patterns](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/pkg/matcher#readme).", + "type": "array", + "items": { + "title": "Server pattern", + "type": "string" + }, + "uniqueItems": true + }, + "excludes": { + "title": "Exclude", + "description": "Exclude servers whose names match any of the specified exclusion [patterns](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/pkg/matcher#readme).", + "type": "array", + "items": { + "title": "Server pattern", + "type": "string" + }, + "uniqueItems": true + } + } + }, + "per_zone_stats": { + "title": "Zone selector", + "description": "Configures collection of per-zone statistics. If left empty, no stats will be collected. Matching is performed against the `zone` label value.", + "type": "object", + "properties": { + "includes": { + "title": "Include", + "description": "Include zones whose names match any of the specified inclusion [patterns](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/pkg/matcher#readme).", + "type": "array", + "items": { + "title": "Zone pattern", + "type": "string" + }, + "uniqueItems": true + }, + "excludes": { + "title": "Exclude", + "description": "Exclude zones whose names match any of the specified exclusion [patterns](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/pkg/matcher#readme).", + "type": "array", + "items": { + "title": "Zone pattern", + "type": "string" + }, + "uniqueItems": true + } + } + }, "username": { "title": "Username", "description": "The username for basic authentication.", @@ -75,17 +129,20 @@ "tls_ca": { "title": "TLS CA", "description": "The path to the CA certificate file for TLS verification.", - "type": "string" + "type": "string", + "pattern": "^/" }, "tls_cert": { "title": "TLS certificate", "description": "The path to the client certificate file for TLS authentication.", - "type": "string" + "type": "string", + "pattern": "^/" }, "tls_key": { "title": "TLS key", "description": "The path to the client key file for TLS authentication.", - "type": "string" + "type": "string", + "pattern": "^/" } }, "required": [ @@ -93,6 +150,9 @@ ] }, "uiSchema": { + "uiOptions": { + "fullPage": true + }, "ui:flavour": "tabs", "ui:options": { "tabs": [ @@ -106,6 +166,13 @@ ] }, { + "title": "Server & Zone stats", + "fields": [ + "per_server_stats", + "per_zone_stats" + ] + }, + { "title": "Auth", "fields": [ "username", @@ -137,12 +204,17 @@ } ] }, - "uiOptions": { - "fullPage": true - }, "timeout": { "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." }, + "per_server_stats": { + "ui:help": "The logic for inclusion and exclusion is as follows: `(include1 OR include2) AND !(exclude1 OR exclude2)`.", + "ui:collapsible": true + }, + "per_zone_stats": { + "ui:help": "The logic for inclusion and exclusion is as follows: `(include1 OR include2) AND !(exclude1 OR exclude2)`.", + "ui:collapsible": true + }, "password": { "ui:widget": "password" }, diff --git a/src/go/collectors/go.d.plugin/modules/couchbase/config_schema.json b/src/go/collectors/go.d.plugin/modules/couchbase/config_schema.json index b1a2001191..15619244e2 100644 --- a/src/go/collectors/go.d.plugin/modules/couchbase/config_schema.json +++ b/src/go/collectors/go.d.plugin/modules/couchbase/config_schema.json @@ -75,17 +75,20 @@ "tls_ca": { "title": "TLS CA", "description": "The path to the CA certificate file for TLS verification.", - "type": "string" + "type": "string", + "pattern": "^/" }, "tls_cert": { "title": "TLS certificate", "description": "The path to the client certificate file for TLS authentication.", - "type": "string" + "type": "string", + "pattern": "^/" }, "tls_key": { "title": "TLS key", "description": "The path to the client key file for TLS authentication.", - "type": "string" + "type": "string", + "pattern": "^/" } }, "required": [ diff --git a/src/go/collectors/go.d.plugin/modules/couchdb/config_schema.json b/src/go/collectors/go.d.plugin/modules/couchdb/config_schema.json index 8f40beee97..ff32ebe3b6 100644 --- a/src/go/collectors/go.d.plugin/modules/couchdb/config_schema.json +++ b/src/go/collectors/go.d.plugin/modules/couchdb/config_schema.json @@ -38,7 +38,7 @@ }, "databases": { "title": "Databases", - "description": "A space-separated list of database names for which database-specific statistics should be displayed.", + "description": "A space-separated list of database names for which you want to collect data. Leave blank to exclude database statistics.", "type": "string" }, "username": { @@ -86,17 +86,20 @@ "tls_ca": { "title": "TLS CA", "description": "The path to the CA certificate file for TLS verification.", - "type": "string" + "type": "string", + "pattern": "^/" }, "tls_cert": { "title": "TLS certificate", "description": "The path to the client certificate file for TLS authentication.", - "type": "string" + "type": "string", + "pattern": "^/" }, "tls_key": { "title": "TLS key", "description": "The path to the client key file for TLS authentication.", - "type": "string" + "type": "string", + "pattern": "^/" } }, "required": [ diff --git a/src/go/collectors/go.d.plugin/modules/dnsdist/config_schema.json b/src/go/collectors/go.d.plugin/modules/dnsdist/config_schema.json index 6cbedd5489..745c49c864 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsdist/config_schema.json +++ b/src/go/collectors/go.d.plugin/modules/dnsdist/config_schema.json @@ -75,17 +75,20 @@ "tls_ca": { "title": "TLS CA", "description": "The path to the CA certificate file for TL |