You've already forked opentelemetry-go
mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2025-09-16 09:26:25 +02:00
Use empty resource when RecordFactory.Resource nil (#5264)
This commit is contained in:
@@ -67,8 +67,13 @@ func (b RecordFactory) NewRecord() sdklog.Record {
|
||||
attributeCountLimit = len(b.Attributes)
|
||||
}
|
||||
|
||||
res := b.Resource
|
||||
if res == nil {
|
||||
res = resource.Empty()
|
||||
}
|
||||
|
||||
provider := sdklog.NewLoggerProvider(
|
||||
sdklog.WithResource(b.Resource),
|
||||
sdklog.WithResource(res),
|
||||
sdklog.WithAttributeCountLimit(attributeCountLimit),
|
||||
sdklog.WithAttributeValueLengthLimit(-1),
|
||||
sdklog.WithProcessor(p),
|
||||
|
Reference in New Issue
Block a user