diff --git a/CHANGELOG.md b/CHANGELOG.md index ee9fa9dfdce1..703c54e0eb38 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 🛑 diff --git a/exporter/azuremonitorexporter/logexporter.go b/exporter/azuremonitorexporter/logexporter.go index acf355778b6e..61a81bf2f3b5 100644 --- a/exporter/azuremonitorexporter/logexporter.go +++ b/exporter/azuremonitorexporter/logexporter.go @@ -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 diff --git a/exporter/azuremonitorexporter/logexporter_test.go b/exporter/azuremonitorexporter/logexporter_test.go index 559941d70238..6a703843dd5d 100644 --- a/exporter/azuremonitorexporter/logexporter_test.go +++ b/exporter/azuremonitorexporter/logexporter_test.go @@ -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 diff --git a/exporter/elasticsearchexporter/model.go b/exporter/elasticsearchexporter/model.go index 8c4c752e0683..849755884188 100644 --- a/exporter/elasticsearchexporter/model.go +++ b/exporter/elasticsearchexporter/model.go @@ -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())