Skip to content

Commit

Permalink
feat(mysqlreceiver): deprecate mysql. locked_connects in favor of `…
Browse files Browse the repository at this point in the history
…mysql.connection.errors` (open-telemetry#23274)

**Description:**

deprecate `mysql.locked_accounts` in favor of `mysql.connection.errors`

```
2023-06-12T08:29:43.306+0200    info    service/telemetry.go:104        Setting up own telemetry...
2023-06-12T08:29:43.306+0200    info    service/telemetry.go:127        Serving Prometheus metrics      {"address": ":8888", "level": "Basic"}
2023-06-12T08:29:43.306+0200    info    exporter@v0.79.0/exporter.go:275        Development component. May change in the future.        {"kind": "exporter", "data_type": "metrics", "name": "logging"}
2023-06-12T08:29:43.308+0200    info    service/service.go:131  Starting otelcontribcol...      {"Version": "0.79.0-dev", "NumCPU": 16}
2023-06-12T08:29:43.308+0200    info    extensions/extensions.go:30     Starting extensions...
2023-06-12T08:29:43.308+0200    warn    mysqlreceiver@v0.79.0/scraper.go:60     `mysql.locked_connects` is deprecated and is going to be set as optional in `v0.80.0` and removed in `v0.81.0`. Please use `mysql.connection.errors` instead   {"kind": "receiver", "name": "mysql", "data_type": "metrics"}
2023-06-12T08:29:43.308+0200    info    service/service.go:148  Everything is ready. Begin running and processing data.
^C2023-06-12T08:29:44.055+0200  info    otelcol/collector.go:227        Received signal from OS {"signal": "interrupt"}
2023-06-12T08:29:44.056+0200    info    service/service.go:157  Starting shutdown...
```

---------

Signed-off-by: Dominik Rosiek <drosiek@sumologic.com>
Co-authored-by: Daniel Jaglowski <jaglows3@gmail.com>
Co-authored-by: Curtis Robert <92119472+crobert-1@users.noreply.github.com>
  • Loading branch information
3 people committed Jun 17, 2023
1 parent c8cf780 commit 1c84fb2
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_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:
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 @@ -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
Expand Down

0 comments on commit 1c84fb2

Please sign in to comment.