Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
d01d2da
PMM-12832 Rough implementation.
JiriCtvrtka Mar 12, 2026
ca36e37
PMM-12832 Fix.
JiriCtvrtka Mar 12, 2026
eb9dc4e
Merge branch 'v3' into PMM-12832-exporter-timeouts
JiriCtvrtka Mar 12, 2026
342e4c0
PMM-12832 More exporters, refactor.
JiriCtvrtka Mar 13, 2026
75c0854
Merge remote-tracking branch 'origin/PMM-12832-exporter-timeouts' int…
JiriCtvrtka Mar 13, 2026
e009b06
PMM-12832 Another parts.
JiriCtvrtka Mar 16, 2026
fe76cec
PMM-12832 Mongo change, list.
JiriCtvrtka Mar 17, 2026
3dd7cb4
PMM-12832 Changes, refactor.
JiriCtvrtka Mar 17, 2026
3831afd
PMM-12832 Refactor of agent model.
JiriCtvrtka Mar 17, 2026
27895b3
PMM-12832 Lint.
JiriCtvrtka Mar 17, 2026
dad3e75
PMM-12832 Inventory timeout for all.
JiriCtvrtka Mar 17, 2026
64d37ca
Merge branch 'v3' into PMM-12832-exporter-timeouts
JiriCtvrtka Mar 17, 2026
d1c530e
PMM-12832 Add change func after merge.
JiriCtvrtka Mar 17, 2026
3c358f0
PMM-12832 Fix for now.
JiriCtvrtka Mar 17, 2026
658fc92
PMM-12832 Changes.
JiriCtvrtka Mar 17, 2026
58db609
PMM-12832 Fix tests.
JiriCtvrtka Mar 17, 2026
b3d65c7
PMM-12832 Changes.
JiriCtvrtka Mar 17, 2026
8f44fc6
PMM-12832 Changes.
JiriCtvrtka Mar 18, 2026
c329c2a
PMM-12832 Changes.
JiriCtvrtka Mar 18, 2026
1b924cd
PMM-12832 Changes.
JiriCtvrtka Mar 18, 2026
098d50e
PMM-12832 Change for RTA.
JiriCtvrtka Mar 18, 2026
5811d1b
PMM-12832 Fix.
JiriCtvrtka Mar 18, 2026
42f5b86
PMM-12832 Fix.
JiriCtvrtka Mar 18, 2026
69ed781
PMM-12832 Fix.
JiriCtvrtka Mar 18, 2026
bccea8d
PMM-12832 Refactor.
JiriCtvrtka Mar 18, 2026
80226ed
PMM-12832 Remove not related types.
JiriCtvrtka Mar 18, 2026
c6dd6e7
PMM-12832 Changes.
JiriCtvrtka Mar 18, 2026
963a998
PMM-12832 Remote, valkey, etc.
JiriCtvrtka Mar 18, 2026
4e09994
PMM-12832 Fix.
JiriCtvrtka Mar 18, 2026
04514be
PMM-12832 Lint.
JiriCtvrtka Mar 18, 2026
64a5e7a
PMM-12832 Lint.
JiriCtvrtka Mar 19, 2026
fb125cb
PMM-12832 New tests.
JiriCtvrtka Mar 19, 2026
f503841
Merge branch 'v3' into PMM-12832-exporter-timeouts
JiriCtvrtka Mar 20, 2026
fe7a7fe
PMM-12832 Better comment.
JiriCtvrtka Mar 20, 2026
3949531
PMM-12832 Fix for missed parts.
JiriCtvrtka Mar 20, 2026
0a05b27
Merge branch 'v3' into PMM-12832-exporter-timeouts
JiriCtvrtka Mar 20, 2026
8632984
PMM-12832 Format.
JiriCtvrtka Mar 20, 2026
a0a72b8
Merge remote-tracking branch 'origin/PMM-12832-exporter-timeouts' int…
JiriCtvrtka Mar 20, 2026
69fd130
Merge branch 'v3' into PMM-12832-exporter-timeouts
JiriCtvrtka Mar 20, 2026
afefbea
PMM-12832 Valkey refactor.
JiriCtvrtka Mar 21, 2026
1c01e3a
Merge remote-tracking branch 'origin/PMM-12832-exporter-timeouts' int…
JiriCtvrtka Mar 21, 2026
c6246b9
PMM-12832 Requested changes.
JiriCtvrtka Mar 22, 2026
c84fc3f
PMM-12832 RDS fix.
JiriCtvrtka Mar 22, 2026
089c328
PMM-12832 Correct timeout flag for Valkey/Redis.
JiriCtvrtka Mar 22, 2026
0eb4514
PMM-12832 Lint.
JiriCtvrtka Mar 22, 2026
85c6bbd
Merge branch 'v3' into PMM-12832-exporter-timeouts
ademidoff Apr 6, 2026
9205dd8
PMM-12832 Fix for Mongo in DSN helpers.
JiriCtvrtka Apr 6, 2026
7eada45
Merge branch 'v3' into PMM-12832-exporter-timeouts
JiriCtvrtka Apr 6, 2026
630db88
PMM-12832 EffectiveDialTimeout refactor based on Max suggestion.
JiriCtvrtka Apr 6, 2026
1f34478
PMM-12832 Increase exporters default timeout based on Alex suggestion.
JiriCtvrtka Apr 6, 2026
dd25717
PMM-12832 Adjust test for new exporters default timeouts.
JiriCtvrtka Apr 6, 2026
5660c37
PMM-12832 Fix tests for new timeouts of exporters.
JiriCtvrtka Apr 6, 2026
6d421b1
PMM-12832 Small refactor.
JiriCtvrtka Apr 6, 2026
1648cba
PMM-12832 Rename to connection timeout.
JiriCtvrtka Apr 6, 2026
150c7a8
Merge branch 'v3' into PMM-12832-exporter-timeouts
JiriCtvrtka Apr 6, 2026
41c11c2
PMM-12832 Fix rest of timeouts in tests.
JiriCtvrtka Apr 6, 2026
8e7f5cf
PMM-12832 Lint.
JiriCtvrtka Apr 6, 2026
cfedb14
PMM-12832 Lint.
JiriCtvrtka Apr 6, 2026
4901944
PMM-12832 Better comment.
JiriCtvrtka Apr 6, 2026
dcb5913
PMM-12832 Optional connection timeout in change.
JiriCtvrtka Apr 6, 2026
427cfea
PMM-12832 Connection timeout optional in change.
JiriCtvrtka Apr 6, 2026
6217582
PMM-12832 Another changes to change and copilot suggestions.
JiriCtvrtka Apr 6, 2026
f392e4b
PMM-12832 Fully optional connection timeout.
JiriCtvrtka Apr 6, 2026
0ffbccd
PMM-12832 FIx test.
JiriCtvrtka Apr 7, 2026
f495b6d
PMM-12832 Better coverage.
JiriCtvrtka Apr 7, 2026
b4eb5be
PMM-12832 Fix prometheus scrape interval for tiny intervals.
JiriCtvrtka Apr 7, 2026
579a597
PMM-12832 Cap for connection timeout.
JiriCtvrtka Apr 7, 2026
9ffdc58
PMM-12832 Management no longer return connection interval when not set.
JiriCtvrtka Apr 7, 2026
8d6a739
PMM-12832 Validation for connection interval.
JiriCtvrtka Apr 7, 2026
2fb962a
PMM-12832 Gen fix.
JiriCtvrtka Apr 7, 2026
e5bd119
Merge branch 'v3' into PMM-12832-exporter-timeouts
JiriCtvrtka Apr 7, 2026
e7bffb5
PMM-12832 Fix mongo test.
JiriCtvrtka Apr 7, 2026
14041b9
PMM-12832 Update comments/name from timeout to connection timeout.
JiriCtvrtka Apr 7, 2026
0b08fc1
PMM-12832 Copilot suggestion.
JiriCtvrtka Apr 7, 2026
59184b8
PMM-12832 Rounding for MySQL timeouts.
JiriCtvrtka Apr 7, 2026
7bd223b
PMM-12832 Add missed connection timeout in ChangeNodeExporter.
JiriCtvrtka Apr 7, 2026
a1f36ae
PMM-12832 Add missed connection timeout in ChangeExternalExporter.
JiriCtvrtka Apr 7, 2026
f5d9dbc
PMM-12832 RDS missed places.
JiriCtvrtka Apr 7, 2026
92445aa
PMM-12832 Fix Azure missed places.
JiriCtvrtka Apr 7, 2026
7af5d3a
PMM-12832 Format.
JiriCtvrtka Apr 7, 2026
b500a7b
PMM-12832 Test for 0 and nil timeouts.
JiriCtvrtka Apr 7, 2026
e209d54
PMM-12832 Fix concern from Copilot.
JiriCtvrtka Apr 7, 2026
05e15a0
PMM-12832 Typo.
JiriCtvrtka Apr 7, 2026
70a078f
PMM-12832 Missed places after RDS discovery.
JiriCtvrtka Apr 7, 2026
f0c4b6a
PMM-12832 Format.
JiriCtvrtka Apr 7, 2026
fdefc8c
PMM-12832 Use variable instead hardcoded value.
JiriCtvrtka Apr 7, 2026
d8bd0bc
Update admin/commands/inventory/change_agent_helpers.go
JiriCtvrtka Apr 7, 2026
0994458
PMM-12832 Update comment.
JiriCtvrtka Apr 7, 2026
9f8167f
PMM-12832 List only supported exporters type in switch case.
JiriCtvrtka Apr 7, 2026
6bd86cc
PMM-12832 More explaining comments for Copilot.
JiriCtvrtka Apr 7, 2026
d82da03
PMM-12832 Round timeout value for PG.
JiriCtvrtka Apr 7, 2026
6f87420
PMM-12832 Lint.
JiriCtvrtka Apr 7, 2026
f5a9fd7
PMM-12832 Better comment.
JiriCtvrtka Apr 8, 2026
b3dc97b
PMM-12832 Shared method for Node, External, Azure and RDS exporter.
JiriCtvrtka Apr 8, 2026
518b33c
PMM-12832 More precise description for connection timeout flag.
JiriCtvrtka Apr 8, 2026
5ec76de
Merge branch 'v3' into PMM-12832-exporter-timeouts
JiriCtvrtka Apr 8, 2026
61f05f9
PMM-12832 Flags from string to duration.
JiriCtvrtka Apr 10, 2026
5d8ea95
PMM-12832 Duration helper moved to utils.
JiriCtvrtka Apr 10, 2026
d707ce9
PMM-12832 All creates has connection timeouts passed as pointers.
JiriCtvrtka Apr 10, 2026
b34943b
PMM-12832 Use generic method for pointer.
JiriCtvrtka Apr 10, 2026
9f20473
PMM-12832 Remove unnecessary checks.
JiriCtvrtka Apr 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions admin/commands/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ func (cmd *ConfigCommand) args(globals *flags.GlobalFlags) ([]string, bool) {
res = append(res, "--server-insecure-tls")
}

if cmd.LogLevelFatalFlags.LogLevel != "" {
res = append(res, fmt.Sprintf("--log-level=%s", cmd.LogLevelFatalFlags.LogLevel))
if cmd.LogLevel != "" {
res = append(res, fmt.Sprintf("--log-level=%s", cmd.LogLevel))
}
if globals.EnableDebug {
res = append(res, "--debug")
Expand Down
30 changes: 30 additions & 0 deletions admin/commands/helpers.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Copyright (C) 2023 Percona LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package commands

import (
"time"

"github.com/AlekSi/pointer"
)

// DurationString returns the string representation of a duration flag.
func DurationString(value *time.Duration) *string {
if value == nil {
return nil
}

return pointer.ToString(value.String())
}
43 changes: 23 additions & 20 deletions admin/commands/inventory/add_agent_external_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package inventory
import (
"fmt"
"strings"
"time"

"github.com/AlekSi/pointer"

Expand Down Expand Up @@ -51,16 +52,17 @@ func (res *addAgentExternalExporterResult) String() string {

// AddAgentExternalExporterCommand is used by Kong for CLI flags and commands.
type AddAgentExternalExporterCommand struct {
RunsOnNodeID string `required:"" help:"Node identifier where this instance runs"`
ServiceID string `required:"" help:"Service identifier"`
Username string `help:"HTTP Basic auth username for scraping metrics"`
Password string `help:"HTTP Basic auth password for scraping metrics"`
Scheme string `help:"Scheme to generate URI to exporter metrics endpoints (http, https)"`
MetricsPath string `help:"Path under which metrics are exposed, used to generate URI"`
ListenPort int64 `required:"" placeholder:"port" help:"Listen port for scraping metrics"`
CustomLabels map[string]string `mapsep:"," help:"Custom user-assigned labels"`
PushMetrics bool `help:"Enables push metrics model flow, it will be sent to the server by an agent"`
TLSSkipVerify bool `help:"Skip TLS certificate verification"`
RunsOnNodeID string `required:"" help:"Node identifier where this instance runs"`
ServiceID string `required:"" help:"Service identifier"`
Username string `help:"HTTP Basic auth username for scraping metrics"`
Password string `help:"HTTP Basic auth password for scraping metrics"`
Scheme string `help:"Scheme to generate URI to exporter metrics endpoints (http, https)"`
MetricsPath string `help:"Path under which metrics are exposed, used to generate URI"`
ListenPort int64 `required:"" placeholder:"port" help:"Listen port for scraping metrics"`
CustomLabels map[string]string `mapsep:"," help:"Custom user-assigned labels"`
PushMetrics bool `help:"Enables push metrics model flow, it will be sent to the server by an agent"`
TLSSkipVerify bool `help:"Skip TLS certificate verification"`
ConnectionTimeout *time.Duration `placeholder:"DURATION" help:"Connection timeout to use for exporter (e.g. 1s, 1.5s)"`
}

// RunCmd executes the AddAgentExternalExporterCommand and returns the result.
Expand All @@ -74,16 +76,17 @@ func (cmd *AddAgentExternalExporterCommand) RunCmd() (commands.Result, error) {
params := &agents.AddAgentParams{
Body: agents.AddAgentBody{
ExternalExporter: &agents.AddAgentParamsBodyExternalExporter{
RunsOnNodeID: cmd.RunsOnNodeID,
ServiceID: cmd.ServiceID,
Username: cmd.Username,
Password: cmd.Password,
Scheme: cmd.Scheme,
MetricsPath: cmd.MetricsPath,
ListenPort: cmd.ListenPort,
CustomLabels: pointer.Get(customLabels),
PushMetrics: cmd.PushMetrics,
TLSSkipVerify: cmd.TLSSkipVerify,
RunsOnNodeID: cmd.RunsOnNodeID,
ServiceID: cmd.ServiceID,
Username: cmd.Username,
Password: cmd.Password,
Scheme: cmd.Scheme,
MetricsPath: cmd.MetricsPath,
ListenPort: cmd.ListenPort,
CustomLabels: pointer.Get(customLabels),
PushMetrics: cmd.PushMetrics,
TLSSkipVerify: cmd.TLSSkipVerify,
ConnectionTimeout: pointer.Get(commands.DurationString(cmd.ConnectionTimeout)),
},
},
Context: commands.Ctx,
Expand Down
6 changes: 5 additions & 1 deletion admin/commands/inventory/add_agent_mongodb_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
package inventory

import (
"time"

"github.com/AlekSi/pointer"

"github.com/percona/pmm/admin/commands"
Expand Down Expand Up @@ -67,6 +69,7 @@ type AddAgentMongodbExporterCommand struct {
DisableCollectors []string `help:"Comma-separated list of collector names to exclude from exporter"`
StatsCollections []string `help:"Collections for collstats & indexstats"`
CollectionsLimit int32 `name:"max-collections-limit" placeholder:"number" help:"Disable collstats & indexstats if there are more than <n> collections"` //nolint:lll
ConnectionTimeout *time.Duration `placeholder:"DURATION" help:"Connection timeout to use for exporter (e.g. 1s, 1.5s)"`

flags.LogLevelFatalFlags
}
Expand Down Expand Up @@ -104,7 +107,8 @@ func (cmd *AddAgentMongodbExporterCommand) RunCmd() (commands.Result, error) {
DisableCollectors: commands.ParseDisableCollectors(cmd.DisableCollectors),
StatsCollections: commands.ParseDisableCollectors(cmd.StatsCollections),
CollectionsLimit: cmd.CollectionsLimit,
LogLevel: cmd.LogLevelFatalFlags.LogLevel.EnumValue(),
LogLevel: cmd.LogLevel.EnumValue(),
ConnectionTimeout: pointer.Get(commands.DurationString(cmd.ConnectionTimeout)),
},
},
Context: commands.Ctx,
Expand Down
5 changes: 4 additions & 1 deletion admin/commands/inventory/add_agent_mysqld_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package inventory
import (
"fmt"
"strconv"
"time"

"github.com/AlekSi/pointer"

Expand Down Expand Up @@ -103,6 +104,7 @@ type AddAgentMysqldExporterCommand struct {
PushMetrics bool `help:"Enables push metrics model flow, it will be sent to the server by an agent"`
ExposeExporter bool `help:"Expose the address of the exporter publicly on 0.0.0.0"`
DisableCollectors []string `help:"Comma-separated list of collector names to exclude from exporter"`
ConnectionTimeout *time.Duration `placeholder:"DURATION" help:"Connection timeout to use for exporter (e.g. 1s, 1.5s)"`

flags.LogLevelNoFatalFlags
}
Expand Down Expand Up @@ -152,7 +154,8 @@ func (cmd *AddAgentMysqldExporterCommand) RunCmd() (commands.Result, error) {
PushMetrics: cmd.PushMetrics,
ExposeExporter: cmd.ExposeExporter,
DisableCollectors: commands.ParseDisableCollectors(cmd.DisableCollectors),
LogLevel: cmd.LogLevelNoFatalFlags.LogLevel.EnumValue(),
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lint. Here and all other places.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While they are functionally equivalent, that must have been done for documentation purpose.

What was the lint error?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error: admin/commands/inventory/add_agent_postgres_exporter.go:121:28: QF1008: could remove embedded field "LogLevelNoFatalFlags" from selector (staticcheck)
LogLevel: cmd.LogLevelNoFatalFlags.LogLevel.EnumValue(),

LogLevel: cmd.LogLevel.EnumValue(),
ConnectionTimeout: pointer.Get(commands.DurationString(cmd.ConnectionTimeout)),
},
},
Context: commands.Ctx,
Expand Down
8 changes: 7 additions & 1 deletion admin/commands/inventory/add_agent_node_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
package inventory

import (
"time"

"github.com/AlekSi/pointer"

"github.com/percona/pmm/admin/commands"
"github.com/percona/pmm/admin/pkg/flags"
"github.com/percona/pmm/api/inventory/v1/json/client"
Expand Down Expand Up @@ -49,6 +53,7 @@ type AddAgentNodeExporterCommand struct {
PushMetrics bool `help:"Enables push metrics model flow, it will be sent to the server by an agent"`
ExposeExporter bool `help:"Expose the address of the exporter publicly on 0.0.0.0"`
DisableCollectors []string `help:"Comma-separated list of collector names to exclude from exporter"`
ConnectionTimeout *time.Duration `placeholder:"DURATION" help:"Connection timeout to use for exporter (e.g. 1s, 1.5s)"`

flags.LogLevelNoFatalFlags
}
Expand All @@ -64,7 +69,8 @@ func (cmd *AddAgentNodeExporterCommand) RunCmd() (commands.Result, error) {
PushMetrics: cmd.PushMetrics,
ExposeExporter: cmd.ExposeExporter,
DisableCollectors: commands.ParseDisableCollectors(cmd.DisableCollectors),
LogLevel: cmd.LogLevelNoFatalFlags.LogLevel.EnumValue(),
LogLevel: cmd.LogLevel.EnumValue(),
ConnectionTimeout: pointer.Get(commands.DurationString(cmd.ConnectionTimeout)),
},
},
Context: commands.Ctx,
Expand Down
18 changes: 12 additions & 6 deletions admin/commands/inventory/add_agent_postgres_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
package inventory

import (
"time"

"github.com/AlekSi/pointer"

"github.com/percona/pmm/admin/commands"
"github.com/percona/pmm/admin/pkg/flags"
"github.com/percona/pmm/api/inventory/v1/json/client"
Expand Down Expand Up @@ -67,6 +71,7 @@ type AddAgentPostgresExporterCommand struct {
TLSKeyFile string `help:"TLS certificate key file"`
AutoDiscoveryLimit int32 `default:"0" placeholder:"NUMBER" help:"Auto-discovery will be disabled if there are more than that number of databases (default: server-defined, -1: always disabled)"`
MaxExporterConnections int32 `default:"0" placeholder:"NUMBER" help:"Maximum number of connections that exporter can make to PostgreSQL instance (default: server-defined)"`
ConnectionTimeout *time.Duration `placeholder:"DURATION" help:"Connection timeout to use for exporter (e.g. 1s, 1.5s)"`

flags.LogLevelNoFatalFlags
}
Expand Down Expand Up @@ -112,12 +117,13 @@ func (cmd *AddAgentPostgresExporterCommand) RunCmd() (commands.Result, error) {
AutoDiscoveryLimit: cmd.AutoDiscoveryLimit,
MaxExporterConnections: cmd.MaxExporterConnections,

TLS: cmd.TLS,
TLSSkipVerify: cmd.TLSSkipVerify,
TLSCa: tlsCa,
TLSCert: tlsCert,
TLSKey: tlsKey,
LogLevel: cmd.LogLevelNoFatalFlags.LogLevel.EnumValue(),
TLS: cmd.TLS,
TLSSkipVerify: cmd.TLSSkipVerify,
TLSCa: tlsCa,
TLSCert: tlsCert,
TLSKey: tlsKey,
LogLevel: cmd.LogLevel.EnumValue(),
ConnectionTimeout: pointer.Get(commands.DurationString(cmd.ConnectionTimeout)),
},
},
Context: commands.Ctx,
Expand Down
8 changes: 7 additions & 1 deletion admin/commands/inventory/add_agent_proxysql_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
package inventory

import (
"time"

"github.com/AlekSi/pointer"

"github.com/percona/pmm/admin/commands"
"github.com/percona/pmm/admin/pkg/flags"
"github.com/percona/pmm/api/inventory/v1/json/client"
Expand Down Expand Up @@ -60,6 +64,7 @@ type AddAgentProxysqlExporterCommand struct {
PushMetrics bool `help:"Enables push metrics model flow, it will be sent to the server by an agent"`
ExposeExporter bool `help:"Expose the address of the exporter publicly on 0.0.0.0"`
DisableCollectors []string `help:"Comma-separated list of collector names to exclude from exporter"`
ConnectionTimeout *time.Duration `placeholder:"DURATION" help:"Connection timeout to use for exporter (e.g. 1s, 1.5s)"`

flags.LogLevelFatalFlags
}
Expand All @@ -82,7 +87,8 @@ func (cmd *AddAgentProxysqlExporterCommand) RunCmd() (commands.Result, error) {
PushMetrics: cmd.PushMetrics,
ExposeExporter: cmd.ExposeExporter,
DisableCollectors: commands.ParseDisableCollectors(cmd.DisableCollectors),
LogLevel: cmd.LogLevelFatalFlags.LogLevel.EnumValue(),
LogLevel: cmd.LogLevel.EnumValue(),
ConnectionTimeout: pointer.Get(commands.DurationString(cmd.ConnectionTimeout)),
},
},
Context: commands.Ctx,
Expand Down
8 changes: 7 additions & 1 deletion admin/commands/inventory/add_agent_rds_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
package inventory

import (
"time"

"github.com/AlekSi/pointer"

"github.com/percona/pmm/admin/commands"
"github.com/percona/pmm/admin/pkg/flags"
"github.com/percona/pmm/api/inventory/v1/json/client"
Expand Down Expand Up @@ -56,6 +60,7 @@ type AddAgentRDSExporterCommand struct {
DisableBasicMetrics bool `help:"Disable basic metrics"`
DisableEnhancedMetrics bool `help:"Disable enhanced metrics"`
PushMetrics bool `help:"Enables push metrics model flow, it will be sent to the server by an agent"`
ConnectionTimeout *time.Duration `placeholder:"DURATION" help:"Connection timeout to use for exporter (e.g. 1s, 1.5s)"`

flags.LogLevelFatalFlags
}
Expand All @@ -75,7 +80,8 @@ func (cmd *AddAgentRDSExporterCommand) RunCmd() (commands.Result, error) {
DisableBasicMetrics: cmd.DisableBasicMetrics,
DisableEnhancedMetrics: cmd.DisableEnhancedMetrics,
PushMetrics: cmd.PushMetrics,
LogLevel: cmd.LogLevelFatalFlags.LogLevel.EnumValue(),
LogLevel: cmd.LogLevel.EnumValue(),
ConnectionTimeout: pointer.Get(commands.DurationString(cmd.ConnectionTimeout)),
},
},
Context: commands.Ctx,
Expand Down
4 changes: 4 additions & 0 deletions admin/commands/inventory/add_agent_valkey_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
package inventory

import (
"time"

"github.com/AlekSi/pointer"

"github.com/percona/pmm/admin/commands"
Expand Down Expand Up @@ -68,6 +70,7 @@ type AddAgentValkeyExporterCommand struct {
PushMetrics bool `help:"Enables push metrics model flow, it will be sent to the server by an agent"`
ExposeExporter bool `help:"Expose the address of the exporter publicly on 0.0.0.0"`
DisableCollectors []string `help:"Comma-separated list of collector names to exclude from exporter"`
ConnectionTimeout *time.Duration `placeholder:"DURATION" help:"Connection timeout to use for exporter (e.g. 1s, 1.5s)"`

flags.LogLevelNoFatalFlags
}
Expand Down Expand Up @@ -116,6 +119,7 @@ func (cmd *AddAgentValkeyExporterCommand) RunCmd() (commands.Result, error) {
ExposeExporter: cmd.ExposeExporter,
DisableCollectors: commands.ParseDisableCollectors(cmd.DisableCollectors),
LogLevel: convertLogLevelPtr(&cmd.LogLevel),
ConnectionTimeout: pointer.Get(commands.DurationString(cmd.ConnectionTimeout)),
},
},
Context: commands.Ctx,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package inventory

import (
"fmt"
"time"

"github.com/percona/pmm/admin/commands"
"github.com/percona/pmm/admin/pkg/flags"
Expand Down Expand Up @@ -77,7 +78,8 @@ type ChangeAgentAzureDatabaseExporterCommand struct {
AzureResourceGroup *string `help:"Azure Resource Group"`

// Exporter options
PushMetrics *bool `help:"Enable push metrics with vmagent"`
PushMetrics *bool `help:"Enable push metrics with vmagent"`
ConnectionTimeout *time.Duration `placeholder:"DURATION" help:"Connection timeout to use for exporter (e.g. 1s, 1.5s)"`

// Custom labels
CustomLabels *map[string]string `mapsep:"," help:"Custom user-assigned labels"`
Expand All @@ -99,6 +101,7 @@ func (cmd *ChangeAgentAzureDatabaseExporterCommand) RunCmd() (commands.Result, e
AzureResourceGroup: cmd.AzureResourceGroup,
EnablePushMetrics: cmd.PushMetrics,
LogLevel: convertLogLevelPtr(cmd.LogLevel),
ConnectionTimeout: commands.DurationString(cmd.ConnectionTimeout),
}

if customLabels != nil {
Expand Down
11 changes: 7 additions & 4 deletions admin/commands/inventory/change_agent_external_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package inventory

import (
"fmt"
"time"

"github.com/percona/pmm/admin/commands"
"github.com/percona/pmm/api/inventory/v1/json/client"
Expand Down Expand Up @@ -65,10 +66,11 @@ type ChangeAgentExternalExporterCommand struct {
Username *string `help:"Username for the external exporter"`

// External-specific options
ListenPort *int64 `help:"Listen port for the external exporter"`
MetricsScheme *string `help:"Metrics scheme (http or https)"`
MetricsPath *string `help:"Metrics path"`
PushMetrics *bool `help:"Enable push metrics with vmagent"`
ListenPort *int64 `help:"Listen port for the external exporter"`
MetricsScheme *string `help:"Metrics scheme (http or https)"`
MetricsPath *string `help:"Metrics path"`
PushMetrics *bool `help:"Enable push metrics with vmagent"`
ConnectionTimeout *time.Duration `placeholder:"DURATION" help:"Connection timeout to use for exporter (e.g. 1s, 1.5s)"`

// Custom labels
CustomLabels *map[string]string `mapsep:"," help:"Custom user-assigned labels"`
Expand All @@ -88,6 +90,7 @@ func (cmd *ChangeAgentExternalExporterCommand) RunCmd() (commands.Result, error)
Scheme: cmd.MetricsScheme,
MetricsPath: cmd.MetricsPath,
EnablePushMetrics: cmd.PushMetrics,
ConnectionTimeout: commands.DurationString(cmd.ConnectionTimeout),
}

if customLabels != nil {
Expand Down
9 changes: 6 additions & 3 deletions admin/commands/inventory/change_agent_mongodb_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package inventory
import (
"fmt"
"strings"
"time"

"github.com/percona/pmm/admin/commands"
"github.com/percona/pmm/admin/pkg/flags"
Expand Down Expand Up @@ -89,9 +90,10 @@ type ChangeAgentMongodbExporterCommand struct {
CollectionsLimit *int32 `help:"Collections limit"`

// Exporter options
DisableCollectors []string `help:"List of collector names to disable"`
ExposeExporter *bool `help:"Expose the exporter process on all public interfaces"`
PushMetrics *bool `help:"Enable push metrics with vmagent"`
DisableCollectors []string `help:"List of collector names to disable"`
ExposeExporter *bool `help:"Expose the exporter process on all public interfaces"`
PushMetrics *bool `help:"Enable push metrics with vmagent"`
ConnectionTimeout *time.Duration `placeholder:"DURATION" help:"Connection timeout to use for exporter (e.g. 1s, 1.5s)"`

// Custom labels
CustomLabels *map[string]string `mapsep:"," help:"Custom user-assigned labels"`
Expand Down Expand Up @@ -152,6 +154,7 @@ func (cmd *ChangeAgentMongodbExporterCommand) RunCmd() (commands.Result, error)
ExposeExporter: cmd.ExposeExporter,
EnablePushMetrics: cmd.PushMetrics,
LogLevel: convertLogLevelPtr(cmd.LogLevel),
ConnectionTimeout: commands.DurationString(cmd.ConnectionTimeout),
}

if customLabels != nil {
Expand Down
Loading
Loading