openzipkin-attic / zipkin-azure

Reporters and collectors for use in Azure
Apache License 2.0
11 stars 9 forks source link

Cannot run the application following instructions #34

Closed aliostad closed 7 years ago

aliostad commented 7 years ago

After a while came back to this and trying to run - in the past I used different parameters. Word by word, I followed the instructions but evenhub module does not get loaded. I even put debug outputs in the paths of code but they are never called.

Here is my tmp:

total 104936
drwxr-xr-x  4 aliostad  staff   136B 21 Jun 22:47 .
drwxr-xr-x  7 aliostad  staff   238B 21 Jun 22:47 ..
drwxr-xr-x  6 aliostad  staff   204B 21 Jun 22:47 eventhub
-rw-r--r--  1 aliostad  staff    51M 21 Jun 22:47 zipkin.jar

And here is inside my eventhub:

total 8
drwxr-xr-x   6 aliostad  staff   204B 21 Jun 22:47 .
drwxr-xr-x   4 aliostad  staff   136B 21 Jun 22:47 ..
drwxr-xr-x   5 aliostad  staff   170B 21 Jun 22:37 META-INF
drwxr-xr-x  11 aliostad  staff   374B 21 Jun 22:37 lib
drwxr-xr-x   3 aliostad  staff   102B 21 Jun 22:29 zipkin
-rw-r--r--   1 aliostad  staff   559B 21 Jun 22:37 zipkin-server-eventhub.yml

And I cd to tmp and run below:

EVENTHUB_CONNECTION_STRING=blah
EVENTHUB_STORAGE_CONNECTION_STRING=blah
java -Dloader.path=eventhub -Dspring.profiles.active=eventhub -cp zipkin.jar org.springframework.boot.loader.PropertiesLauncher

And here is output from the zipkin server:

                                    ********
                                  **        **
                                 *            *
                                **            **
                                **            **
                                 **          **
                                  **        **
                                    ********
                                      ****
                                      ****
        ****                          ****
     ******                           ****                                 ***
  ****************************************************************************
    *******                           ****                                 ***
        ****                          ****
                                       **
                                       **

             *****      **     *****     ** **       **     **   **
               **       **     **  *     ***         **     **** **
              **        **     *****     ****        **     **  ***
             ******     **     **        **  **      **     **   **

:: Powered by Spring Boot ::         (v1.5.4.RELEASE)

2017-06-21 22:54:57.477  INFO 41640 --- [           main] zipkin.server.ZipkinServer               : Starting ZipkinServer on AliKheyrollahis-MacBook-Pro.local with PID 41640 (/Users/aliostad/zipkin-eventhub-pod/tmp/zipkin.jar started by aliostad in /Users/aliostad/zipkin-eventhub-pod/tmp)
2017-06-21 22:54:57.485  INFO 41640 --- [           main] zipkin.server.ZipkinServer               : The following profiles are active: shared,eventhub
2017-06-21 22:54:57.601  INFO 41640 --- [           main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@5e3a8624: startup date [Wed Jun 21 22:54:57 BST 2017]; root of context hierarchy
getMatchOutcome
2017-06-21 22:54:59.410  INFO 41640 --- [           main] o.s.b.f.s.DefaultListableBeanFactory     : Overriding bean definition for bean 'characterEncodingFilter' with a different definition: replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.web.HttpEncodingAutoConfiguration; factoryMethodName=characterEncodingFilter; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/web/HttpEncodingAutoConfiguration.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=zipkin.autoconfigure.ui.ZipkinUiAutoConfiguration; factoryMethodName=characterEncodingFilter; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [zipkin/autoconfigure/ui/ZipkinUiAutoConfiguration.class]]
2017-06-21 22:54:59.874  INFO 41640 --- [           main] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2017-06-21 22:55:01.058  INFO 41640 --- [           main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 9411 (http)
2017-06-21 22:55:01.091  INFO 41640 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2017-06-21 22:55:01.095  INFO 41640 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet Engine: Apache Tomcat/8.5.15
2017-06-21 22:55:01.283  INFO 41640 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2017-06-21 22:55:01.283  INFO 41640 --- [ost-startStop-1] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 3688 ms
2017-06-21 22:55:01.858  INFO 41640 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean  : Mapping servlet: 'dispatcherServlet' to [/]
2017-06-21 22:55:01.866  INFO 41640 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'metricsFilter' to: [/*]
2017-06-21 22:55:01.866  INFO 41640 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2017-06-21 22:55:01.866  INFO 41640 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2017-06-21 22:55:01.867  INFO 41640 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'requestContextFilter' to: [/*]
2017-06-21 22:55:01.867  INFO 41640 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'webRequestLoggingFilter' to: [/*]
2017-06-21 22:55:01.868  INFO 41640 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'applicationContextIdFilter' to: [/*]
2017-06-21 22:55:01.869  INFO 41640 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'characterEncodingFilter' to: [/*]
2017-06-21 22:55:02.616  INFO 41640 --- [           main] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for @ControllerAdvice: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@5e3a8624: startup date [Wed Jun 21 22:54:57 BST 2017]; root of context hierarchy
2017-06-21 22:55:02.766  INFO 41640 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/api/v1/dependencies],methods=[GET],produces=[application/json]}" onto public byte[] zipkin.server.ZipkinQueryApiV1.getDependencies(long,java.lang.Long)
2017-06-21 22:55:02.769  INFO 41640 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/api/v1/services],methods=[GET]}" onto public org.springframework.http.ResponseEntity<java.util.List<java.lang.String>> zipkin.server.ZipkinQueryApiV1.getServiceNames()
2017-06-21 22:55:02.770  INFO 41640 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/api/v1/spans],methods=[GET]}" onto public org.springframework.http.ResponseEntity<java.util.List<java.lang.String>> zipkin.server.ZipkinQueryApiV1.getSpanNames(java.lang.String)
2017-06-21 22:55:02.771  INFO 41640 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/api/v1/traces],methods=[GET],produces=[application/json]}" onto public java.lang.String zipkin.server.ZipkinQueryApiV1.getTraces(java.lang.String,java.lang.String,java.lang.String,java.lang.Long,java.lang.Long,java.lang.Long,java.lang.Long,java.lang.Integer)
2017-06-21 22:55:02.771  INFO 41640 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/api/v1/trace/{traceIdHex}],methods=[GET],produces=[application/json]}" onto public java.lang.String zipkin.server.ZipkinQueryApiV1.getTrace(java.lang.String,org.springframework.web.context.request.WebRequest)
2017-06-21 22:55:02.773  INFO 41640 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/api/v1/spans],methods=[POST]}" onto public org.springframework.util.concurrent.ListenableFuture<org.springframework.http.ResponseEntity<?>> zipkin.server.ZipkinHttpCollector.uploadSpansJson(java.lang.String,byte[])
2017-06-21 22:55:02.774  INFO 41640 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/api/v1/spans],methods=[POST],consumes=[application/x-thrift]}" onto public org.springframework.util.concurrent.ListenableFuture<org.springframework.http.ResponseEntity<?>> zipkin.server.ZipkinHttpCollector.uploadSpansThrift(java.lang.String,byte[])
2017-06-21 22:55:02.781  INFO 41640 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2017-06-21 22:55:02.782  INFO 41640 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
2017-06-21 22:55:02.785  INFO 41640 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/prometheus],methods=[GET]}" onto public org.springframework.http.ResponseEntity<java.lang.String> zipkin.autoconfigure.metrics.PrometheusMetricsAutoConfiguration.prometheusMetrics()
2017-06-21 22:55:02.787  INFO 41640 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/config.json],methods=[GET],produces=[application/json]}" onto public org.springframework.http.ResponseEntity<zipkin.autoconfigure.ui.ZipkinUiProperties> zipkin.autoconfigure.ui.ZipkinUiAutoConfiguration.serveUiConfig()
2017-06-21 22:55:02.787  INFO 41640 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/index.html],methods=[GET]}" onto public org.springframework.http.ResponseEntity<org.springframework.core.io.Resource> zipkin.autoconfigure.ui.ZipkinUiAutoConfiguration.serveIndex()
2017-06-21 22:55:02.788  INFO 41640 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/ || /traces/{id} || /dependency],methods=[GET]}" onto public org.springframework.web.servlet.ModelAndView zipkin.autoconfigure.ui.ZipkinUiAutoConfiguration.forwardUiEndpoints(org.springframework.ui.ModelMap)
2017-06-21 22:55:02.845  INFO 41640 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2017-06-21 22:55:02.846  INFO 41640 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2017-06-21 22:55:03.154  INFO 41640 --- [           main] c.d.driver.core.GuavaCompatibility       : Detected Guava >= 19 in the classpath, using modern compatibility layer
2017-06-21 22:55:03.718  INFO 41640 --- [           main] com.datastax.driver.core.ClockFactory    : Using native clock to generate timestamps.
2017-06-21 22:55:04.569  INFO 41640 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/info || /info.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2017-06-21 22:55:04.570  INFO 41640 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/mappings || /mappings.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2017-06-21 22:55:04.571  INFO 41640 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/auditevents || /auditevents.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public org.springframework.http.ResponseEntity<?> org.springframework.boot.actuate.endpoint.mvc.AuditEventsMvcEndpoint.findByPrincipalAndAfterAndType(java.lang.String,java.util.Date,java.lang.String)
2017-06-21 22:55:04.575  INFO 41640 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/env/{name:.*}],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EnvironmentMvcEndpoint.value(java.lang.String)
2017-06-21 22:55:04.575  INFO 41640 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/env || /env.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2017-06-21 22:55:04.576  INFO 41640 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/health || /health.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.HealthMvcEndpoint.invoke(javax.servlet.http.HttpServletRequest,java.security.Principal)
2017-06-21 22:55:04.577  INFO 41640 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/heapdump || /heapdump.json],methods=[GET],produces=[application/octet-stream]}" onto public void org.springframework.boot.actuate.endpoint.mvc.HeapdumpMvcEndpoint.invoke(boolean,javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) throws java.io.IOException,javax.servlet.ServletException
2017-06-21 22:55:04.578  INFO 41640 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/trace || /trace.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2017-06-21 22:55:04.578  INFO 41640 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/beans || /beans.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2017-06-21 22:55:04.580  INFO 41640 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/loggers/{name:.*}],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.LoggersMvcEndpoint.get(java.lang.String)
2017-06-21 22:55:04.581  INFO 41640 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/loggers/{name:.*}],methods=[POST],consumes=[application/vnd.spring-boot.actuator.v1+json || application/json],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.LoggersMvcEndpoint.set(java.lang.String,java.util.Map<java.lang.String, java.lang.String>)
2017-06-21 22:55:04.581  INFO 41640 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/loggers || /loggers.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2017-06-21 22:55:04.582  INFO 41640 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/dump || /dump.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2017-06-21 22:55:04.582  INFO 41640 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/autoconfig || /autoconfig.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2017-06-21 22:55:04.583  INFO 41640 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/configprops || /configprops.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2017-06-21 22:55:04.584  INFO 41640 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/metrics/{name:.*}],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.MetricsMvcEndpoint.value(java.lang.String)
2017-06-21 22:55:04.584  INFO 41640 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/metrics || /metrics.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2017-06-21 22:55:04.787  INFO 41640 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Registering beans for JMX exposure on startup
2017-06-21 22:55:04.800  INFO 41640 --- [           main] o.s.c.support.DefaultLifecycleProcessor  : Starting beans in phase 0
2017-06-21 22:55:05.053  INFO 41640 --- [           main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 9411 (http)
2017-06-21 22:55:05.063  INFO 41640 --- [           main] zipkin.server.ZipkinServer               : Started ZipkinServer in 8.62 seconds (JVM running for 9.731)
codefromthecrypt commented 7 years ago

I bumped latest versions on master and was able to get things working (not sure if they wouldn't have worked prior to version bump, but anyway :))

$ ./mvnw clean install
$ cd /tmp
$ mkdir eventhub
$ (cd eventhub && jar -xvf /Users/acole/oss/zipkin-azure/autoconfigure/collector-eventhub/target/zipkin-autoconfigure-collector-eventhub-0.1.7-SNAPSHOT-module.jar )
$ wget -O zipkin.jar 'https://search.maven.org/remote_content?g=io.zipkin.java&a=zipkin-server&v=LATEST&c=exec'
$ EVENTHUB_CONNECTION_STRING=foo EVENTHUB_STORAGE_CONNECTION_STRING=bar java -Dloader.path=eventhub -Dspring.profiles.active=eventhub -cp zipkin.jar org.springframework.boot.loader.PropertiesLauncher

Then, it crashed trying to parse my dodgy connection string :)

give a try? if works, push a release tag (like release-0.1.7)?

aliostad commented 7 years ago

Thanks a lot. Will try at lunch.

aliostad commented 7 years ago

@adriancole I see! The variables defined in the same line work but I had defined them not in the execution line. I do not have deep enough knowledge of how these parameters work but according to docs they are defined in separate lines:

EVENTHUB_CONNECTION_STRING=Endpoint=sb://< EventHub Address>;SharedAccessKeyName=<name>;SharedAccessKey=<key>
EVENTHUB_STORAGE_CONNECTION_STRING=<connection string>;DefaultEndpointsProtocol=https;AccountName=<yourAccountName>;AccountKey=<yourAccountKey>
java -Dloader.path=eventhub -Dspring.profiles.active=eventhub -cp zipkin.jar org.springframework.boot.loader.PropertiesLauncher

Which do not work. Can you please check if they are defined as env var, would they work? I tried and did not work for me.

update

I guess we need to lines with the backslash. I can update document.

codefromthecrypt commented 7 years ago

Sure. I can try a sanity check

codefromthecrypt commented 7 years ago

ahh.. yeah if defining on separate lines, there are two ways...

use trailing \ to make believe they are on one line

ex.

$ EVENTHUB_CONNECTION_STRING=foo \

EVENTHUB_STORAGE_CONNECTION_STRING=bar \ java -Dloader.path=eventhub -Dspring.profiles.active=eventhub -cp zipkin.jar org.springframework.boot.loader.PropertiesLauncher

or export the variables

$ export EVENTHUB_CONNECTION_STRING=foo $ export EVENTHUB_STORAGE_CONNECTION_STRING=bar $ java -Dloader.path=eventhub -Dspring.profiles.active=eventhub -cp zipkin.jar org.springframework.boot.loader.PropertiesLauncher

aliostad commented 7 years ago

Thanks. Yes, but would that not set it globally? I am still puzzled that why java being launched from the same terminal that echo $EVENTHUB_CONNECTION_STRING works, cannot see the values.

OK, I will update the docs.

aliostad commented 7 years ago

By the way, I now understand it better https://stackoverflow.com/questions/44701221/defining-shell-variable-in-the-same-line-gets-passed-to-java-process-but-not-o/44701283#44701283

codefromthecrypt commented 7 years ago

thanks for circling back!