1
0
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:
Tyler Yahn
2024-04-28 10:07:43 -07:00
committed by GitHub
parent c9c15038ba
commit 97948259ec

View File

@@ -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),