From 163dea0023840e73a7e109e55ca19c28cf8c3361 Mon Sep 17 00:00:00 2001 From: Dominik Rosiek Date: Mon, 5 Dec 2022 09:17:51 +0100 Subject: [PATCH 1/4] feat(mysqlreceiver): promote featuregate to beta Signed-off-by: Dominik Rosiek --- receiver/mysqlreceiver/scraper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/receiver/mysqlreceiver/scraper.go b/receiver/mysqlreceiver/scraper.go index e0b9767aaf4b..6c2cad392398 100644 --- a/receiver/mysqlreceiver/scraper.go +++ b/receiver/mysqlreceiver/scraper.go @@ -41,7 +41,7 @@ const ( func init() { featuregate.GetRegistry().MustRegisterID( RenameCommands, - featuregate.StageAlpha, + featuregate.StageBeta, featuregate.WithRegisterDescription("When enabled, the mysql.commands will be deprecated and additionally emitted as optional mysql.prepared_statements metric"), ) } From d583a654db7cbac4d3f2c398b756b6aaa633afb7 Mon Sep 17 00:00:00 2001 From: Dominik Rosiek Date: Mon, 5 Dec 2022 09:30:46 +0100 Subject: [PATCH 2/4] fix: add deprecation notice only if commands metric is enabled Signed-off-by: Dominik Rosiek --- .chloggen/drosiek-mysql-feature-gate.yaml | 16 ++++++++++++++++ receiver/mysqlreceiver/scraper.go | 7 +++---- 2 files changed, 19 insertions(+), 4 deletions(-) create mode 100755 .chloggen/drosiek-mysql-feature-gate.yaml diff --git a/.chloggen/drosiek-mysql-feature-gate.yaml b/.chloggen/drosiek-mysql-feature-gate.yaml new file mode 100755 index 000000000000..bf1a80f9af99 --- /dev/null +++ b/.chloggen/drosiek-mysql-feature-gate.yaml @@ -0,0 +1,16 @@ +# 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: rename mysql.commands metric to mysql.prepared_statements + +# One or more tracking issues related to the change +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/scraper.go b/receiver/mysqlreceiver/scraper.go index 6c2cad392398..9b5b64896a5c 100644 --- a/receiver/mysqlreceiver/scraper.go +++ b/receiver/mysqlreceiver/scraper.go @@ -68,13 +68,12 @@ func newMySQLScraper( } if !ms.renameCommands { - settings.Logger.Warn(fmt.Sprintf("[WARNING] Metric `mysql.commands` will be deprecated and duplicated as `mysql.prepared_statements` in %s. Metric `mysql.commands` will be removed and `mysql.prepared_statements` will be a default metric in %s. Enable a feature gate `%s` to apply and test the upcoming changes earlier", deprecationVersion, renameVersion, RenameCommands)) + settings.Logger.Warn(fmt.Sprintf("[WARNING] Metric `mysql.commands` is deprecated and duplicated as `mysql.prepared_statements`. Metric `mysql.commands` will be removed and `mysql.prepared_statements` will be a default metric in %s. Disable a feature gate `%s` to keep previous behavior", renameVersion, RenameCommands)) ms.config.Metrics.MysqlPreparedStatements.Enabled = false } else { - ms.mb.DeprecateMetrics() - if ms.config.Metrics.MysqlCommands.Enabled { - settings.Logger.Warn(fmt.Sprintf("[WARNING] Metric `mysql.commands` will be deprecated in %s and removed in %s. Please use `mysql.prepared_statements` instead", deprecationVersion, renameVersion)) + ms.mb.DeprecateMetrics() + settings.Logger.Warn(fmt.Sprintf("[WARNING] Metric `mysql.commands` is deprecated and will be removed in %s. Please use `mysql.prepared_statements` instead", renameVersion)) } if !ms.config.Metrics.MysqlPreparedStatements.Enabled { From 97e003a8afa01d7f59ca6a645a65bf8591bd2eeb Mon Sep 17 00:00:00 2001 From: Dominik Rosiek <58699848+sumo-drosiek@users.noreply.github.com> Date: Mon, 5 Dec 2022 09:52:54 +0100 Subject: [PATCH 3/4] Update .chloggen/drosiek-mysql-feature-gate.yaml Co-authored-by: Pablo Baeyens --- .chloggen/drosiek-mysql-feature-gate.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.chloggen/drosiek-mysql-feature-gate.yaml b/.chloggen/drosiek-mysql-feature-gate.yaml index bf1a80f9af99..7094eb14d1a5 100755 --- a/.chloggen/drosiek-mysql-feature-gate.yaml +++ b/.chloggen/drosiek-mysql-feature-gate.yaml @@ -1,5 +1,5 @@ # One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' -change_type: deprecation +change_type: breaking # The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) component: mysqlreceiver From f361f420fbb364a477b7564e6e8ee088ffa8dbd5 Mon Sep 17 00:00:00 2001 From: Dominik Rosiek <58699848+sumo-drosiek@users.noreply.github.com> Date: Mon, 5 Dec 2022 09:53:06 +0100 Subject: [PATCH 4/4] Update .chloggen/drosiek-mysql-feature-gate.yaml Co-authored-by: Pablo Baeyens --- .chloggen/drosiek-mysql-feature-gate.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.chloggen/drosiek-mysql-feature-gate.yaml b/.chloggen/drosiek-mysql-feature-gate.yaml index 7094eb14d1a5..ace1f7fc4d9b 100755 --- a/.chloggen/drosiek-mysql-feature-gate.yaml +++ b/.chloggen/drosiek-mysql-feature-gate.yaml @@ -13,4 +13,4 @@ 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: +subtext: Disable the `receiver.mysqlreceiver.renameCommands` feature gate to temporarily revert this change.