-
Notifications
You must be signed in to change notification settings - Fork 773
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
making OtlpLogExporter public #4979
making OtlpLogExporter public #4979
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
Please add a changelog entry as well.
Codecov Report
@@ Coverage Diff @@
## main #4979 +/- ##
==========================================
- Coverage 83.54% 83.39% -0.15%
==========================================
Files 295 295
Lines 12336 12336
==========================================
- Hits 10306 10288 -18
- Misses 2030 2048 +18
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@@ -28,7 +28,7 @@ namespace OpenTelemetry.Exporter; | |||
/// Exporter consuming <see cref="LogRecord"/> and exporting the data using | |||
/// the OpenTelemetry protocol (OTLP). | |||
/// </summary> | |||
internal sealed class OtlpLogExporter : BaseExporter<LogRecord> | |||
public sealed class OtlpLogExporter : BaseExporter<LogRecord> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@CodeBlanch How do you feel about using a public sealed
modifier instead of just public
? All the other public classes are not marked sealed
. Should we unmark sealed
from this class as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably fine to make it public
. The reason to seal it would be to reserve the right to make changes to it in the future by preventing people from making more derived types. But just looking at the class, I don't see a strong need for that.
If we really wanted to make it nicely extensible we should consider the use cases. The class as it is probably isn't too useful for extension. Consider something like this...
public class OtlpLogExporter
{
public override ExportResult Export(in Batch<LogRecord> logRecordBatch)
{
// ...some logic omitted...
request.AddBatch(this.sdkLimitOptions, this.ProcessResource, activityBatch);
OnRequestSending(request); // Extension point
if (!this.exportClient.SendExportRequest(request))
{
return ExportResult.Failure;
}
// ...some logic omitted...
}
// Give a nice extension point for manipulating the request before it is sent
protected virtual void OnRequestSending(OtlpCollector.ExportLogsServiceRequest request) {}
}
Not saying we need to do this, just food for thought 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be a good addition in future when we sort out the OtlpCollector.ExportLogsServiceRequest
dependency. Right now the types are not exposed.
Fixes #4971
Changes
Making OtlpLogExporter public.
Merge requirement checklist
CHANGELOG.md
files updated for non-trivial changes