Skip to content

Commit

Permalink
improve go.d.plugin dyncfg config schemas (netdata#17124)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyam8 committed Mar 7, 2024
1 parent 8e446dc commit 7add112
Show file tree
Hide file tree
Showing 62 changed files with 494 additions and 202 deletions.
4 changes: 2 additions & 2 deletions src/go/collectors/go.d.plugin/agent/functions/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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) }()

Expand Down
15 changes: 12 additions & 3 deletions src/go/collectors/go.d.plugin/modules/activemq/config_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down Expand Up @@ -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"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
9 changes: 6 additions & 3 deletions src/go/collectors/go.d.plugin/modules/bind/config_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
84 changes: 78 additions & 6 deletions src/go/collectors/go.d.plugin/modules/coredns/config_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down Expand Up @@ -75,24 +129,30 @@
"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": [
"url"
]
},
"uiSchema": {
"uiOptions": {
"fullPage": true
},
"ui:flavour": "tabs",
"ui:options": {
"tabs": [
Expand All @@ -105,6 +165,13 @@
"not_follow_redirects"
]
},
{
"title": "Server & Zone stats",
"fields": [
"per_server_stats",
"per_zone_stats"
]
},
{
"title": "Auth",
"fields": [
Expand Down Expand Up @@ -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"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
11 changes: 7 additions & 4 deletions src/go/collectors/go.d.plugin/modules/couchdb/config_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
Loading

0 comments on commit 7add112

Please sign in to comment.