Skip to content
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

Error when running Distributed Tracing with OpenTelemetry and Jaeger example #3

Open
ahavriluk opened this issue Jun 10, 2023 · 10 comments

Comments

@ahavriluk
Copy link

I have cloned and ran Distributed Tracing with OpenTelemetry and Jaeger example and got this error:
Failed to export spans. The request could not be executed. Full error message: unexpected end of stream on http://localhost:4318/

Full log:

2023-06-10T08:36:28.707-07:00  INFO [Service-2,,] 84480 --- [           main] c.a.p.DistributedTracingApplication      : Starting DistributedTracingApplication using Java 17.0.6 with PID 84480 (/Users/ohavrylyuk/repos/distributed-tracing-with-spring-boot/distributed-tracing-spring-boot-opentelemetry-jaeger/target/classes started by ohavrylyuk in /Users/ohavrylyuk/repos/distributed-tracing-with-spring-boot/distributed-tracing-spring-boot-opentelemetry-jaeger)
2023-06-10T08:36:28.711-07:00  INFO [Service-2,,] 84480 --- [           main] c.a.p.DistributedTracingApplication      : No active profile set, falling back to 1 default profile: "default"
2023-06-10T08:36:30.197-07:00  INFO [Service-2,,] 84480 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8090 (http)
2023-06-10T08:36:30.207-07:00  INFO [Service-2,,] 84480 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2023-06-10T08:36:30.207-07:00  INFO [Service-2,,] 84480 --- [           main] o.apache.catalina.core.StandardEngine    : Starting Servlet engine: [Apache Tomcat/10.1.7]
2023-06-10T08:36:30.300-07:00  INFO [Service-2,,] 84480 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2023-06-10T08:36:30.300-07:00  INFO [Service-2,,] 84480 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1530 ms
2023-06-10T08:36:31.359-07:00  INFO [Service-2,,] 84480 --- [           main] o.s.b.a.e.web.EndpointLinksResolver      : Exposing 1 endpoint(s) beneath base path '/actuator'
2023-06-10T08:36:31.451-07:00  INFO [Service-2,,] 84480 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8090 (http) with context path ''
2023-06-10T08:36:31.471-07:00  INFO [Service-2,,] 84480 --- [           main] c.a.p.DistributedTracingApplication      : Started DistributedTracingApplication in 3.313 seconds (process running for 4.197)
2023-06-10T08:36:31.881-07:00  INFO [Service-2,,] 84480 --- [)-192.168.1.155] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
2023-06-10T08:36:31.881-07:00  INFO [Service-2,,] 84480 --- [)-192.168.1.155] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
2023-06-10T08:36:31.883-07:00  INFO [Service-2,,] 84480 --- [)-192.168.1.155] o.s.web.servlet.DispatcherServlet        : Completed initialization in 1 ms
2023-06-10T08:37:55.844-07:00  INFO [Service-2,f9949f729601e957f3263fa1ccd4562e,16c3dfa89dd3541a] 84480 --- [nio-8090-exec-1] com.amrut.prabhu.Controller              : Incoming request at Service-2 at /path2
2023-06-10T08:38:00.780-07:00 ERROR [Service-2,,] 84480 --- [alhost:4318/...] i.o.e.internal.okhttp.OkHttpExporter     : Failed to export spans. The request could not be executed. Full error message: unexpected end of stream on http://localhost:4318/...

Do you know what is going on?

@amrutprabhu
Copy link
Owner

I think you are not running the docker-compose file. The application is not able to communicate with Jaeger.

@ahavriluk
Copy link
Author

ahavriluk commented Jun 11, 2023

I do run docker-compose

@amrutprabhu
Copy link
Owner

If you are running the docker compose file, can you try accessing the URL http://localhost:16686/. It should open the Jaeger UI.

@amrutprabhu
Copy link
Owner

@ahavriluk
Copy link
Author

I did read your article that’s how I have found your repo. I can open Jaeger UI. Still I get that error.

@amrutprabhu
Copy link
Owner

I quickly checked. Cloned the repo again and ran it with docker compose and it all works fine.

Not sure why it's not communicating with the Jaeger in your case.

image
this is the image Id of the Jaeger docker image.
image

The only time I could reproduce the error you are getting is when the docker image was not running.
can you check the port mappings?

Run docker ps

image

You should have what is highlighted in red.

@ahavriluk
Copy link
Author

ahavriluk commented Jun 11, 2023

CONTAINER ID   IMAGE                             COMMAND                  CREATED          STATUS          PORTS                                                                                                       NAMES
79ca859659a6   jaegertracing/all-in-one:latest   "/go/bin/all-in-one-…"   24 seconds ago   Up 20 seconds   5775/udp, 5778/tcp, 14250/tcp, 0.0.0.0:4318->4318/tcp, 0.0.0.0:16686->16686/tcp, 6831-6832/udp, 14268/tcp   distributed-tracing-spring-boot-opentelemetry-jaeger-jaeger-1

Docker image:
jaegertracing/all-in-one 1.12 4fc511ccaf35

@amrutprabhu
Copy link
Owner

Is the Jaeger image 1.12 ? .. like what I see in the comments?

You will have to use the latest version of jaegertracing/all-in-one
Because the opentelemetry support is after 1.2x version. The latest version currently going on is 1.46.

@ahavriluk
Copy link
Author

Thank you! That’s valuable information. It must be the older image I had from the past. Docker compose didn’t pickup the latest from the net.

@amrutprabhu
Copy link
Owner

Lovely. Glad it solved it.

Maybe I'll change the docker pull policy to always.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants