Skip to content

Commit 1469019

Browse files
committed
respond to PR comments
1 parent 6c2a3eb commit 1469019

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/OpenTelemetry.Exporter.Geneva/GenevaLogExporter.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
using OpenTelemetry.Exporter.Geneva.Tld;
1010
using OpenTelemetry.Internal;
1111
using OpenTelemetry.Logs;
12+
using OpenTelemetry.Resources;
1213

1314
namespace OpenTelemetry.Exporter.Geneva;
1415

@@ -93,7 +94,7 @@ public GenevaLogExporter(GenevaExporterOptions options)
9394
var msgPackLogExporter = new MsgPackLogExporter(options, () =>
9495
{
9596
// this is not equivalent to passing a method reference, because the ParentProvider could change after the constructor.
96-
return this.ParentProvider.GetResource();
97+
return this.ParentProvider?.GetResource() ?? Resource.Empty;
9798
});
9899
this.IsUsingUnixDomainSocket = msgPackLogExporter.IsUsingUnixDomainSocket;
99100
this.exportLogRecord = msgPackLogExporter.Export;

src/OpenTelemetry.Exporter.Geneva/GenevaTraceExporter.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using OpenTelemetry.Exporter.Geneva.MsgPack;
77
using OpenTelemetry.Exporter.Geneva.Tld;
88
using OpenTelemetry.Internal;
9+
using OpenTelemetry.Resources;
910

1011
namespace OpenTelemetry.Exporter.Geneva;
1112

@@ -72,7 +73,7 @@ public GenevaTraceExporter(GenevaExporterOptions options)
7273
var msgPackTraceExporter = new MsgPackTraceExporter(options, () =>
7374
{
7475
// this is not equivalent to passing a method reference, because the ParentProvider could change after the constructor.
75-
return this.ParentProvider.GetResource();
76+
return this.ParentProvider?.GetResource() ?? Resource.Empty;
7677
});
7778
this.IsUsingUnixDomainSocket = msgPackTraceExporter.IsUsingUnixDomainSocket;
7879
this.exportActivity = msgPackTraceExporter.Export;

0 commit comments

Comments
 (0)