It requires to override Beans for OtlpHttpSpanExporter and OtlpGrpcSpanExporter, in order to populate RetryPolicy

In this case better would to have Customizer or Dedicated bean for HTTP\gRPC rather overriding Bean

@Bean
@ConditionalOnProperty(prefix = "management.otlp.tracing", name = "transport", havingValue = "grpc")
OtlpGrpcSpanExporter otlpGrpcSpanExporter(OtlpTracingProperties properties,
                                          OtlpTracingConnectionDetails connectionDetails)
{
    //org.springframework.boot.actuate.autoconfigure.tracing.otlp.OtlpTracingConfigurations$Exporters
    RetryPolicy retryPolicy = RetryPolicy.builder()
            .setMaxAttempts(5)                      // Max retry attempts
            .setInitialBackoff(Duration.ofMillis(100)) // Initial backoff duration
            .setMaxBackoff(Duration.ofSeconds(5))    // Max backoff duration
            .setBackoffMultiplier(2.0)              // Backoff multiplier
            //.setMaxRetryDuration(Duration.ofMinutes(1)) // Maximum retry duration
            .build();

    OtlpGrpcSpanExporterBuilder builder = OtlpGrpcSpanExporter.builder()
            .setRetryPolicy(retryPolicy) //********************************************
            .setEndpoint(connectionDetails.getUrl(Transport.GRPC))
            .setTimeout(properties.getTimeout())
            .setConnectTimeout(properties.getConnectTimeout())
            .setCompression(properties.getCompression().name().toLowerCase(Locale.ROOT));
    properties.getHeaders().forEach(builder::addHeader);

   //io.opentelemetry.sdk.trace.export.BatchSpanProcessor

    return builder.build();
}

Comment From: mhalbritter

We can either add customizers for OtlpHttpSpanExporterBuilder and OtlpGrpcSpanExporterBuilder or we could add properties to configure the retry.

There are more set... methods on the builders, so I'm leaning towards the customizers.

Comment From: nosan

... so I'm leaning towards the customizers.

I believe this is the only viable option here.

Considering the current issue with configuring RetryPolicy, RetryPolicy cannot be configured only by using properties alone because of RetryPolicy.builder().setRetryExceptionPredicate(Predicate<Exception>).

Unfortunately, this would require introducing two customizers

Comment From: nosan

I have implemented the customizers approach in this branch

Comment From: as428y

Thanks for implementing ! Is there an ETA in what version it will be released?

Comment From: nosan

@as428y Apologies for the confusion, let me clarify. As a contributor, I’ve prepared a solution for this issue by using customizers. This solution currently exists in my forked spring-boot repository and is not part of the main spring-boot repository.

The final decision on whether to use properties or customizers has not been made yet.

Comment From: as428y

Thanks for clarification! I believe it will approved


From: Dmytro Nosan @.> Sent: Thursday, March 13, 2025 6:58:14 PM To: spring-projects/spring-boot @.> Cc: Alexander Shapiro (ashapiro) @.>; Mention @.> Subject: Re: [spring-projects/spring-boot] Retry Policy for OtlpHttpSpanExporter and OtlpGrpcSpanExporter are not auto-configured (Issue #44645)

You don't often get email from @.*** Learn why this is importanthttps://aka.ms/LearnAboutSenderIdentification CAUTION: This email is from an external source. Please don’t open any unknown links or attachments.

@as428yhttps://github.com/as428y Apologies for the confusion, let me clarify. As a contributor, I’ve prepared a solution for this issue by using customizers. This solution currently exists in my forked spring-boot repository and is not part of the main spring-boot repository.

The final decision on whether to use properties or customizers has not been made yet.

— Reply to this email directly, view it on GitHubhttps://github.com/spring-projects/spring-boot/issues/44645#issuecomment-2722000421, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AJIAFXQDPFBH6QCZS7EPKAD2UG2KNAVCNFSM6AAAAABYRJ3UMSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMRSGAYDANBSGE. You are receiving this because you were mentioned.Message ID: @.***>

[nosan]nosan left a comment (spring-projects/spring-boot#44645)https://github.com/spring-projects/spring-boot/issues/44645#issuecomment-2722000421

@as428yhttps://github.com/as428y Apologies for the confusion, let me clarify. As a contributor, I’ve prepared a solution for this issue by using customizers. This solution currently exists in my forked spring-boot repository and is not part of the main spring-boot repository.

The final decision on whether to use properties or customizers has not been made yet.

— Reply to this email directly, view it on GitHubhttps://github.com/spring-projects/spring-boot/issues/44645#issuecomment-2722000421, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AJIAFXQDPFBH6QCZS7EPKAD2UG2KNAVCNFSM6AAAAABYRJ3UMSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMRSGAYDANBSGE. You are receiving this because you were mentioned.Message ID: @.***> This email and the information contained herein is proprietary and confidential and subject to the Amdocs Email Terms of Service, which you may review at https://www.amdocs.com/about/email-terms-of-service https://www.amdocs.com/about/email-terms-of-service