-
Notifications
You must be signed in to change notification settings - Fork 366
Geneva exporter: Support resource attributes in log exporter #3646
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
Changes from 16 commits
e369add
d6c3940
1b8bec5
604fd2b
70d310c
5805669
a53b3bf
6149cb1
988a757
ccfb2fd
0538e92
9987054
2d6fc06
98a159f
50b68dd
630b3ab
4fe80cb
0393845
6c2a3eb
1469019
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,10 +17,10 @@ namespace OpenTelemetry.Exporter.Geneva; | |
| /// </summary> | ||
| public class GenevaLogExporter : GenevaBaseExporter<LogRecord> | ||
| { | ||
| internal readonly IDisposable Exporter; | ||
| internal bool IsUsingUnixDomainSocket; | ||
|
|
||
| private readonly ExportLogRecordFunc exportLogRecord; | ||
| private readonly IDisposable exporter; | ||
|
|
||
| private bool isDisposed; | ||
|
|
||
|
|
@@ -46,7 +46,7 @@ public GenevaLogExporter(GenevaExporterOptions options) | |
| var eventHeaderLogExporter = new EventHeaderLogExporter(options); | ||
| this.IsUsingUnixDomainSocket = false; | ||
| this.exportLogRecord = eventHeaderLogExporter.Export; | ||
| this.exporter = eventHeaderLogExporter; | ||
| this.Exporter = eventHeaderLogExporter; | ||
| return; | ||
| #else | ||
| throw new ArgumentException("Exporting data in user_events is only supported for .NET 8 or later on Linux."); | ||
|
|
@@ -90,17 +90,21 @@ public GenevaLogExporter(GenevaExporterOptions options) | |
|
|
||
| if (useMsgPackExporter) | ||
| { | ||
| var msgPackLogExporter = new MsgPackLogExporter(options); | ||
| var msgPackLogExporter = new MsgPackLogExporter(options, () => | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this have a null check? If There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll change it but I notice that if ParentProvider can really be null, then the existing metric code is also broken: https://github.com/open-telemetry/opentelemetry-dotnet-contrib/blob/main/src/OpenTelemetry.Exporter.Geneva/Metrics/GenevaMetricExporter.cs#L112
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does this mean? Is it a bug or not?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not a bug; the wording may have caused the confusion.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks @rajkumar-rangaraj! Then this sounds wrong and should be reverted back.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, this needs a fix. I will send a follow-up PR. |
||
| { | ||
| // this is not equivalent to passing a method reference, because the ParentProvider could change after the constructor. | ||
| return this.ParentProvider.GetResource(); | ||
| }); | ||
| this.IsUsingUnixDomainSocket = msgPackLogExporter.IsUsingUnixDomainSocket; | ||
| this.exportLogRecord = msgPackLogExporter.Export; | ||
| this.exporter = msgPackLogExporter; | ||
| this.Exporter = msgPackLogExporter; | ||
| } | ||
| else | ||
| { | ||
| var tldLogExporter = new TldLogExporter(options); | ||
| this.IsUsingUnixDomainSocket = false; | ||
| this.exportLogRecord = tldLogExporter.Export; | ||
| this.exporter = tldLogExporter; | ||
| this.Exporter = tldLogExporter; | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -124,7 +128,7 @@ protected override void Dispose(bool disposing) | |
| { | ||
| try | ||
| { | ||
| this.exporter.Dispose(); | ||
| this.Exporter.Dispose(); | ||
| } | ||
| catch (Exception ex) | ||
| { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.