diff --git a/receiver/mysqlreceiver/documentation.md b/receiver/mysqlreceiver/documentation.md index 9a27b090f9d0..c9785ecc5e3e 100644 --- a/receiver/mysqlreceiver/documentation.md +++ b/receiver/mysqlreceiver/documentation.md @@ -98,6 +98,14 @@ The number of times each type of command has been executed. | ---- | ----------- | ------ | | command | The command types. | Str: ``delete``, ``insert``, ``select``, ``update`` | +### mysql.connection.count + +The number of connection attempts (successful or not) to the MySQL server. + +| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic | +| ---- | ----------- | ---------- | ----------------------- | --------- | +| 1 | Sum | Int | Cumulative | true | + ### mysql.double_writes The number of writes to the InnoDB doublewrite buffer. @@ -529,14 +537,6 @@ The number of transmitted bytes between server and clients. | ---- | ----------- | ------ | | kind | The name of the transmission direction. | Str: ``received``, ``sent`` | -### mysql.connection.count - -The number of connection attempts (successful or not) to the MySQL server. - -| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic | -| ---- | ----------- | ---------- | ----------------------- | --------- | -| 1 | Sum | Int | Cumulative | true | - ### mysql.connection.errors Errors that occur during the client connection process. diff --git a/receiver/mysqlreceiver/internal/metadata/generated_config.go b/receiver/mysqlreceiver/internal/metadata/generated_config.go index bd67b4d01bd9..1bd198ae10db 100644 --- a/receiver/mysqlreceiver/internal/metadata/generated_config.go +++ b/receiver/mysqlreceiver/internal/metadata/generated_config.go @@ -111,7 +111,7 @@ func DefaultMetricsConfig() MetricsConfig { Enabled: true, }, MysqlConnectionCount: MetricConfig{ - Enabled: false, + Enabled: true, }, MysqlConnectionErrors: MetricConfig{ Enabled: false, diff --git a/receiver/mysqlreceiver/internal/metadata/generated_metrics_test.go b/receiver/mysqlreceiver/internal/metadata/generated_metrics_test.go index 69cbbd38c244..38488180fb65 100644 --- a/receiver/mysqlreceiver/internal/metadata/generated_metrics_test.go +++ b/receiver/mysqlreceiver/internal/metadata/generated_metrics_test.go @@ -99,6 +99,7 @@ func TestMetricsBuilder(t *testing.T) { allMetricsCount++ mb.RecordMysqlCommandsDataPoint(ts, "1", AttributeCommandDelete) + defaultMetricsCount++ allMetricsCount++ mb.RecordMysqlConnectionCountDataPoint(ts, "1") diff --git a/receiver/mysqlreceiver/metadata.yaml b/receiver/mysqlreceiver/metadata.yaml index 8bd1d21c2cd4..1c20cf2bfd11 100644 --- a/receiver/mysqlreceiver/metadata.yaml +++ b/receiver/mysqlreceiver/metadata.yaml @@ -487,7 +487,7 @@ metrics: aggregation_temporality: cumulative attributes: [schema, table_name, write_lock_type] mysql.connection.count: - enabled: false + enabled: true description: The number of connection attempts (successful or not) to the MySQL server. unit: 1 sum: