Skip to content

Commit

Permalink
[receiver/mysql] Fix attribute values mismatch with its definition (o…
Browse files Browse the repository at this point in the history
…pen-telemetry#9688)

Some attribute are emitted with values different from what's defined in metadata.yaml. This fix takes metadata.yaml definition as a source of truth and updates the emitted data
  • Loading branch information
dmitryax committed May 3, 2022
1 parent 5308e2b commit 184067c
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
### 🧰 Bug fixes 🧰

- `k8sclusterreceiver`: Fix the receiver to work with 1.19 and 1.20 k8s API versions (#9523)
- `azuremonitorexporter` : Fix log exporter bug related to incorrectly mapping SpanId (#9579)
- `azuremonitorexporter`: Fix log exporter bug related to incorrectly mapping SpanId (#9579)
- `mysqlreceiver`: Fix attribute values mismatch with its definition (#9688)

## v0.50.0

Expand Down
6 changes: 3 additions & 3 deletions receiver/mysqlreceiver/scraper.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ func (m *mySQLScraper) scrape(context.Context) (pmetric.Metrics, error) {
case "Handler_discover":
addPartialIfError(errors, m.mb.RecordMysqlHandlersDataPoint(now, v, "discover"))
case "Handler_external_lock":
addPartialIfError(errors, m.mb.RecordMysqlHandlersDataPoint(now, v, "lock"))
addPartialIfError(errors, m.mb.RecordMysqlHandlersDataPoint(now, v, "external_lock"))
case "Handler_mrr_init":
addPartialIfError(errors, m.mb.RecordMysqlHandlersDataPoint(now, v, "mrr_init"))
case "Handler_prepare":
Expand Down Expand Up @@ -185,15 +185,15 @@ func (m *mySQLScraper) scrape(context.Context) (pmetric.Metrics, error) {

// double_writes
case "Innodb_dblwr_pages_written":
addPartialIfError(errors, m.mb.RecordMysqlDoubleWritesDataPoint(now, v, "written"))
addPartialIfError(errors, m.mb.RecordMysqlDoubleWritesDataPoint(now, v, "pages_written"))
case "Innodb_dblwr_writes":
addPartialIfError(errors, m.mb.RecordMysqlDoubleWritesDataPoint(now, v, "writes"))

// log_operations
case "Innodb_log_waits":
addPartialIfError(errors, m.mb.RecordMysqlLogOperationsDataPoint(now, v, "waits"))
case "Innodb_log_write_requests":
addPartialIfError(errors, m.mb.RecordMysqlLogOperationsDataPoint(now, v, "requests"))
addPartialIfError(errors, m.mb.RecordMysqlLogOperationsDataPoint(now, v, "write_requests"))
case "Innodb_log_writes":
addPartialIfError(errors, m.mb.RecordMysqlLogOperationsDataPoint(now, v, "writes"))

Expand Down
6 changes: 3 additions & 3 deletions receiver/mysqlreceiver/testdata/integration/expected.5_7.json
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@
{
"key": "kind",
"value": {
"stringValue": "written"
"stringValue": "pages_written"
}
}
],
Expand Down Expand Up @@ -412,7 +412,7 @@
{
"key": "kind",
"value": {
"stringValue": "lock"
"stringValue": "external_lock"
}
}
],
Expand Down Expand Up @@ -694,7 +694,7 @@
{
"key": "operation",
"value": {
"stringValue": "requests"
"stringValue": "write_requests"
}
}
],
Expand Down
6 changes: 3 additions & 3 deletions receiver/mysqlreceiver/testdata/integration/expected.8_0.json
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@
{
"key": "kind",
"value": {
"stringValue": "written"
"stringValue": "pages_written"
}
}
],
Expand Down Expand Up @@ -412,7 +412,7 @@
{
"key": "kind",
"value": {
"stringValue": "lock"
"stringValue": "external_lock"
}
}
],
Expand Down Expand Up @@ -694,7 +694,7 @@
{
"key": "operation",
"value": {
"stringValue": "requests"
"stringValue": "write_requests"
}
}
],
Expand Down
6 changes: 3 additions & 3 deletions receiver/mysqlreceiver/testdata/scraper/expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@
{
"key": "kind",
"value": {
"stringValue": "written"
"stringValue": "pages_written"
}
}
],
Expand Down Expand Up @@ -412,7 +412,7 @@
{
"key": "kind",
"value": {
"stringValue": "lock"
"stringValue": "external_lock"
}
}
],
Expand Down Expand Up @@ -694,7 +694,7 @@
{
"key": "operation",
"value": {
"stringValue": "requests"
"stringValue": "write_requests"
}
}
],
Expand Down

0 comments on commit 184067c

Please sign in to comment.