From 220d98b89abc510b363c5f94c65cb0751bee4ec1 Mon Sep 17 00:00:00 2001 From: Peter Wiese Date: Thu, 28 Apr 2022 18:38:21 -0700 Subject: [PATCH] [exporter/azuremonitor] Drop reference to obsolete LogRecord.Name (#9544) LogRecord.Name is obsolete and uses of it must be removed from this repo. Link to tracking Issue: #9258 --- CHANGELOG.md | 1 + exporter/azuremonitorexporter/log_to_envelope.go | 7 ++----- exporter/azuremonitorexporter/logexporter_test.go | 1 - 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 98fc4813f33a..9bd8b305b77c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ - `cumulativetodeltaprocessor`: Deprecated `metrics` configuration option in favor of `include` and `exclude` (#8952) - `datadogexporter`: Deprecate `metrics::report_quantiles` in favor of `metrics::summaries::mode` (#8846) +- `exporter/azuremonitor`: Deprecate use of LogRecord.Name as the log envelope category name. There is no replacement. ### 🚀 New components 🚀 diff --git a/exporter/azuremonitorexporter/log_to_envelope.go b/exporter/azuremonitorexporter/log_to_envelope.go index 07c87713d377..5b26da6656c3 100644 --- a/exporter/azuremonitorexporter/log_to_envelope.go +++ b/exporter/azuremonitorexporter/log_to_envelope.go @@ -24,9 +24,8 @@ import ( ) const ( - traceIDTag = "TraceId" - spanIDTag = "SpanId" - categoryNameTag = "CategoryName" + traceIDTag = "TraceId" + spanIDTag = "SpanId" ) var severityLevelMap = map[string]contracts.SeverityLevel{ @@ -60,8 +59,6 @@ func (packer *logPacker) LogRecordToEnvelope(logRecord plog.LogRecord) *contract envelope.Tags[contracts.OperationId] = hexTraceID messageData.Properties[spanIDTag] = logRecord.SpanID().HexString() - - messageData.Properties[categoryNameTag] = logRecord.Name() envelope.Name = messageData.EnvelopeName("") data.BaseData = messageData diff --git a/exporter/azuremonitorexporter/logexporter_test.go b/exporter/azuremonitorexporter/logexporter_test.go index 7b4676b46d6c..f5b72db8040a 100644 --- a/exporter/azuremonitorexporter/logexporter_test.go +++ b/exporter/azuremonitorexporter/logexporter_test.go @@ -88,7 +88,6 @@ func TestLogRecordToEnvelope(t *testing.T) { assert.Equal(t, envelope.Tags[contracts.OperationId], hexTraceID) assert.Equal(t, messageData.Properties[spanIDTag], logRecord.SpanID().HexString()) - assert.Equal(t, messageData.Properties[categoryNameTag], logRecord.Name()) }) } }