Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PMM-9968 pmm-admin inventory add agent * --log-level #903

Merged
merged 22 commits into from
Jul 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
761da14
PMM-9968 pmm-admin inventory add agent * (11 requests)
YaroslavPodorvanov May 25, 2022
eda29ca
PMM-9968 make gen
YaroslavPodorvanov May 25, 2022
6651a03
Merge branch 'main' into PMM-9968-pmm-admin-inventory-with-log-level
YaroslavPodorvanov May 30, 2022
4c3c384
Merge branch 'main' into PMM-9968-pmm-admin-inventory-with-log-level
YaroslavPodorvanov Jun 1, 2022
a0b6898
PMM-9968 AddNodeExporter with log-level
YaroslavPodorvanov Jun 1, 2022
467920c
PMM-9968 make gen
YaroslavPodorvanov Jun 1, 2022
14846f3
PMM-9968 make gen
YaroslavPodorvanov Jun 1, 2022
2c5f907
PMM-9968 pmm-admin inventory add agent * with --log-level
YaroslavPodorvanov Jun 1, 2022
b35efe0
PMM-9968 pmm-admin inventory add agent node-exporter with --log-level…
YaroslavPodorvanov Jun 1, 2022
0a9a042
PMM-9968 inventory agent node_exporter with log_level in Grafana view
YaroslavPodorvanov Jun 1, 2022
87439cc
PMM-9968 make gen
YaroslavPodorvanov Jun 1, 2022
a0ca725
PMM-9968 inventory agents with log_level in Grafana view
YaroslavPodorvanov Jun 1, 2022
42d6597
PMM-9968 make gen
YaroslavPodorvanov Jun 1, 2022
399bb01
PMM-9968 make gen with "FILES = $(shell find . -type f -name '*.go' -…
YaroslavPodorvanov Jun 2, 2022
9b0a3e4
Merge branch 'main' into PMM-9968-pmm-admin-inventory-with-log-level
YaroslavPodorvanov Jun 6, 2022
ff316c1
PMM-9968 revert Makefile before fix conflict
YaroslavPodorvanov Jun 23, 2022
af9e514
Merge branch 'main' into PMM-9968-pmm-admin-inventory-with-log-level
YaroslavPodorvanov Jun 23, 2022
0ed4044
PMM-9968 copy-paste https://github.com/percona/pmm-managed/pull/1134
YaroslavPodorvanov Jun 23, 2022
41f5e65
Merge branch 'PMM-9968-pmm-admin-inventory-with-log-level-move-pmm-ma…
YaroslavPodorvanov Jun 23, 2022
c91edd1
Merge branch 'main' into PMM-9968-pmm-admin-inventory-with-log-level
YaroslavPodorvanov Jun 23, 2022
280ead4
Merge branch 'main' into PMM-9968-pmm-admin-inventory-with-log-level
YaroslavPodorvanov Jun 28, 2022
39ff7b4
Merge branch 'main' into PMM-9968-pmm-admin-inventory-with-log-level
YaroslavPodorvanov Jul 20, 2022
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
9 changes: 9 additions & 0 deletions admin/commands/inventory/add_agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,16 @@

package inventory

import "gopkg.in/alecthomas/kingpin.v2"

// register command
var (
addAgentC = inventoryAddC.Command("agent", "Add agent to inventory").Hide(hide)

addExporterLogLevel string
)

func addExporterGlobalFlags(cmd *kingpin.CmdClause) {
// Add command global flags
cmd.Flag("log-level", "Service logging level").Default("warn").EnumVar(&addExporterLogLevel, "debug", "info", "warn", "error", "fatal")
}
2 changes: 2 additions & 0 deletions admin/commands/inventory/add_agent_mongodb_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ func (cmd *addAgentMongodbExporterCommand) Run() (commands.Result, error) {
DisableCollectors: commands.ParseDisableCollectors(cmd.DisableCollectors),
StatsCollections: commands.ParseDisableCollectors(cmd.StatsCollections),
CollectionsLimit: cmd.CollectionsLimit,
LogLevel: &addExporterLogLevel,
},
Context: commands.Ctx,
}
Expand Down Expand Up @@ -142,4 +143,5 @@ func init() {
AddAgentMongodbExporterC.Flag("stats-collections", "Collections for collstats & indexstats").StringVar(&AddAgentMongodbExporter.StatsCollections)
AddAgentMongodbExporterC.Flag("max-collections-limit", "Disable collstats & indexstats if there are more than <n> collections").
Int32Var(&AddAgentMongodbExporter.CollectionsLimit)
addExporterGlobalFlags(AddAgentMongodbExporterC)
}
2 changes: 2 additions & 0 deletions admin/commands/inventory/add_agent_mysqld_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ func (cmd *addAgentMysqldExporterCommand) Run() (commands.Result, error) {
TablestatsGroupTableLimit: cmd.TablestatsGroupTableLimit,
PushMetrics: cmd.PushMetrics,
DisableCollectors: commands.ParseDisableCollectors(cmd.DisableCollectors),
LogLevel: &addExporterLogLevel,
},
Context: commands.Ctx,
}
Expand Down Expand Up @@ -177,4 +178,5 @@ func init() {
" it will be sent to the server by an agent").BoolVar(&AddAgentMysqldExporter.PushMetrics)
AddAgentMysqldExporterC.Flag("disable-collectors",
"Comma-separated list of collector names to exclude from exporter").StringVar(&AddAgentMysqldExporter.DisableCollectors)
addExporterGlobalFlags(AddAgentMysqldExporterC)
}
2 changes: 2 additions & 0 deletions admin/commands/inventory/add_agent_node_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ func (cmd *addAgentNodeExporterCommand) Run() (commands.Result, error) {
CustomLabels: customLabels,
PushMetrics: cmd.PushMetrics,
DisableCollectors: commands.ParseDisableCollectors(cmd.DisableCollectors),
LogLevel: &addExporterLogLevel,
},
Context: commands.Ctx,
}
Expand All @@ -85,4 +86,5 @@ func init() {
" it will be sent to the server by an agent").BoolVar(&AddAgentNodeExporter.PushMetrics)
AddAgentNodeExporterC.Flag("disable-collectors",
"Comma-separated list of collector names to exclude from exporter").StringVar(&AddAgentNodeExporter.DisableCollectors)
addExporterGlobalFlags(AddAgentNodeExporterC)
}
2 changes: 2 additions & 0 deletions admin/commands/inventory/add_agent_postgres_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ func (cmd *addAgentPostgresExporterCommand) Run() (commands.Result, error) {
TLSCa: tlsCa,
TLSCert: tlsCert,
TLSKey: tlsKey,
LogLevel: &addExporterLogLevel,
},
Context: commands.Ctx,
}
Expand Down Expand Up @@ -141,4 +142,5 @@ func init() {
AddAgentPostgresExporterC.Flag("tls-ca-file", "TLS CA certificate file").StringVar(&AddAgentPostgresExporter.TLSCAFile)
AddAgentPostgresExporterC.Flag("tls-cert-file", "TLS certificate file").StringVar(&AddAgentPostgresExporter.TLSCertFile)
AddAgentPostgresExporterC.Flag("tls-key-file", "TLS certificate key file").StringVar(&AddAgentPostgresExporter.TLSKeyFile)
addExporterGlobalFlags(AddAgentPostgresExporterC)
}
2 changes: 2 additions & 0 deletions admin/commands/inventory/add_agent_proxysql_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ func (cmd *addAgentProxysqlExporterCommand) Run() (commands.Result, error) {
TLSSkipVerify: cmd.TLSSkipVerify,
PushMetrics: cmd.PushMetrics,
DisableCollectors: commands.ParseDisableCollectors(cmd.DisableCollectors),
LogLevel: &addExporterLogLevel,
},
Context: commands.Ctx,
}
Expand Down Expand Up @@ -110,4 +111,5 @@ func init() {
" it will be sent to the server by an agent").BoolVar(&AddAgentProxysqlExporter.PushMetrics)
AddAgentProxysqlExporterC.Flag("disable-collectors",
"Comma-separated list of collector names to exclude from exporter").StringVar(&AddAgentProxysqlExporter.DisableCollectors)
addExporterGlobalFlags(AddAgentProxysqlExporterC)
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ func (cmd *addAgentQANMongoDBProfilerAgentCommand) Run() (commands.Result, error
TLSCertificateKeyFilePassword: cmd.TLSCertificateKeyFilePassword,
TLSCa: tlsCa,
AuthenticationMechanism: cmd.AuthenticationMechanism,
LogLevel: &addExporterLogLevel,
},
Context: commands.Ctx,
}
Expand Down Expand Up @@ -121,4 +122,5 @@ func init() {
AddAgentQANMongoDBProfilerAgentC.Flag("tls-ca-file", "Path to certificate authority file").StringVar(&AddAgentQANMongoDBProfilerAgent.TLSCaFile)
AddAgentQANMongoDBProfilerAgentC.Flag("authentication-mechanism", "Authentication mechanism. Default is empty. Use MONGODB-X509 for ssl certificates").
StringVar(&AddAgentQANMongoDBProfilerAgent.AuthenticationMechanism)
addExporterGlobalFlags(AddAgentQANMongoDBProfilerAgentC)
}
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ func (cmd *addAgentQANMySQLPerfSchemaAgentCommand) Run() (commands.Result, error
TLSCa: tlsCa,
TLSCert: tlsCert,
TLSKey: tlsKey,
LogLevel: &addExporterLogLevel,
},
Context: commands.Ctx,
}
Expand Down Expand Up @@ -137,4 +138,5 @@ func init() {
AddAgentQANMySQLPerfSchemaAgentC.Flag("tls-ca", "Path to certificate authority certificate file").StringVar(&AddAgentQANMySQLPerfSchemaAgent.TLSCaFile)
AddAgentQANMySQLPerfSchemaAgentC.Flag("tls-cert", "Path to client certificate file").StringVar(&AddAgentQANMySQLPerfSchemaAgent.TLSCertFile)
AddAgentQANMySQLPerfSchemaAgentC.Flag("tls-key", "Path to client key file").StringVar(&AddAgentQANMySQLPerfSchemaAgent.TLSKeyFile)
addExporterGlobalFlags(AddAgentQANMySQLPerfSchemaAgentC)
}
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ func (cmd *addAgentQANMySQLSlowlogAgentCommand) Run() (commands.Result, error) {
TLSCa: tlsCa,
TLSCert: tlsCert,
TLSKey: tlsKey,
LogLevel: &addExporterLogLevel,
},
Context: commands.Ctx,
}
Expand Down Expand Up @@ -151,4 +152,5 @@ func init() {
AddAgentQANMySQLSlowlogAgentC.Flag("tls-ca", "Path to certificate authority certificate file").StringVar(&AddAgentQANMySQLSlowlogAgent.TLSCaFile)
AddAgentQANMySQLSlowlogAgentC.Flag("tls-cert", "Path to client certificate file").StringVar(&AddAgentQANMySQLSlowlogAgent.TLSCertFile)
AddAgentQANMySQLSlowlogAgentC.Flag("tls-key", "Path to client key file").StringVar(&AddAgentQANMySQLSlowlogAgent.TLSKeyFile)
addExporterGlobalFlags(AddAgentQANMySQLSlowlogAgentC)
}
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ func (cmd *addAgentQANPostgreSQLPgStatementsAgentCommand) Run() (commands.Result
TLSCa: tlsCa,
TLSCert: tlsCert,
TLSKey: tlsKey,
LogLevel: &addExporterLogLevel,
},
Context: commands.Ctx,
}
Expand Down Expand Up @@ -129,4 +130,5 @@ func init() {
AddAgentQANPostgreSQLPgStatementsAgentC.Flag("tls-ca-file", "TLS CA certificate file").StringVar(&AddAgentQANPostgreSQLPgStatementsAgent.TLSCAFile)
AddAgentQANPostgreSQLPgStatementsAgentC.Flag("tls-cert-file", "TLS certificate file").StringVar(&AddAgentQANPostgreSQLPgStatementsAgent.TLSCertFile)
AddAgentQANPostgreSQLPgStatementsAgentC.Flag("tls-key-file", "TLS certificate key file").StringVar(&AddAgentQANPostgreSQLPgStatementsAgent.TLSKeyFile)
addExporterGlobalFlags(AddAgentQANPostgreSQLPgStatementsAgentC)
}
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ func (cmd *addAgentQANPostgreSQLPgStatMonitorAgentCommand) Run() (commands.Resul
TLSCa: tlsCa,
TLSCert: tlsCert,
TLSKey: tlsKey,
LogLevel: &addExporterLogLevel,
},
Context: commands.Ctx,
}
Expand Down Expand Up @@ -133,4 +134,5 @@ func init() {
AddAgentQANPostgreSQLPgStatMonitorAgentC.Flag("tls-ca-file", "TLS CA certificate file").StringVar(&AddAgentQANPostgreSQLPgStatMonitorAgent.TLSCAFile)
AddAgentQANPostgreSQLPgStatMonitorAgentC.Flag("tls-cert-file", "TLS certificate file").StringVar(&AddAgentQANPostgreSQLPgStatMonitorAgent.TLSCertFile)
AddAgentQANPostgreSQLPgStatMonitorAgentC.Flag("tls-key-file", "TLS certificate key file").StringVar(&AddAgentQANPostgreSQLPgStatMonitorAgent.TLSKeyFile)
addExporterGlobalFlags(AddAgentQANPostgreSQLPgStatMonitorAgentC)
}
2 changes: 2 additions & 0 deletions admin/commands/inventory/add_agent_rds_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ func (cmd *addAgentRDSExporterCommand) Run() (commands.Result, error) {
DisableBasicMetrics: cmd.DisableBasicMetrics,
DisableEnhancedMetrics: cmd.DisableEnhancedMetrics,
PushMetrics: cmd.PushMetrics,
LogLevel: &addExporterLogLevel,
},
Context: commands.Ctx,
}
Expand Down Expand Up @@ -103,4 +104,5 @@ func init() {
AddAgentRDSExporterC.Flag("disable-enhanced-metrics", "Disable enhanced metrics").BoolVar(&AddAgentRDSExporter.DisableEnhancedMetrics)
AddAgentRDSExporterC.Flag("push-metrics", "Enables push metrics model flow,"+
" it will be sent to the server by an agent").BoolVar(&AddAgentRDSExporter.PushMetrics)
addExporterGlobalFlags(AddAgentRDSExporterC)
}
Loading