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

feat: zipkin support and option to enable it #127

Merged
merged 4 commits into from
Aug 11, 2024
Merged

Conversation

ymtdzzz
Copy link
Owner

@ymtdzzz ymtdzzz commented Aug 7, 2024

related: #125

Adding zipkin receiver to be able to receive zipkin traces.

image

How to test

Build otel-tui as a docker image

$ docker build . -t otel-tui:test

Check out the example repository: https://github.com/openzipkin/brave-example

Modify docker-compose.yml in brave-example directory to use the otel-tui:test container instead of zipkin

# permit depends_on/condition: service_healthy
version: "2.4"

# BRAVE_EXAMPLE choices are listed here https://github.com/openzipkin/brave-example#example-projects

services:
  # Generate traffic by hitting http://localhost:8081
  frontend:
    container_name: frontend
    image: ghcr.io/openzipkin/brave-example:${BRAVE_EXAMPLE:-armeria}
    entrypoint: start-frontend
    ports:
      - 8081:8081
    depends_on:
      backend:
        condition: service_healthy
    #  zipkin:
    #    condition: service_healthy
  # Serves the /api endpoint the frontend uses
  backend:
    container_name: backend
    image: ghcr.io/openzipkin/brave-example:${BRAVE_EXAMPLE:-armeria}
    entrypoint: start-backend
    # depends_on:
    #   zipkin:
    #     condition: service_healthy
  # View traces at http://127.0.0.1:9411/zipkin
  zipkin:
    #image: ghcr.io/openzipkin/zipkin-slim
    image: otel-tui:test
    container_name: zipkin
    ports:
      - 9411:9411
    stdin_open: true
    tty: true
    entrypoint: ["/otel-tui", "--enable-zipkin"]

Run this example

docker compose up -d

In another terminal session, attach to otel-tui container (note that the container name is still zipkin)

$ docker compose attach zipkin

Access to the example endpoint: http://localhost:8081/

Check that the traces send to otel-tui and processed correctly!

@ymtdzzz ymtdzzz marked this pull request as ready for review August 7, 2024 14:56
@ymtdzzz ymtdzzz mentioned this pull request Aug 7, 2024
@codefromthecrypt
Copy link

trying this now!

@codefromthecrypt
Copy link

Screenshot 2024-08-08 at 10 55 14 AM

Works! I just needed to hack the docker-compose because there is a ready condition

--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -26,7 +26,11 @@ services:
         condition: service_healthy
   # View traces at http://127.0.0.1:9411/zipkin
   zipkin:
-    image: ghcr.io/openzipkin/zipkin-slim
+    image: otel-tui:test
     container_name: zipkin
     ports:
       - 9411:9411
+    stdin_open: true
+    tty: true
+    healthcheck:
+      test: ["CMD", "/main", "-v"]

@codefromthecrypt
Copy link

ps this is a trace from armeria, so copying in some folks for a smile @ikhoon @injae-kim @minwoox @trustin

@codefromthecrypt
Copy link

zipkin folks should understand that this is the result of translation to otel. That's why the data looks different.

While armeria I think can export directly to otel now, this approach is helpful as there are a lot of things that can only report zipkin format and maybe won't change for years or ever. So all these things can now enjoy terminal based UI.

@ymtdzzz
Copy link
Owner Author

ymtdzzz commented Aug 8, 2024

Thanks @codefromthecrypt !
I'm thinking of merging this PR after making zipkin receiver optional (such as --zipkin) and updating README.

@ymtdzzz ymtdzzz changed the title feat: zipkin support feat: zipkin support and option to enable it Aug 11, 2024
@ymtdzzz ymtdzzz merged commit 0e3c257 into main Aug 11, 2024
4 checks passed
@ymtdzzz ymtdzzz deleted the feature/zipkin-support branch August 11, 2024 06:52
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

Successfully merging this pull request may close these issues.

2 participants