diff --git a/component/prometheus/exporter/mysql/mysql.go b/component/prometheus/exporter/mysql/mysql.go index eb13d4a25f74..90201a450a36 100644 --- a/component/prometheus/exporter/mysql/mysql.go +++ b/component/prometheus/exporter/mysql/mysql.go @@ -44,6 +44,9 @@ var DefaultArguments = Arguments{ Filter: ".*", RemovePrefix: "/var/lib/mysql", }, + PerfSchemaMemoryEvents: PerfSchemaMemoryEvents{ + RemovePrefix: "memory/", + }, Heartbeat: Heartbeat{ Database: "heartbeat", Table: "heartbeat", @@ -72,8 +75,10 @@ type Arguments struct { InfoSchemaTables InfoSchemaTables `river:"info_schema.tables,block,optional"` PerfSchemaEventsStatements PerfSchemaEventsStatements `river:"perf_schema.eventsstatements,block,optional"` PerfSchemaFileInstances PerfSchemaFileInstances `river:"perf_schema.file_instances,block,optional"` - Heartbeat Heartbeat `river:"heartbeat,block,optional"` - MySQLUser MySQLUser `river:"mysql.user,block,optional"` + PerfSchemaMemoryEvents PerfSchemaMemoryEvents `river:"perf_schema.memory_events,block,optional"` + + Heartbeat Heartbeat `river:"heartbeat,block,optional"` + MySQLUser MySQLUser `river:"mysql.user,block,optional"` } // InfoSchemaProcessList configures the info_schema.processlist collector @@ -101,6 +106,11 @@ type PerfSchemaFileInstances struct { RemovePrefix string `river:"remove_prefix,attr,optional"` } +// PerfSchemaMemoryEvents configures the perf_schema.memory_events collector +type PerfSchemaMemoryEvents struct { + RemovePrefix string `river:"remove_prefix,attr,optional"` +} + // Heartbeat controls the heartbeat collector type Heartbeat struct { Database string `river:"database,attr,optional"` @@ -144,6 +154,7 @@ func (a *Arguments) Convert() *mysqld_exporter.Config { PerfSchemaEventsStatementsTextLimit: a.PerfSchemaEventsStatements.TextLimit, PerfSchemaFileInstancesFilter: a.PerfSchemaFileInstances.Filter, PerfSchemaFileInstancesRemovePrefix: a.PerfSchemaFileInstances.RemovePrefix, + PerfSchemaMemoryEventsRemovePrefix: a.PerfSchemaMemoryEvents.RemovePrefix, HeartbeatDatabase: a.Heartbeat.Database, HeartbeatTable: a.Heartbeat.Table, HeartbeatUTC: a.Heartbeat.UTC, diff --git a/component/prometheus/exporter/mysql/mysql_test.go b/component/prometheus/exporter/mysql/mysql_test.go index ea60f052e8a6..3bb2aed1f2e7 100644 --- a/component/prometheus/exporter/mysql/mysql_test.go +++ b/component/prometheus/exporter/mysql/mysql_test.go @@ -39,6 +39,10 @@ func TestRiverConfigUnmarshal(t *testing.T) { remove_prefix = "instances_remove" } + perf_schema.memory_events { + remove_prefix = "innodb/" + } + heartbeat { database = "heartbeat_database" table = "heartbeat_table" @@ -69,6 +73,7 @@ func TestRiverConfigUnmarshal(t *testing.T) { require.Equal(t, 5, args.PerfSchemaEventsStatements.TextLimit) require.Equal(t, "instances_filter", args.PerfSchemaFileInstances.Filter) require.Equal(t, "instances_remove", args.PerfSchemaFileInstances.RemovePrefix) + require.Equal(t, "innodb/", args.PerfSchemaMemoryEvents.RemovePrefix) require.Equal(t, "heartbeat_database", args.Heartbeat.Database) require.Equal(t, "heartbeat_table", args.Heartbeat.Table) require.True(t, args.Heartbeat.UTC) @@ -105,6 +110,10 @@ func TestRiverConfigConvert(t *testing.T) { remove_prefix = "instances_remove" } + perf_schema.memory_events { + remove_prefix = "innodb/" + } + heartbeat { database = "heartbeat_database" table = "heartbeat_table" @@ -136,6 +145,7 @@ func TestRiverConfigConvert(t *testing.T) { require.Equal(t, 5, c.PerfSchemaEventsStatementsTextLimit) require.Equal(t, "instances_filter", c.PerfSchemaFileInstancesFilter) require.Equal(t, "instances_remove", c.PerfSchemaFileInstancesRemovePrefix) + require.Equal(t, "innodb/", c.PerfSchemaMemoryEventsRemovePrefix) require.Equal(t, "heartbeat_database", c.HeartbeatDatabase) require.Equal(t, "heartbeat_table", c.HeartbeatTable) require.True(t, c.HeartbeatUTC) diff --git a/docs/sources/flow/reference/components/prometheus.exporter.mysql.md b/docs/sources/flow/reference/components/prometheus.exporter.mysql.md index 8767949577fd..a3b2569879a8 100644 --- a/docs/sources/flow/reference/components/prometheus.exporter.mysql.md +++ b/docs/sources/flow/reference/components/prometheus.exporter.mysql.md @@ -52,6 +52,7 @@ The following blocks are supported inside the definition of | info_schema.tables | [info_schema.tables][] | Configures the `info_schema.tables` collector. | no | | perf_schema.eventsstatements | [perf_schema.eventsstatements][] | Configures the `perf_schema.eventsstatements` collector. | no | | perf_schema.file_instances | [perf_schema.file_instances][] | Configures the `perf_schema.file_instances` collector. | no | +| perf_schema.memory_events | [perf_schema.memory_events][] | Configures the `perf_schema.memory_events` collector. | no | | heartbeat | [heartbeat][] | Configures the `heartbeat` collector. | no | | mysql.user | [mysql.user][] | Configures the `mysql.user` collector. | no | @@ -59,6 +60,7 @@ The following blocks are supported inside the definition of [info_schema.tables]: #info_schematables-block [perf_schema.eventsstatements]: #perf_schemaeventsstatements-block [perf_schema.file_instances]: #perf_schemafile_instances-block +[perf_schema.memory_events]: #perf_schemamemory_events-block [heartbeat]: #heartbeat-block [mysql.user]: #mysqluser-block @@ -93,6 +95,12 @@ The following blocks are supported inside the definition of View more detailed documentation on the tables used in `perf_schema_file_instances_filter` and `perf_schema_file_instances_remove_prefix` [in the MySQL documentation](https://dev.mysql.com/doc/mysql-perfschema-excerpt/8.0/en/performance-schema-file-summary-tables.html). +### perf_schema.memory_events block + +| Name | Type | Description | Default | Required | +| --------------- | -------- | ----------------------------------------------------------------------------------- | ------------------ | -------- | +| `remove_prefix` | `string` | Prefix to trim away from `performance_schema.memory_summary_global_by_event_name`. | `"memory/"` | no | + ### heartbeat block | Name | Type | Description | Default | Required | @@ -138,6 +146,7 @@ The full list of supported collectors is: | perf_schema.file_events | Collect metrics from `performance_schema.file_summary_by_event_name`. | no | | perf_schema.file_instances | Collect metrics from `performance_schema.file_summary_by_instance`. | no | | perf_schema.indexiowaits | Collect metrics from `performance_schema.table_io_waits_summary_by_index_usage`. | no | +| perf_schema.memory_events | Collect metrics from `performance_schema.memory_summary_global_by_event_name`. | no | | perf_schema.replication_applier_status_by_worker | Collect metrics from `performance_schema.replication_applier_status_by_worker`. | no | | perf_schema.replication_group_member_stats | Collect metrics from `performance_schema.replication_group_member_stats`. | no | | perf_schema.replication_group_members | Collect metrics from `performance_schema.replication_group_members`. | no | diff --git a/docs/sources/static/configuration/integrations/mysqld-exporter-config.md b/docs/sources/static/configuration/integrations/mysqld-exporter-config.md index 6a522b03142e..4b2b09078e3a 100644 --- a/docs/sources/static/configuration/integrations/mysqld-exporter-config.md +++ b/docs/sources/static/configuration/integrations/mysqld-exporter-config.md @@ -120,6 +120,8 @@ Full reference of options: [perf_schema_file_instances_filter: | default = ".*"] # Remove path prefix in performance_schema.file_summary_by_instance [perf_schema_file_instances_remove_prefix: | default = "/var/lib/mysql"] + # Remove instrument prefix in performance_schema.memory_summary_global_by_event_name + [perf_schema_memory_events_remove_prefix: | default = "memory/"] # Database from where to collect heartbeat data. [heartbeat_database: | default = "heartbeat"] # Table from where to collect heartbeat data. @@ -159,6 +161,7 @@ The full list of collectors that are supported for `mysqld_exporter` is: | perf_schema.file_events | Collect metrics from performance_schema.file_summary_by_event_name | no | | perf_schema.file_instances | Collect metrics from performance_schema.file_summary_by_instance | no | | perf_schema.indexiowaits | Collect metrics from performance_schema.table_io_waits_summary_by_index_usage | no | +| perf_schema.memory_events | Collect metrics from performance_schema.memory_summary_global_by_event_name |no | | perf_schema.replication_applier_status_by_worker | Collect metrics from performance_schema.replication_applier_status_by_worker | no | | perf_schema.replication_group_member_stats | Collect metrics from performance_schema.replication_group_member_stats | no | | perf_schema.replication_group_members | Collect metrics from performance_schema.replication_group_members | no | diff --git a/go.mod b/go.mod index ce7abbae2856..a1a267802f79 100644 --- a/go.mod +++ b/go.mod @@ -40,7 +40,7 @@ require ( github.com/go-logfmt/logfmt v0.6.0 github.com/go-logr/logr v1.2.4 github.com/go-sourcemap/sourcemap v2.1.3+incompatible - github.com/go-sql-driver/mysql v1.7.0 + github.com/go-sql-driver/mysql v1.7.1 github.com/gogo/protobuf v1.3.2 github.com/golang/protobuf v1.5.3 github.com/golang/snappy v0.0.4 @@ -145,8 +145,8 @@ require ( github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.66.0 github.com/prometheus-operator/prometheus-operator/pkg/client v0.66.0 github.com/prometheus/blackbox_exporter v0.24.1-0.20230623125439-bd22efa1c900 - github.com/prometheus/client_golang v1.16.0 - github.com/prometheus/client_model v0.4.0 + github.com/prometheus/client_golang v1.17.0 + github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 github.com/prometheus/common v0.44.0 github.com/prometheus/consul_exporter v0.8.0 github.com/prometheus/memcached_exporter v0.13.0 @@ -396,7 +396,6 @@ require ( github.com/googleapis/enterprise-certificate-proxy v0.2.5 // indirect github.com/googleapis/gax-go/v2 v2.12.0 // indirect github.com/gophercloud/gophercloud v1.5.0 // indirect - github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/gosnmp/gosnmp v1.36.0 // indirect github.com/grafana/gomemcache v0.0.0-20230316202710-a081dae0aba9 // indirect @@ -530,7 +529,7 @@ require ( github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect github.com/prometheus-community/go-runit v0.1.0 // indirect github.com/prometheus/alertmanager v0.26.0 // indirect - github.com/prometheus/common/sigv4 v0.1.0 // indirect + github.com/prometheus/common/sigv4 v0.1.0 github.com/prometheus/exporter-toolkit v0.10.1-0.20230714054209-2f4150c63f97 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/remeh/sizedwaitgroup v1.0.0 // indirect @@ -540,7 +539,6 @@ require ( github.com/safchain/ethtool v0.3.0 // indirect github.com/samber/lo v1.38.1 // indirect github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da // indirect - github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b // indirect github.com/scaleway/scaleway-sdk-go v1.0.0-beta.20 github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 // indirect github.com/seccomp/libseccomp-golang v0.9.2-0.20220502022130-f33da4d89646 // indirect @@ -705,14 +703,17 @@ replace ( // TODO(mattdurham): this is so you can debug on windows, when PR is merged into perflib, can you use that // and eventually remove if windows_exporter shifts to it. https://github.com/leoluk/perflib_exporter/pull/43 github.com/leoluk/perflib_exporter => github.com/grafana/perflib_exporter v0.1.1-0.20230511173423-6166026bd090 - github.com/prometheus-community/postgres_exporter => github.com/grafana/postgres_exporter v0.8.1-0.20210722175051-db35d7c2f520 - // TODO(mattdurham): this is to allow defaults to propogate properly. + // TODO(mattdurham): this is to allow defaults to propogate properly: https://github.com/prometheus-community/windows_exporter/pull/1227 github.com/prometheus-community/windows_exporter => github.com/grafana/windows_exporter v0.15.1-0.20230612134738-fdb3ba7accd8 - github.com/prometheus/mysqld_exporter => github.com/grafana/mysqld_exporter v0.12.2-0.20201015182516-5ac885b2d38a - // Replace node_export with custom fork for multi usage. https://github.com/prometheus/node_exporter/pull/2812 + // TODO(marctc): remove once this PR is merged upstream: https://github.com/prometheus/mysqld_exporter/pull/774 + github.com/prometheus/mysqld_exporter => github.com/grafana/mysqld_exporter v0.12.2-0.20231005125903-364b9c41e595 + + // TODO(marctc, mattdurham): Replace node_export with custom fork for multi usage. https://github.com/prometheus/node_exporter/pull/2812 github.com/prometheus/node_exporter => github.com/grafana/node_exporter v0.18.1-grafana-r01.0.20231004161416-702318429731 + + github.com/prometheus-community/postgres_exporter => github.com/grafana/postgres_exporter v0.8.1-0.20210722175051-db35d7c2f520 ) // Excluding fixes a conflict in test packages and allows "go mod tidy" to run. diff --git a/go.sum b/go.sum index 13fba5d7d3b5..7326d65f02bb 100644 --- a/go.sum +++ b/go.sum @@ -806,8 +806,8 @@ github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5Nq github.com/go-sql-driver/mysql v0.0.0-20180618115901-749ddf1598b4/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= -github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ7YPc= -github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= +github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI= +github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= @@ -1025,9 +1025,8 @@ github.com/gophercloud/gophercloud v1.5.0 h1:cDN6XFCLKiiqvYpjQLq9AiM7RDRbIC9450W github.com/gophercloud/gophercloud v1.5.0/go.mod h1:aAVqcocTSXh2vYFZ1JTvx4EQmfgzxRcNupUfxZbBNDM= github.com/gopherjs/gopherjs v0.0.0-20180825215210-0210a2f0f73c/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00 h1:l5lAOZEym3oK3SQ2HBHWsJUfbNBiTXJDeW2QDxw9AQ0= -github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gopherjs/gopherjs v1.17.2 h1:fQnZVsXk8uxXIStYb0N4bGk7jeyTalG/wsZjQ25dO0g= +github.com/gopherjs/gopherjs v1.17.2/go.mod h1:pRRIvn/QzFLrKfvEz3qUuEhtE/zLCWfreZ6J5gM2i+k= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= @@ -1061,8 +1060,8 @@ github.com/grafana/loki v1.6.2-0.20231004111112-07cbef92268a h1:lvSHlNONeo/H+aWR github.com/grafana/loki v1.6.2-0.20231004111112-07cbef92268a/go.mod h1:a5c5ZTC6FNufKkvF8NeDAb2nCWJpgkVDrejmV+O9hac= github.com/grafana/loki/pkg/push v0.0.0-20230904153656-e4cc2a4f5ec8 h1:yQK/dX7WBva5QvITvmIcbv4boLwSo65a8zjuZcucnko= github.com/grafana/loki/pkg/push v0.0.0-20230904153656-e4cc2a4f5ec8/go.mod h1:5ll3An1wAxYejo6aM04+3/lc6N4joYVYLY5U+Z4O6vI= -github.com/grafana/mysqld_exporter v0.12.2-0.20201015182516-5ac885b2d38a h1:D5NSR64/6xMXnSFD9y1m1DPYIcBcHvtfeuI9/M/0qtI= -github.com/grafana/mysqld_exporter v0.12.2-0.20201015182516-5ac885b2d38a/go.mod h1:rjb/swXiCWLlC3gWlyugy/xEOZioF5PclbB8sf/9p/Q= +github.com/grafana/mysqld_exporter v0.12.2-0.20231005125903-364b9c41e595 h1:I9sRknI5ajd8whPOX0nBDXy5B6xUfhItClMy+6R4oqE= +github.com/grafana/mysqld_exporter v0.12.2-0.20231005125903-364b9c41e595/go.mod h1:U8ifHC5pT2WuVTO7ki4KZmWLjfEKfktQiU3bh0J8scw= github.com/grafana/node_exporter v0.18.1-grafana-r01.0.20231004161416-702318429731 h1:vyyIYY2sLpmgFIckJ1vSO/oYkvB0thDF6UiFYp5PThM= github.com/grafana/node_exporter v0.18.1-grafana-r01.0.20231004161416-702318429731/go.mod h1:vOZxEzxm0nZmuNqjtIfvtmvdRtJik9POmcN5mQVLf5E= github.com/grafana/opentelemetry-collector v0.4.1-0.20230925123210-ef4435f79a8a h1:co7JnXySBilXDBu0hhw3furJZLJg9SFojos1PMO+lW4= @@ -1941,7 +1940,6 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.5.1/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= -github.com/prometheus/client_golang v1.6.0/go.mod h1:ZLOG9ck3JLRdB5MgO8f+lLTe83AXG6ro35rLTxvnIl4= github.com/prometheus/client_golang v1.6.1-0.20200604110148-03575cad4e55/go.mod h1:25h+Uz1WvXDBZYwqGX8PAb71RBkcjxEVV/R5wGnsq4I= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.9.0/go.mod h1:FqZLKOZnGdFAhOK4nqGHa7D66IdsO+O441Eve7ptJDU= @@ -1950,8 +1948,8 @@ github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqr github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ= -github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8= -github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc= +github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= +github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= github.com/prometheus/client_model v0.0.0-20171117100541-99fa1f4be8e5/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= @@ -1959,8 +1957,8 @@ github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1: github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY= -github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= +github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 h1:v7DLqVdK4VrYkVD5diGdl4sxJurKJEMnODWRJlxV9oM= +github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= github.com/prometheus/common v0.0.0-20180326160409-38c53a9f4bfc/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= @@ -2055,7 +2053,6 @@ github.com/samuel/go-zookeeper v0.0.0-20180130194729-c4fab1ac1bec/go.mod h1:gi+0 github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da h1:p3Vo3i64TCLY7gIfzeQaUJ+kppEO5WQG3cL8iE8tGHU= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= -github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b h1:gQZ0qzfKHQIybLANtM3mBXNUtOfsCFXeTsnBqCsx1KM= github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/scaleway/scaleway-sdk-go v1.0.0-beta.20 h1:a9hSJdJcd16e0HoMsnFvaHvxB3pxSD+SC7+CISp7xY0= github.com/scaleway/scaleway-sdk-go v1.0.0-beta.20/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg= @@ -2107,13 +2104,14 @@ github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/smarty/assertions v1.15.0 h1:cR//PqUBUiQRakZWqBiFFQ9wb8emQGDb0HeGdqGByCY= +github.com/smarty/assertions v1.15.0/go.mod h1:yABtdzeQs6l1brC900WlRNwj6ZR55d7B+E8C6HtKdec= github.com/smartystreets/assertions v0.0.0-20180820201707-7c9eb446e3cf/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/assertions v1.0.0 h1:UVQPSSmc3qtTi+zPPkCXvZX9VvW/xT/NsRvKfwY81a8= -github.com/smartystreets/assertions v1.0.0/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM= github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s= -github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/smartystreets/goconvey v1.8.1 h1:qGjIddxOk4grTu9JPOU31tVfq3cNdBlNa5sSznIX1xY= +github.com/smartystreets/goconvey v1.8.1/go.mod h1:+/u4qLyY6x1jReYOp7GOM2FSt8aP9CzCZL03bI28W60= github.com/snowflakedb/gosnowflake v1.6.22 h1:2crLpqmFVyV03NPAxxAtzQBMFn6wUPqOJ1uRl4ruOJ4= github.com/snowflakedb/gosnowflake v1.6.22/go.mod h1:P2fE/xiD2kQXpr48OdgnazkzPsKD6aVtnHD3WP8yD9c= github.com/softlayer/softlayer-go v0.0.0-20180806151055-260589d94c7d h1:bVQRCxQvfjNUeRqaY/uT0tFuvuFY0ulgnczuR684Xic= @@ -3116,7 +3114,6 @@ gopkg.in/gorethink/gorethink.v3 v3.0.5/go.mod h1:+3yIIHJUGMBK+wyPH+iN5TP+88ikFDf gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/ini.v1 v1.57.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/jcmturner/aescts.v1 v1.0.1/go.mod h1:nsR8qBOg+OucoIW+WMhB3GspUQXq9XorLnQb9XtvcOo= diff --git a/pkg/integrations/mysqld_exporter/mysqld-exporter.go b/pkg/integrations/mysqld_exporter/mysqld-exporter.go index adddd2d3cf02..f0de51fa51b7 100644 --- a/pkg/integrations/mysqld_exporter/mysqld-exporter.go +++ b/pkg/integrations/mysqld_exporter/mysqld-exporter.go @@ -30,6 +30,7 @@ var DefaultConfig = Config{ PerfSchemaEventsStatementsTextLimit: 120, PerfSchemaFileInstancesFilter: ".*", PerfSchemaFileInstancesRemovePrefix: "/var/lib/mysql", + PerfSchemaMemoryEventsRemovePrefix: "memory/", HeartbeatDatabase: "heartbeat", HeartbeatTable: "heartbeat", @@ -62,6 +63,7 @@ type Config struct { PerfSchemaEventsStatementsTextLimit int `yaml:"perf_schema_eventsstatements_digtext_text_limit,omitempty"` PerfSchemaFileInstancesFilter string `yaml:"perf_schema_file_instances_filter,omitempty"` PerfSchemaFileInstancesRemovePrefix string `yaml:"perf_schema_file_instances_remove_prefix,omitempty"` + PerfSchemaMemoryEventsRemovePrefix string `yaml:"perf_schema_memory_events_remove_prefix,omitempty"` HeartbeatDatabase string `yaml:"heartbeat_database,omitempty"` HeartbeatTable string `yaml:"heartbeat_table,omitempty"` HeartbeatUTC bool `yaml:"heartbeat_utc,omitempty"` @@ -120,7 +122,7 @@ func New(log log.Logger, c *Config) (integrations.Integration, error) { } scrapers := GetScrapers(c) - exporter := collector.New(context.Background(), string(dsn), collector.NewMetrics(), scrapers, log, collector.Config{ + exporter := collector.New(context.Background(), string(dsn), scrapers, log, collector.Config{ LockTimeout: c.LockWaitTimeout, SlowLogFilter: c.LogSlowFilter, }) @@ -168,6 +170,7 @@ func GetScrapers(c *Config) []collector.Scraper { &collector.ScrapeSlaveStatus{}: true, &collector.ScrapeTableStat{}: false, &collector.ScrapeUserStat{}: false, + &collector.ScrapeSysUserSummary{}: false, // Collectors that have configuration &collector.ScrapeHeartbeat{ @@ -187,6 +190,10 @@ func GetScrapers(c *Config) []collector.Scraper { RemovePrefix: c.PerfSchemaFileInstancesRemovePrefix, }: false, + &collector.ScrapePerfMemoryEvents{ + RemovePrefix: c.PerfSchemaMemoryEventsRemovePrefix, + }: false, + &collector.ScrapeProcesslist{ ProcessListMinTime: c.InfoSchemaProcessListMinTime, ProcessesByHostFlag: c.InfoSchemaProcessListProcessesByHost,