From 36213125ff8675e1daa55c6b62c3b3affa3cff9a Mon Sep 17 00:00:00 2001 From: "jian.tan" Date: Fri, 11 Feb 2022 20:35:14 +0800 Subject: [PATCH 1/3] remove usage of Deprecated LogRecord.Name field. --- exporter/elasticsearchexporter/model.go | 1 - 1 file changed, 1 deletion(-) 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()) From 87f2ac429eab16b006f9caf21dddbf42c7c54989 Mon Sep 17 00:00:00 2001 From: "jian.tan" Date: Fri, 11 Feb 2022 20:56:34 +0800 Subject: [PATCH 2/3] add CHANGES --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4732e36a0bac..b379ae74dc58 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ - `datadogexporter`: Add insecure_skip_verify flag to configuration (#7422) - `coralogixexporter`: Update readme (#7785) - `awscloudwatchlogsexporter`: Remove name from aws cloudwatch logs exporter (#7554) +- `elasticsearchexporter`: Remove usage of deprecated LogRecord.Name field (#7829). ## 🛑 Breaking changes 🛑 From fc5d24b8a96fe9369a1284ec815751eb4be8bd21 Mon Sep 17 00:00:00 2001 From: "jian.tan" Date: Tue, 15 Feb 2022 22:49:51 +0800 Subject: [PATCH 3/3] fix lint --- exporter/azuremonitorexporter/logexporter.go | 2 +- exporter/azuremonitorexporter/logexporter_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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