Skip to content
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

Blueprint for the path to stabilizing the OTLP log exporter #4416

Conversation

alanwest
Copy link
Member

Related to #4388

@vishweshbankwar @CodeBlanch

I do not intend for this PR to merge. I'm just using it to communicate what I've been thinking about since our SIG conversation this week.

I'd like us to consider delaying the decision to create a new base class for OTLP options (#4391). I recognize that we have some patterns for configuring the OTLP exporter that we are not happy with, and in order to get things on a track we're more happy with it may require a new base class + signal-specific option classes.

My hope is that we can decouple "addressing patterns we don't like" from "let's ship a stable OTLP log exporter".

In this PR I introduce some new option classes that mimics the pattern we used for metrics (i.e., MetricReaderOptions separate from OtlpExporterOptions).

namespace OpenTelemetry.Logs
{
+   public class LogRecordExportProcessorOptions
    {
+       public ExportProcessorType ExportProcessorType { get; set; }
+       public BatchExportLogRecordProcessorOptions BatchExportProcessorOptions { get; set; }
    }

    // This class will support the environment variables for logs i.e., OTEL_BLRP_*
+   public class BatchExportLogRecordProcessorOptions : BatchExportProcessorOptions<LogRecord>
    {

    }
}

Furthermore, we would have corresponding classes for Activity, allowing us to obsolete the processor-specific options currently on OtlpExporterOptions.

@alanwest alanwest changed the title Alanwest/stabilize otlp log exporter Blueprint for the path to stabilizing the OTLP log exporter Apr 21, 2023
Comment on lines +32 to 33
[Obsolete("We will never ship this method as it is. We will ship the one that returns LoggerProviderBuilder from main-logs branch instead of OpenTelemetryLoggerOptions.")]
public static OpenTelemetryLoggerOptions AddOtlpExporter(this OpenTelemetryLoggerOptions loggerOptions)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This highlights one reason we should not attempt to ship a stable OTLP exporter without first integrating LoggerProviderBuilder currently on the main-logs branch.

Comment on lines +56 to +59
public static OpenTelemetryLoggerOptions AddOtlpExporter(
this OpenTelemetryLoggerOptions loggerOptions,
Action<OtlpExporterOptions> configure,
Action<LogRecordExportProcessorOptions> configureProcessorOptions)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This differs from what we did with metrics.

public static MeterProviderBuilder AddOtlpExporter(
this MeterProviderBuilder builder,
Action<OtlpExporterOptions, MetricReaderOptions> configureExporterAndMetricReader)

That is, I've separated the delegates to configure the exporter and processor options. I'm a bit torn here, because I know we're unhappy with the pattern we used for metrics because it cannot be well supported by IOptions. But on the other hand, I don't like that we're introducing an inconsistency.

One option may be to obsolete the extensions we have for metrics and add overloads that have a separate delegate for configuring MetricReaderOptions.

@vishweshbankwar
Copy link
Member

@alanwest Just adding some questions to clarify my understanding

  1. decouple "addressing patterns we don't like" from "let's ship a stable OTLP log exporter" --> I agree. which one should be done first?
  2. LogRecordExportProcessorOptions will resolve BatchExportProcessorOptions for otlp log exporter #4388. We will still have a gap of supporting OTEL_EXPORTER_OTLP_SIGNAL_* environment variables, Is my understanding correct?
  3. New extensions on Logs and Activity that takes in Action<OtlpExporterOptions> and Action<Log/ActivityBatchExportProcessorOptions> will also potentially be obsolete when we attempt to solve 2)?

@alanwest alanwest closed this Apr 24, 2023
@alanwest alanwest reopened this Apr 24, 2023
@alanwest
Copy link
Member Author

@alanwest Just adding some questions to clarify my understanding

  1. decouple "addressing patterns we don't like" from "let's ship a stable OTLP log exporter" --> I agree. which one should be done first?

Shipping the OTLP exporter and required support from the API/SDK should be done first. With the logs spec now stable (just happened this morning), I think we should aim to release stable logs as soon as we can. To me, this means not addressing patterns we don't like until after the first initial stable release.

  1. LogRecordExportProcessorOptions will resolve BatchExportProcessorOptions for otlp log exporter #4388. We will still have a gap of supporting OTEL_EXPORTER_OTLP_SIGNAL_* environment variables, Is my understanding correct?

Yes, this is correct. I do not think that fixing this gap should be a priority for the initial stable release. The solutions that have been proposed to address this gap are some what disruptive i.e., introducing a new base class, signal-specific option classes, adding new extension methods possibly utilizing a new builder pattern, and perhaps obsoleting old extension methods. I think it would be ideal to try out these ideas after the initial stable release. The reason is because I think it would be good to have this work sit in pre-release for a decent amount of time so we get as much feedback as possible.

  1. New extensions on Logs and Activity that takes in Action<OtlpExporterOptions> and Action<Log/ActivityBatchExportProcessorOptions> will also potentially be obsolete when we attempt to solve 2)?

Yes, I think solving 2 may involve obsoleting some extension methods. Though, in the immediate term for the initial stable release I feel strongly that we should obsolete the Activity-specific options currently on `OtlpExporterOptions - they have already caused confusion with metrics and they will cause even more confusion for logs.

@vishweshbankwar
Copy link
Member

@alanwest Just adding some questions to clarify my understanding

  1. decouple "addressing patterns we don't like" from "let's ship a stable OTLP log exporter" --> I agree. which one should be done first?

Shipping the OTLP exporter and required support from the API/SDK should be done first. With the logs spec now stable (just happened this morning), I think we should aim to release stable logs as soon as we can. To me, this means not addressing patterns we don't like until after the first initial stable release.

  1. LogRecordExportProcessorOptions will resolve BatchExportProcessorOptions for otlp log exporter #4388. We will still have a gap of supporting OTEL_EXPORTER_OTLP_SIGNAL_* environment variables, Is my understanding correct?

Yes, this is correct. I do not think that fixing this gap should be a priority for the initial stable release. The solutions that have been proposed to address this gap are some what disruptive i.e., introducing a new base class, signal-specific option classes, adding new extension methods possibly utilizing a new builder pattern, and perhaps obsoleting old extension methods. I think it would be ideal to try out these ideas after the initial stable release. The reason is because I think it would be good to have this work sit in pre-release for a decent amount of time so we get as much feedback as possible.

  1. New extensions on Logs and Activity that takes in Action<OtlpExporterOptions> and Action<Log/ActivityBatchExportProcessorOptions> will also potentially be obsolete when we attempt to solve 2)?

Yes, I think solving 2 may involve obsoleting some extension methods. Though, in the immediate term for the initial stable release I feel strongly that we should obsolete the Activity-specific options currently on `OtlpExporterOptions - they have already caused confusion with metrics and they will cause even more confusion for logs.

Sounds good! @CodeBlanch Does this sound good to you? If yes, then I can create an issue to note down the clear plan.

@github-actions
Copy link
Contributor

github-actions bot commented May 4, 2023

This PR was marked stale due to lack of activity and will be closed in 7 days. Commenting or Pushing will instruct the bot to automatically remove the label. This bot runs once per day.

@github-actions github-actions bot added the Stale Issues and pull requests which have been flagged for closing due to inactivity label May 4, 2023
@alanwest alanwest closed this May 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Stale Issues and pull requests which have been flagged for closing due to inactivity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants