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

[exporter/elasticsearchexporter] Remove usage of deprecated LogRecord.Name field. #7829

Merged
merged 4 commits into from
Feb 15, 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 @@ -13,6 +13,7 @@
- `coralogixexporter`: Update readme (#7785)
- `awscloudwatchlogsexporter`: Remove name from aws cloudwatch logs exporter (#7554)
- `hostreceiver/memoryscraper`: Add memory.utilization (#6221)
- `elasticsearchexporter`: Remove usage of deprecated LogRecord.Name field (#7829).

### 🛑 Breaking changes 🛑

Expand Down
2 changes: 1 addition & 1 deletion exporter/azuremonitorexporter/logexporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func (exporter *logExporter) onLogData(context context.Context, logData pdata.Lo
for i := 0; i < resourceLogs.Len(); i++ {
instrumentationLibraryLogs := resourceLogs.At(i).InstrumentationLibraryLogs()
for j := 0; j < instrumentationLibraryLogs.Len(); j++ {
logs := instrumentationLibraryLogs.At(j).Logs()
logs := instrumentationLibraryLogs.At(j).LogRecords()
for k := 0; k < logs.Len(); k++ {
envelope := logPacker.LogRecordToEnvelope(logs.At(k))
envelope.IKey = exporter.config.InstrumentationKey
Expand Down
2 changes: 1 addition & 1 deletion exporter/azuremonitorexporter/logexporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func getTestLogRecord(tb testing.TB) pdata.LogRecord {
logs := getTestLogs(tb)
resourceLogs := logs.ResourceLogs()
instrumentationLibraryLogs := resourceLogs.At(0).InstrumentationLibraryLogs()
logRecords := instrumentationLibraryLogs.At(0).Logs()
logRecords := instrumentationLibraryLogs.At(0).LogRecords()
logRecord = logRecords.At(0)

return logRecord
Expand Down
1 change: 0 additions & 1 deletion exporter/elasticsearchexporter/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ func (m *encodeModel) encodeLog(resource pdata.Resource, record pdata.LogRecord)
document.AddInt("TraceFlags", int64(record.Flags()))
document.AddString("SeverityText", record.SeverityText())
document.AddInt("SeverityNumber", int64(record.SeverityNumber()))
document.AddString("Name", record.Name())
document.AddAttribute("Body", record.Body())
document.AddAttributes("Attributes", record.Attributes())
document.AddAttributes("Resource", resource.Attributes())
Expand Down