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

remove LogRecord.name references #8951

Merged
merged 4 commits into from
Mar 29, 2022
Merged
Show file tree
Hide file tree
Changes from 3 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
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@
### 🛑 Breaking changes 🛑

- `windowsperfcountersreceiver`: Added metrics configuration (#8376)
- `lokiexporter`: Remove deprecated LogRecord.name field (#8951)
- `splunkhecexporter`: Remove deprecated LogRecord.name field (#8951)

### 🚩 Deprecations 🚩

- `datadogexporter`: Deprecate `OnlyMetadata` method from `Config` struct (#8359)
- `datadogexporter`: Deprecate `GetCensoredKey` method from `APIConfig` struct (#8830)

- `resourcedetectionprocessor`: Add attribute allowlist (#8547)

### 💡 Enhancements 💡
Expand Down
1 change: 0 additions & 1 deletion exporter/lokiexporter/encode_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ func encodeJSON(lr pdata.LogRecord, res pdata.Resource) (string, error) {
return "", err
}
logRecord = lokiEntry{
Name: lr.Name(),
Body: body,
TraceID: lr.TraceID().HexString(),
SpanID: lr.SpanID().HexString(),
Expand Down
4 changes: 0 additions & 4 deletions exporter/splunkhecexporter/logdata_to_splunk.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,8 @@ func mapLogRecordToSplunkEvent(res pdata.Resource, lr pdata.LogRecord, config *C
sourceTypeKey := config.HecToOtelAttrs.SourceType
indexKey := config.HecToOtelAttrs.Index
hostKey := config.HecToOtelAttrs.Host
nameKey := config.HecFields.Name
severityTextKey := config.HecFields.SeverityText
severityNumberKey := config.HecFields.SeverityNumber
if lr.Name() != "" {
fields[nameKey] = lr.Name()
}
bogdandrutu marked this conversation as resolved.
Show resolved Hide resolved
if spanID := lr.SpanID().HexString(); spanID != "" {
fields[spanIDFieldKey] = spanID
}
Expand Down
4 changes: 0 additions & 4 deletions internal/coreinternal/processor/filterlog/filterlog.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,5 @@ func NewMatcher(mp *filterconfig.MatchProperties) (Matcher, error) {
// supported to have more than one of these specified, and all specified must
// evaluate to true for a match to occur.
func (mp *propertiesMatcher) MatchLogRecord(lr pdata.LogRecord, resource pdata.Resource, library pdata.InstrumentationLibrary) bool {
if mp.nameFilters != nil && !mp.nameFilters.Matches(lr.Name()) {
return false
}

return mp.PropertiesMatcher.Match(lr.Attributes(), resource, library)
}
2 changes: 1 addition & 1 deletion testbed/datasenders/syslog.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func (f *SyslogWriter) Send(lr pdata.LogRecord) error {
sdid.WriteString(fmt.Sprintf("%s=\"%s\" ", k, v.StringVal()))
return true
})
msg := fmt.Sprintf("<166> %s localhost %s - - [%s] %s\n", ts, lr.Name(), sdid.String(), lr.Body().StringVal())
msg := fmt.Sprintf("<166> %s localhost - - - [%s] %s\n", ts, sdid.String(), lr.Body().StringVal())

f.buf = append(f.buf, msg)
return f.SendCheck()
Expand Down
2 changes: 1 addition & 1 deletion testbed/datasenders/tcpudp.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func (f *TCPUDPWriter) Send(lr pdata.LogRecord) error {
sdid.WriteString(fmt.Sprintf("%s=\"%s\" ", k, v.StringVal()))
return true
})
msg := fmt.Sprintf("<166> %s localhost %s - - [%s] %s\n", ts, lr.Name(), sdid.String(), lr.Body().StringVal())
msg := fmt.Sprintf("<166> %s localhost - - - [%s] %s\n", ts, sdid.String(), lr.Body().StringVal())

f.buf = append(f.buf, msg)
return f.SendCheck()
Expand Down