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

[feature request] GenevaExporter to support runtime configurations changes #2576

Open
amadeuszl opened this issue Feb 27, 2025 · 1 comment
Labels
comp:exporter.geneva Things related to OpenTelemetry.Exporter.Geneva enhancement New feature or request

Comments

@amadeuszl
Copy link

amadeuszl commented Feb 27, 2025

Component

OpenTelemetry.Exporter.Geneva

Is your feature request related to a problem?

This issue is mainly concerned about logging.

Configuration and initialization of Geneva Exporter does not support changing configurations in the runtime. Following API does not support eg. providing IOptionsMonitor or other OnChange events to the Exporter.

using var loggerFactory = LoggerFactory.Create(loggingBuilder => loggingBuilder
    .AddOpenTelemetry(openTelemetryLoggerOptions =>
    {
        openTelemetryLoggerOptions.AddGenevaLogExporter(genevaExporterOptions =>
        {
            genevaExporterOptions.ConnectionString = "EtwSession=OpenTelemetry";
        });
    }));

Consequently, services using Geneva logging are unable to incorporate reloading or updating configurations in the service's runtime, meaning after DI container build and server start. Options are saved into the exporter at the initialization. There are particular use cases for to change connection string or TableMapping in the runtime, eg. migration between different namespaces/accounts/tables or runtime switches of table targets due to performance reasons such as problems with exceeding table capacity.

Current behavior requires services to restart in order to load new configurations, which may be undesirable.

What is the expected behavior?

On Geneva Exporter initialization, Exporter should hook up to OnChange events in order to change options used by Exporter to export logs in the service's runtime.
I believe 2 scenarios should be supported

  1. Providing IOptionsMonitor, and hooking up to Exporter internals to Onchange events - support for .NET native API should be there.
  2. Providing delegate or action to trigger OnChange events, that Exporter will be listening to - it would be particularly useful for scenarios, where services don't rely on Options pattern.

Which alternative solutions or features have you considered?

We could lazy load Exporter or the options or create a wrapper around the exporter, by providing separated Logger, that would rebuild exporter if configs change. Rebuilding Exporter related objects seems quite heavy and it needs some kind of flushing mechanism to prevent logs loss during rebuild.

Additional context

No response

@amadeuszl amadeuszl added the enhancement New feature or request label Feb 27, 2025
@github-actions github-actions bot added the comp:exporter.geneva Things related to OpenTelemetry.Exporter.Geneva label Feb 27, 2025
Copy link
Contributor

Tagging component owner(s).

@CodeBlanch @rajkumar-rangaraj @TimothyMothra @xiang17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:exporter.geneva Things related to OpenTelemetry.Exporter.Geneva enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant