Skip to content

Commit 1aa68d5

Browse files
[receiver/mysql] Collect 'fsync' log operations (open-telemetry#41175)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description Collect `fsync` log operations. Tracking `fsync` operations is important for understanding performance of the redo logs.
1 parent 8100e88 commit 1aa68d5

File tree

8 files changed

+57
-3
lines changed

8 files changed

+57
-3
lines changed

.chloggen/mysql-fsync-ops.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: enhancement
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
7+
component: mysqlreceiver
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Collect 'fsync' log operations.
11+
12+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13+
issues: [41175]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext:
19+
20+
# If your change doesn't affect end users or the exported elements of any package,
21+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
22+
# Optional: The change log or logs in which this entry should be included.
23+
# e.g. '[user]' or '[user, api]'
24+
# Include 'user' if the change is relevant to end users.
25+
# Include 'api' if there is a change to a library API.
26+
# Default: '[user]'
27+
change_logs: []

receiver/mysqlreceiver/documentation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ The number of InnoDB log operations.
172172
173173
| Name | Description | Values | Optional |
174174
| ---- | ----------- | ------ | -------- |
175-
| operation | The log operation types. | Str: ``waits``, ``write_requests``, ``writes`` | false |
175+
| operation | The log operation types. 'fsyncs' aren't available in MariaDB 10.8 or later. | Str: ``waits``, ``write_requests``, ``writes``, ``fsyncs`` | false |
176176
177177
### mysql.mysqlx_connections
178178

receiver/mysqlreceiver/internal/metadata/generated_metrics.go

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

receiver/mysqlreceiver/metadata.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ attributes:
5858
enum: [pages_written, writes]
5959
log_operations:
6060
name_override: operation
61-
description: The log operation types.
61+
description: The log operation types. 'fsyncs' aren't available in MariaDB 10.8 or later.
6262
type: string
63-
enum: [waits, write_requests, writes]
63+
enum: [waits, write_requests, writes, fsyncs]
6464
operations:
6565
name_override: operation
6666
description: The operation types.

receiver/mysqlreceiver/scraper.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,8 @@ func (m *mySQLScraper) scrapeGlobalStats(now pcommon.Timestamp, errs *scrapererr
301301
addPartialIfError(errs, m.mb.RecordMysqlLogOperationsDataPoint(now, v, metadata.AttributeLogOperationsWriteRequests))
302302
case "Innodb_log_writes":
303303
addPartialIfError(errs, m.mb.RecordMysqlLogOperationsDataPoint(now, v, metadata.AttributeLogOperationsWrites))
304+
case "Innodb_os_log_fsyncs":
305+
addPartialIfError(errs, m.mb.RecordMysqlLogOperationsDataPoint(now, v, metadata.AttributeLogOperationsFsyncs))
304306

305307
// operations
306308
case "Innodb_data_fsyncs":

receiver/mysqlreceiver/testdata/integration/expected-mysql.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,13 @@ resourceMetrics:
349349
stringValue: writes
350350
startTimeUnixNano: "1674545255370693000"
351351
timeUnixNano: "1674545265375344000"
352+
- asInt: "78"
353+
attributes:
354+
- key: operation
355+
value:
356+
stringValue: fsyncs
357+
startTimeUnixNano: "1674545255370693000"
358+
timeUnixNano: "1674545265375344000"
352359
isMonotonic: true
353360
unit: "1"
354361
- description: The number of mysqlx connections.

receiver/mysqlreceiver/testdata/scraper/expected.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,13 @@ resourceMetrics:
683683
stringValue: writes
684684
startTimeUnixNano: "1000000"
685685
timeUnixNano: "2000000"
686+
- asInt: "256"
687+
attributes:
688+
- key: operation
689+
value:
690+
stringValue: fsyncs
691+
startTimeUnixNano: "1000000"
692+
timeUnixNano: "2000000"
686693
isMonotonic: true
687694
unit: "1"
688695
- description: The number of mysqlx connections.

receiver/mysqlreceiver/testdata/scraper/expected_oob.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,13 @@ resourceMetrics:
333333
stringValue: writes
334334
startTimeUnixNano: "1000000"
335335
timeUnixNano: "2000000"
336+
- asInt: "256"
337+
attributes:
338+
- key: operation
339+
value:
340+
stringValue: fsyncs
341+
startTimeUnixNano: "1000000"
342+
timeUnixNano: "2000000"
336343
isMonotonic: true
337344
unit: "1"
338345
- description: The number of mysqlx connections.

0 commit comments

Comments
 (0)