snowdrop / opentracing-example

OpenTracing Jaeger booster
1 stars 7 forks source link

tracing bean can't instantiated when deployed on openshift #8

Open cmoulliard opened 6 years ago

cmoulliard commented 6 years ago

With your latest change @geoand, the bean Tracer can' t be instantiated

2018-01-28 18:53:50.178  WARN 1 --- [           main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: 
Error creating bean with name 'noteController': Unsatisfied dependency expressed through field 'tracer'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: 

No qualifying bean of type 'io.opentracing.Tracer' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true), @org.springframework.beans.factory.annotation.Qualifier(value=app-tracer)}
--
  | 2018-01-28 18:53:50.180  INFO 1 --- [           main] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
  | 2018-01-28 18:53:50.191  INFO 1 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
  | 2018-01-28 18:53:50.231  INFO 1 --- [           main] utoConfigurationReportLoggingInitializer :
  | Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
  | 2018-01-28 18:53:50.548 ERROR 1 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   :
  | ***************************
  | APPLICATION FAILED TO START
  | ***************************
  | Description:
  | Field tracer in me.snowdrop.controller.NoteController required a bean of type 'io.opentracing.Tracer' that could not be found.
  | - Bean method 'getTracer' in 'TracerAutoConfiguration' not loaded because @ConditionalOnMissingBean (types: io.opentracing.Tracer; SearchStrategy: all) found bean 'JaegerTracer'
  | Action:
  | Consider revisiting the conditions above or defining a bean of type 'io.opentracing.Tracer' in your configuration.
geoand commented 6 years ago

Interesting, I will check it out!

cmoulliard commented 6 years ago

This is perhaps related to the fact that I added to the buildConfig -> incremental: true

geoand commented 6 years ago

I am deploying the project now, so let's see what happens

cmoulliard commented 6 years ago

This is not related to the change to BuildConfig and incremental: true

geoand commented 6 years ago

The project started just fine for me using

oc create -f openshift/spring-boot-tracing.yml
oc new-app spring-boot-tracing-template   -p SOURCE_REPOSITORY_URL=https://github.com/snowdrop/spring-boot-opentracing-booster.git

2018-01-28 19:32:43.022 INFO 1 --- [ main] m.s.App : Started App in 10.346 seconds (JVM running for 12.141)

http://spring-boot-tracing-boosters.192.168.42.13.nip.io/hello -> Hello from Spring Boot running on spring-boot-tracing-1-kqvmrpod !'

cmoulliard commented 6 years ago

I have updated the backend project of cloud-native dvlpt : https://goo.gl/heo3fK and now it is failing

geoand commented 6 years ago

With the same error?

cmoulliard commented 6 years ago

Yes. Same error as reported with this ticket

geoand commented 6 years ago

I was able to reproduce this issue in the backend cloud-native app, but not this one. I will investigate and report back.

geoand commented 6 years ago

I fixed the issue in the backend cloud-native see this PR. I still haven't been able to reproduce the issue on this project

cmoulliard commented 6 years ago

Interesting to see that the qualifier is not longer required. Why ?

geoand commented 6 years ago

I am pretty it was never needed in the first place :)

Ashishen commented 4 years ago

Hi I am facing this issue while trying to configure Jaeger with Kafka. Did anyone manage to resolve this.

geoand commented 4 years ago

@Ashishen IIRC, Kafka tracing isn't implemented yet

Ashishen commented 4 years ago

@geoand Hi Thanks for the response. I am trying to use jaeger find traces between microserices communicating by kafka topics. Do you mean we cannot implement Jaeger/open tracing in such scenario?

Ashishen commented 4 years ago

@geoand I am following this article https://objectpartners.com/2019/04/25/distributed-tracing-with-apache-kafka-and-jaeger/

geoand commented 4 years ago

I haven't looked lately TBH so don't take my word as an absolute truth. Best investigate and see if anything has changed

Ashishen commented 4 years ago

@geoand Thank You. I am trying to find some solution for the issue. Will share if I find anything.