0

I have an application that consists of several microservices that I run in Docker. I'm currently learning observation and have already managed to connect logs with Loki, metrics with Prometheus and traces with Tempo. Logs and metrics works fine, but when I run the app, I get the following error from the services that are supposed to send their data:

Dropped 1 spans due to ResourceAccessException(I/O error on POST request for
"http://localhost:9411/api/v2/spans": Connect to http://localhost:9411
[localhost/127.0.0.1] failed: Connection refused)

As far as I understand, the problem is that the services cannot connect to the Tempo zipkin distributor service through http://localhost:9411 because it is located in container http://tempo:9411 (tempo - container name).

Here is the configuration:

tempo.yml

server:
  http_listen_port: 3110

distributor:
  receivers:
    zipkin:

storage:
  trace:
    backend: local
    local:
      path: /tmp/tempo/blocks

compose.yml

// Other services...

  tempo:
    container_name: tempo
    image: grafana/tempo:2.2.2
    command: [ "-config.file=/etc/tempo.yaml" ]
    volumes:
      - ./docker/tempo/tempo.yml:/etc/tempo.yaml:ro
      - ./docker/tempo/tempo-data:/tmp/tempo

    ports:
      - "3110:3100"  # Tempo
      - "9411:9411" # zipkin
    networks:
      - application-network

And my question is how can i change my distributor's base url from http://localhost:9411 to http://tempo:9411?

I looked for the answer on various sites and in the documentation but nothing worked.

2
  • Is this the whole compose.yml file ? It seems to be an excerpt. If so, could you please copy the whole content ? Commented Jan 5, 2024 at 7:37
  • No, it's not, i pasted only needed information from compose file. But i have already found the answer. This did not solve my problem, but it answers the question, so I will write below what needs to be done for this. Thank you for your interest! Commented Jan 6, 2024 at 10:10

1 Answer 1

1

If someone is also facing this problem, it is solved very easily. All you have to do is to add parameter endpoint and provide needed url:

distributor:
  receivers:
    zipkin:
      endpoint: http://tempo:9411/api/v2/spans
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.