diff --git a/.chloggen/drosiek-deprecate-locked-connects.yaml b/.chloggen/drosiek-deprecate-locked-connects.yaml new file mode 100755 index 000000000000..f81dfb41b684 --- /dev/null +++ b/.chloggen/drosiek-deprecate-locked-connects.yaml @@ -0,0 +1,20 @@ +# Use this changelog template to create an entry for release notes. +# If your change doesn't affect end users, such as a test fix or a tooling change, +# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: deprecation + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: mysqlreceiver + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: "deprecate `mysql.locked_connects` in favor of `mysql.connection.errors`" + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [14138] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: diff --git a/receiver/mysqlreceiver/documentation.md b/receiver/mysqlreceiver/documentation.md index 9e697a71505f..d2e64825b71d 100644 --- a/receiver/mysqlreceiver/documentation.md +++ b/receiver/mysqlreceiver/documentation.md @@ -148,7 +148,7 @@ The total time of I/O wait events for an index. ### mysql.locked_connects -The number of attempts to connect to locked user accounts. +[DEPRECATED] The number of attempts to connect to locked user accounts. | Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic | | ---- | ----------- | ---------- | ----------------------- | --------- | diff --git a/receiver/mysqlreceiver/internal/metadata/generated_metrics.go b/receiver/mysqlreceiver/internal/metadata/generated_metrics.go index b9ee44b34e8e..75f55555ac68 100644 --- a/receiver/mysqlreceiver/internal/metadata/generated_metrics.go +++ b/receiver/mysqlreceiver/internal/metadata/generated_metrics.go @@ -1787,7 +1787,7 @@ type metricMysqlLockedConnects struct { // init fills mysql.locked_connects metric with initial data. func (m *metricMysqlLockedConnects) init() { m.data.SetName("mysql.locked_connects") - m.data.SetDescription("The number of attempts to connect to locked user accounts.") + m.data.SetDescription("[DEPRECATED] The number of attempts to connect to locked user accounts.") m.data.SetUnit("1") m.data.SetEmptySum() m.data.Sum().SetIsMonotonic(true) diff --git a/receiver/mysqlreceiver/internal/metadata/generated_metrics_test.go b/receiver/mysqlreceiver/internal/metadata/generated_metrics_test.go index ce25f039d464..99e601824312 100644 --- a/receiver/mysqlreceiver/internal/metadata/generated_metrics_test.go +++ b/receiver/mysqlreceiver/internal/metadata/generated_metrics_test.go @@ -513,7 +513,7 @@ func TestMetricsBuilder(t *testing.T) { validatedMetrics["mysql.locked_connects"] = true assert.Equal(t, pmetric.MetricTypeSum, ms.At(i).Type()) assert.Equal(t, 1, ms.At(i).Sum().DataPoints().Len()) - assert.Equal(t, "The number of attempts to connect to locked user accounts.", ms.At(i).Description()) + assert.Equal(t, "[DEPRECATED] The number of attempts to connect to locked user accounts.", ms.At(i).Description()) assert.Equal(t, "1", ms.At(i).Unit()) assert.Equal(t, true, ms.At(i).Sum().IsMonotonic()) assert.Equal(t, pmetric.AggregationTemporalityCumulative, ms.At(i).Sum().AggregationTemporality()) diff --git a/receiver/mysqlreceiver/metadata.yaml b/receiver/mysqlreceiver/metadata.yaml index a4527e1a1b33..5183a97e7c7e 100644 --- a/receiver/mysqlreceiver/metadata.yaml +++ b/receiver/mysqlreceiver/metadata.yaml @@ -445,7 +445,7 @@ metrics: attributes: [schema, table_name, write_lock_type] mysql.locked_connects: enabled: true - description: The number of attempts to connect to locked user accounts. + description: "[DEPRECATED] The number of attempts to connect to locked user accounts." unit: 1 sum: value_type: int diff --git a/receiver/mysqlreceiver/scraper.go b/receiver/mysqlreceiver/scraper.go index 7b2000c363f4..1129ae45f901 100644 --- a/receiver/mysqlreceiver/scraper.go +++ b/receiver/mysqlreceiver/scraper.go @@ -56,6 +56,10 @@ func (m *mySQLScraper) start(_ context.Context, _ component.Host) error { } m.sqlclient = sqlclient + if m.config.MetricsBuilderConfig.Metrics.MysqlLockedConnects.Enabled { + m.logger.Warn("`mysql.locked_connects` is deprecated and is going to be set as optional in `v0.81.0` and removed in `v0.82.0`. Please use `mysql.connection.errors` instead") + } + return nil } diff --git a/receiver/mysqlreceiver/testdata/integration/expected.yaml b/receiver/mysqlreceiver/testdata/integration/expected.yaml index d272068d1adb..e840784d6eed 100644 --- a/receiver/mysqlreceiver/testdata/integration/expected.yaml +++ b/receiver/mysqlreceiver/testdata/integration/expected.yaml @@ -302,7 +302,7 @@ resourceMetrics: timeUnixNano: "1674545265375344000" isMonotonic: true unit: "1" - - description: The number of attempts to connect to locked user accounts. + - description: "[DEPRECATED] The number of attempts to connect to locked user accounts." name: mysql.locked_connects sum: aggregationTemporality: 2 diff --git a/receiver/mysqlreceiver/testdata/scraper/expected.yaml b/receiver/mysqlreceiver/testdata/scraper/expected.yaml index 6690f17c8ada..62305e096da6 100644 --- a/receiver/mysqlreceiver/testdata/scraper/expected.yaml +++ b/receiver/mysqlreceiver/testdata/scraper/expected.yaml @@ -622,7 +622,7 @@ resourceMetrics: timeUnixNano: "1644862687825772000" isMonotonic: true unit: "1" - - description: The number of attempts to connect to locked user accounts. + - description: "[DEPRECATED] The number of attempts to connect to locked user accounts." name: mysql.locked_connects sum: aggregationTemporality: 2