-
Notifications
You must be signed in to change notification settings - Fork 96
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
Service name must not be null or empty #73
Comments
Makes sense. Would you like to contribute this enhancement? |
This issue seems to be fixed in https://github.com/opentracing-contrib/java-spring-tracer-configuration/blob/master/opentracing-spring-tracer-configuration-starter/src/main/java/io/opentracing/contrib/spring/tracer/configuration/TracerAutoConfiguration.java @ConditionalOnProperty(value = "opentracing.jaeger.enabled", havingValue = "true", matchIfMissing = true) As we don't need any Tracer if Jaeger tracing is disabled The JaegerAutoConfiguration files have following annotation @ConditionalOnProperty(value = "opentracing.jaeger.enabled", havingValue = "true", matchIfMissing = true) @AutoConfigureBefore(io.opentracing.contrib.spring.tracer.configuration.TracerAutoConfiguration.class) |
So this is still not fixed, because I'm still having the same error. |
Just ran into the same issue myself. |
Which version stills exhibits the problem? |
@geoand using version 2.0.3 |
Thanks, Do you have a small reproducer perhaps? |
@geoand so there's no misunderstanding, i'm not using the Custom Configuration Class. Just using properties
|
@aveiros thanks for the info. Do you have a complete sample application I can look at that has the properties you mention and shows the erroneous behavior? |
I will come back to you later in the day. |
sorry for the delay |
Thanks! I'll check it out soon |
The problem comes from the
@pavolloffay remind me again please why we need that module? |
IIRC it provides a tracer resolution mechanism |
OK thanks. We might need to reexamine this |
This error appears even if the service name is defined. I encounter it with the following configuration
|
Fix is described on main page: |
I noticed that for us this is caused by ReactorTracingAutoConfiguration in the The mentioned auto-configuration registers hooks for some of the reactor parts. Unfortunately, under certain circumstances the hooks there get triggered before the Personally, I just disabled the particular auto-configuration by specifying |
This doesn't work and results in the error described above. How are we able to simply diable Jaeger locally? |
So this is still not fixed, I'm still having the same error with service-name |
Since this factory is trying to pull the service name from a system property, as an immediate workaround until this bug is resolved, this exception can be suppressed by setting the system property static {
System.setProperty(io.jaegertracing.Configuration.JAEGER_SERVICE_NAME, "a-service-name");
} |
Another solution which may be better since it uses an actual no-op tracer instead of attempting to report traces using the default config values: import io.opentracing.Tracer;
import io.opentracing.noop.NoopTracerFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class NoOpTracerBean {
@Bean
@ConditionalOnProperty(value = "opentracing.jaeger.enabled", havingValue = "false")
public Tracer getTracer() {
return NoopTracerFactory.create();
}
} |
Nope!
We then renamed method from
We finally added
The workaround #73 (comment) posted by @ivangreene works. This is our class: @Configuration
@ConditionalOnProperty( value = "opentracing.jaeger.enabled", havingValue = "false", matchIfMissing = false )
@Slf4j
public class DisableJaegerConfiguration {
static {
log.info( "Init NoopTracer" );
System.setProperty( io.jaegertracing.Configuration.JAEGER_SERVICE_NAME, "a-service-name" );
}
} |
The simplest way for me (local app run) was to add env var JAEGER_SERVICE_NAME=myApp to IDE Run/Debug Configurations to Spring Boot app. After that exceptions during app startup gone. |
I want to disable jaeger span using opentracing-jaeger-enabled: false and no jaeger service name is defined. However I'm getting following error java.lang.IllegalArgumentException: Service name must not be null or empty.
The service name should be check if and only if the enabled flag is set to true.
The text was updated successfully, but these errors were encountered: