Skip to content

Commit

Permalink
feat(mysqlreceiver)!: removing mysql.locked_connects metric which i…
Browse files Browse the repository at this point in the history
…s replaced by `mysql.connection.errors` (#23990)

Removing `mysql.locked_connects` metric according to the plan and log
message

**Link to tracking Issue:** #23211

Signed-off-by: Dominik Rosiek <[email protected]>
  • Loading branch information
sumo-drosiek authored Jul 6, 2023
1 parent e4c3003 commit e5cd1ca
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 125 deletions.
20 changes: 20 additions & 0 deletions .chloggen/drosiek-mysql-remove.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: breaking

# 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: "removing `mysql.locked_connects` metric which is replaced by `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: [23211]

# (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:
8 changes: 0 additions & 8 deletions receiver/mysqlreceiver/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -430,14 +430,6 @@ The number of joins that perform table scans.
| ---- | ----------- | ------ |
| kind | The kind of join. | Str: ``full``, ``full_range``, ``range``, ``range_check``, ``scan`` |
### mysql.locked_connects
[DEPRECATED] The number of attempts to connect to locked user accounts.
| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic |
| ---- | ----------- | ---------- | ----------------------- | --------- |
| 1 | Sum | Int | Cumulative | true |
### mysql.mysqlx_worker_threads
The number of worker threads available.
Expand Down
4 changes: 0 additions & 4 deletions receiver/mysqlreceiver/internal/metadata/generated_config.go

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.

64 changes: 0 additions & 64 deletions receiver/mysqlreceiver/internal/metadata/generated_metrics.go

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

17 changes: 0 additions & 17 deletions receiver/mysqlreceiver/internal/metadata/generated_metrics_test.go

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

4 changes: 0 additions & 4 deletions receiver/mysqlreceiver/internal/metadata/testdata/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ all_set:
enabled: true
mysql.joins:
enabled: true
mysql.locked_connects:
enabled: true
mysql.locks:
enabled: true
mysql.log_operations:
Expand Down Expand Up @@ -124,8 +122,6 @@ none_set:
enabled: false
mysql.joins:
enabled: false
mysql.locked_connects:
enabled: false
mysql.locks:
enabled: false
mysql.log_operations:
Expand Down
9 changes: 0 additions & 9 deletions receiver/mysqlreceiver/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -443,15 +443,6 @@ metrics:
monotonic: false
aggregation: cumulative
attributes: [schema, table_name, write_lock_type]
mysql.locked_connects:
enabled: false
description: "[DEPRECATED] The number of attempts to connect to locked user accounts."
unit: 1
sum:
value_type: int
input_type: string
monotonic: true
aggregation: cumulative
mysql.connection.count:
enabled: false
description: The number of connection attempts (successful or not) to the MySQL server.
Expand Down
5 changes: 0 additions & 5 deletions receiver/mysqlreceiver/scraper.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ 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 and removed in `v0.82.0`. Please use `mysql.connection.errors` instead")
}

return nil
}

Expand Down Expand Up @@ -196,7 +192,6 @@ func (m *mySQLScraper) scrapeGlobalStats(now pcommon.Timestamp, errs *scrapererr
addPartialIfError(errs, m.mb.RecordMysqlConnectionErrorsDataPoint(now, v,
metadata.AttributeConnectionErrorAborted))
case "Locked_connects":
addPartialIfError(errs, m.mb.RecordMysqlLockedConnectsDataPoint(now, v))
addPartialIfError(errs, m.mb.RecordMysqlConnectionErrorsDataPoint(now, v,
metadata.AttributeConnectionErrorLocked))

Expand Down
2 changes: 0 additions & 2 deletions receiver/mysqlreceiver/scraper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ func TestScrape(t *testing.T) {

cfg.MetricsBuilderConfig.Metrics.MysqlConnectionCount.Enabled = true

cfg.MetricsBuilderConfig.Metrics.MysqlLockedConnects.Enabled = true

scraper := newMySQLScraper(receivertest.NewNopCreateSettings(), cfg)
scraper.sqlclient = &mockClient{
globalStatsFile: "global_stats",
Expand Down
10 changes: 0 additions & 10 deletions receiver/mysqlreceiver/testdata/scraper/expected.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -622,16 +622,6 @@ resourceMetrics:
timeUnixNano: "1644862687825772000"
isMonotonic: true
unit: "1"
- description: "[DEPRECATED] The number of attempts to connect to locked user accounts."
name: mysql.locked_connects
sum:
aggregationTemporality: 2
dataPoints:
- asInt: "293"
startTimeUnixNano: "1644862687825728000"
timeUnixNano: "1644862687825772000"
isMonotonic: true
unit: "1"
- description: The number of MySQL locks.
name: mysql.locks
sum:
Expand Down

0 comments on commit e5cd1ca

Please sign in to comment.