Skip to content

Commit

Permalink
[exporter/azuremonitor] Drop reference to obsolete LogRecord.Name (#9544
Browse files Browse the repository at this point in the history
)

LogRecord.Name is obsolete and uses of it must be removed from this repo.

Link to tracking Issue:
#9258
  • Loading branch information
pcwiese authored Apr 29, 2022
1 parent 121ba63 commit 220d98b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 🚀

Expand Down
7 changes: 2 additions & 5 deletions exporter/azuremonitorexporter/log_to_envelope.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ import (
)

const (
traceIDTag = "TraceId"
spanIDTag = "SpanId"
categoryNameTag = "CategoryName"
traceIDTag = "TraceId"
spanIDTag = "SpanId"
)

var severityLevelMap = map[string]contracts.SeverityLevel{
Expand Down Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion exporter/azuremonitorexporter/logexporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
})
}
}
Expand Down

0 comments on commit 220d98b

Please sign in to comment.