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

Batch export vs periodic exporting with OLTP exporter #2767

Closed
tomkerkhove opened this issue Jan 5, 2022 · 4 comments
Closed

Batch export vs periodic exporting with OLTP exporter #2767

tomkerkhove opened this issue Jan 5, 2022 · 4 comments
Labels
question Further information is requested

Comments

@tomkerkhove
Copy link
Contributor

Question

Describe your environment.

We are using the OTLP exporter with the default settings:

var configuredMetricProvider = Sdk.CreateMeterProviderBuilder()
                .AddMeter("Sample.*")
                .AddOtlpExporter(options => { options.Endpoint = new Uri(collectorUri); })

What are you trying to achieve?

We are using the OTLP exporter and want to understand what the interval is in which metrics will be flushed.

However, I'm not sure how options.BatchExportProcessorOptions.ScheduledDelayMilliseconds & options.PeriodicExportingMetricReaderOptions.ExportIntervalMilliseconds relate with each other.

I had the impression that one or the other is being used, but based on the default values they should both be used. (based on reading the code):

public ExportProcessorType ExportProcessorType { get; set; } = ExportProcessorType.Batch;
/// <summary>
/// Gets or sets the BatchExportProcessor options. Ignored unless ExportProcessorType is Batch.
/// </summary>
public BatchExportProcessorOptions<Activity> BatchExportProcessorOptions { get; set; } = new BatchExportActivityProcessorOptions();
/// <summary>
/// Gets or sets the <see cref="MetricReaderType" /> to use. Defaults to <c>MetricReaderType.Periodic</c>.
/// </summary>
public MetricReaderType MetricReaderType { get; set; } = MetricReaderType.Periodic;
/// <summary>
/// Gets or sets the <see cref="PeriodicExportingMetricReaderOptions" /> options. Ignored unless <c>MetricReaderType</c> is <c>Periodic</c>.
/// </summary>
public PeriodicExportingMetricReaderOptions PeriodicExportingMetricReaderOptions { get; set; } = new PeriodicExportingMetricReaderOptions();

Additional Context

N/A

@tomkerkhove tomkerkhove added the question Further information is requested label Jan 5, 2022
@alanwest
Copy link
Member

alanwest commented Jan 5, 2022

This is admittedly a little confusing at the moment.

ExportProcessorType and BatchExportProcessorOptions is only used for trace data at the moment.

MetricReaderType and PeriodicExportingMetricReaderOptions are used for metric data.

So, that's to say that options.BatchExportProcessorOptions.ScheduledDelayMilliseconds and options.PeriodicExportingMetricReaderOptions.ExportIntervalMilliseconds do not relate to each other. First one is used by the OTLP trace exporter and the second one used by the OTLP metrics exporter.

There's some works in progress exploring some different concepts for making the exporter's configuration more intuitive. (#2717 and #2721).


Ideally, ExportProcessorType and BatchExportProcessorOptions would not have been included on the OtlpExporterOptions class as they are not used for configuring the exporter at all. They're used for configuring the processor. The pipeline for traces and metrics differ architecturally in that there is no notion of a metric processor, so that's why these options do not relate to metrics.

@tomkerkhove
Copy link
Contributor Author

Thanks for explaining! Would it make sense if I send a PR to update the XML docs with this info? (trace vs metric)

@alanwest
Copy link
Member

alanwest commented Jan 7, 2022

You might wait just a bit. We'll settle on an approach in one of the PRs in progress soon. What we do there may influence how to best document things. I agree we need to make this more clear.

@tomkerkhove
Copy link
Contributor Author

Sounds good to me and thanks for the help.

Will close the issue for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants