diff --git a/.chloggen/drosiek-deprecate-locked-connects.yaml b/.chloggen/drosiek-deprecate-locked-connects.yaml new file mode 100755 index 0000000000000..1675a02d8e24d --- /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_accounts` 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 81194a7c30ecb..98b26febec789 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 5974c03026ead..209276ca8fee8 100644 --- a/receiver/mysqlreceiver/internal/metadata/generated_metrics.go +++ b/receiver/mysqlreceiver/internal/metadata/generated_metrics.go @@ -1775,7 +1775,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 ce25f039d4648..99e6018243123 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 dbf66f19aa308..6546027a65fa1 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 d9318964a3d7e..8bd9b2a0fa4a8 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 d272068d1adb1..e840784d6eed0 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 05c8539c840ae..b6e2160433adf 100644 --- a/receiver/mysqlreceiver/testdata/scraper/expected.yaml +++ b/receiver/mysqlreceiver/testdata/scraper/expected.yaml @@ -601,7 +601,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