Skip to content

Commit

Permalink
feat(mysqlreceiver): deprecate mysql.locked_accounts in favor of `m…
Browse files Browse the repository at this point in the history
…ysql.connection.errors`

Signed-off-by: Dominik Rosiek <[email protected]>
  • Loading branch information
Dominik Rosiek committed Jun 12, 2023
1 parent 752330e commit 74843f6
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 6 deletions.
20 changes: 20 additions & 0 deletions .chloggen/drosiek-deprecate-locked-connects.yaml
Original file line number Diff line number Diff line change
@@ -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:
2 changes: 1 addition & 1 deletion receiver/mysqlreceiver/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
| ---- | ----------- | ---------- | ----------------------- | --------- |
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion receiver/mysqlreceiver/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions receiver/mysqlreceiver/scraper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion receiver/mysqlreceiver/testdata/integration/expected.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion receiver/mysqlreceiver/testdata/scraper/expected.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 74843f6

Please sign in to comment.