-
Notifications
You must be signed in to change notification settings - Fork 40.7k
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
OtlpMetricsExportAutoConfiguration uses default OTLP metrics url when value comes from Dynamic Properties #41276
Comments
Thanks, @eddumelendez. As far as I can tell, there's a general lifecycle problem with The
@Bean
static BeanFactoryPostProcessor otlpPropertiesDependencies() {
return (beanFactory) -> {
BeanDefinition definition = beanFactory.getBeanDefinition("management.otlp.metrics.export-" + OtlpProperties.class.getCanonicalName());
definition.setDependsOn("lgtmContainer");
};
} I'm not sure how to fix this properly so I'd like to discuss it with the team. There are some similarities with problems we've had in the past with meter registry post-processing. The fixes for those may give us some inspiration. |
Hi @wilkinsona, thanks for the explanation and the workaround! Looking forward for the team meeting's outcome |
We've fixed this in 3.4 with the switch to using |
I am using
grafana/otel-lgtm:0.6.0
image in order to test OpenTelemetry support (metrics, traces, logging) in Spring Boot 3.4.0-SNAPSHOT and it can not be used with@ServiceConnection("otel/opentelemetry-collector-contrib")
because there is no Docker Compose/Testcontainers implementation forOtlpLoggingConnectionDetails
. So, the values are contributed via Dynamic Properties as you can see in the reproduces linked below. Using@ServiceConnection("otel/opentelemetry-collector-contrib")
, metrics and tracing works as expected.Reproducer: https://github.com/eddumelendez/spring-boot-testcontainers-grafana-lgtm/tree/otlp_logs
Values for Tracing and Logging comes from Testcontainers but metrics was not contributed.
I tried to dig into it but I am missing something about the Export Metrics AutoConfiguration configuration order.
Also, next steps:
grafana/otel-lgtm
image for Service Connection. I think Testcontainers should provide aLgtmStackContainer
as part of a brand newgrafana
moduleConnectionDetails
support forOtlpLoggingConnectionDetails
(Docker Compose/Testcontainers)The text was updated successfully, but these errors were encountered: