Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Provide configuration properties for customising the auto-configured BatchSpanProcessor #44644

Open
as428y opened this issue Mar 7, 2025 · 0 comments
Labels
type: enhancement A general enhancement
Milestone

Comments

@as428y
Copy link

as428y commented Mar 7, 2025

Below are internal Otel properties are not auto-configured it requires to create a bean to populate non-default values

Per support advice asking for enhancement

otel.bsp.schedule.delay
otel.bsp.max.queue.size
otel.bsp.max.export.batch.size
otel.bsp.export.timeout

Example of bean

    @Bean
    BatchSpanProcessor otelSpanProcessorImpl(SpanExporters spanExporters,
                                         ObjectProvider<SpanExportingPredicate> spanExportingPredicates,
                                         ObjectProvider<SpanReporter> spanReporters,
                                         ObjectProvider<SpanFilter> spanFilters,
                                         ObjectProvider<MeterProvider> meterProvider)
    {
        BatchSpanProcessorBuilder builder = BatchSpanProcessor
                .builder(new CompositeSpanExporter( spanExporters.list(),
                        spanExportingPredicates.orderedStream().toList(),
                        spanReporters.orderedStream().toList(),
                        spanFilters.orderedStream().toList())
                );

        meterProvider.ifAvailable(builder::setMeterProvider);

        builder.setMaxQueueSize(2048) //otel.bsp.max.queue.size
                .setMaxExportBatchSize(1) //otel.bsp.max.export.batch.size
                .setScheduleDelay(Duration.ofMillis(9000)) //otel.bsp.schedule.delay
                .setExporterTimeout(Duration.ofMillis(30000)) //otel.bsp.export.timeout
        //.setExportTimeoutMillis(1);
        ;

        return builder.build();
    }
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Mar 7, 2025
@wilkinsona wilkinsona added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Mar 7, 2025
@wilkinsona wilkinsona added this to the 3.x milestone Mar 7, 2025
@wilkinsona wilkinsona changed the title Allow autoconfiguration for internal OTEL properties Provide configuration properties for customising the auto-configured BatchSpanProcessor Mar 7, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants