Skip to content

Retry Policy for OtlpHttpSpanExporter and OtlpGrpcSpanExporter are not auto-configured #44645

Closed as not planned
@as428y

Description

@as428y

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();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: supersededAn issue that has been superseded by another

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions