Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[receiver/mysql] update instrumentation name #8387

Merged
merged 2 commits into from
Mar 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
- `redisreceiver`: instrumentation name updated from `otelcol/redis` to `otelcol/redisreceiver` (#8255)
- `apachereceiver`: Update instrumentation library name from `otelcol/apache` to `otelcol/apachereceiver` ()
- `couchdbreceiver`: instrumentation name updated from `otelcol/couchdb` to `otelcol/couchdbreceiver` (#8366)
- `mysqlreceiver`: instrumentation name updated from `otel/mysql` to `otelcol/mysqlreceiver` (#8387)

### 🧰 Bug fixes 🧰

Expand Down
6 changes: 2 additions & 4 deletions receiver/mysqlreceiver/scraper.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,7 @@ func (m *mySQLScraper) scrape(context.Context) (pdata.Metrics, error) {
}

// metric initialization
md := pdata.NewMetrics()
ilm := md.ResourceMetrics().AppendEmpty().InstrumentationLibraryMetrics().AppendEmpty()
ilm.InstrumentationLibrary().SetName("otel/mysql")
md := m.mb.NewMetricData()
now := pdata.NewTimestampFromTime(time.Now())

// collect innodb metrics.
Expand Down Expand Up @@ -512,7 +510,7 @@ func (m *mySQLScraper) scrape(context.Context) (pdata.Metrics, error) {
}
}

m.mb.Emit(ilm.Metrics())
m.mb.Emit(md.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics())
return md, errors.Combine()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"instrumentationLibraryMetrics": [
{
"instrumentationLibrary": {
"name": "otel/mysql"
"name": "otelcol/mysqlreceiver"
},
"metrics": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"instrumentationLibraryMetrics": [
{
"instrumentationLibrary": {
"name": "otel/mysql"
"name": "otelcol/mysqlreceiver"
},
"metrics": [
{
Expand Down
2 changes: 1 addition & 1 deletion receiver/mysqlreceiver/testdata/scraper/expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"instrumentationLibraryMetrics": [
{
"instrumentationLibrary": {
"name": "otel/mysql"
"name": "otelcol/mysqlreceiver"
},
"metrics": [
{
Expand Down