https://signoz.io logo
#support
Title
# support
f

fahad yamin

07/04/2023, 5:43 PM
Hi guys, when I run my fastapi application via docker run command, the signoz is able to show the app and opentelemetry metrics but when I run it via docker-compose the doesn't appear there. can anyone help me in this? Docker run command:
Copy code
docker run -d --name test-1 --net clickhouse-setup_default --env-file env_files/.env -p 3000:3000 test-image
Docker compose file:
Copy code
version: "3"

services:
  web:
    restart: unless-stopped
    build: .
    command: bash -c "OTEL_RESOURCE_ATTRIBUTES=service.name=testapp OTEL_EXPORTER_OTLP_ENDPOINT=<http://clickhouse-setup_otel-collector_1:4317> opentelemetry-instrument uvicorn app.main:app --host 0.0.0.0 --port 3000 --reload"

    volumes:
      - .:/code
    ports:
      - "3000:3000"
    env_file:
      - ./env_files/.env
    networks:
      - clickhouse-setup_default
networks:
    clickhouse-setup_default:
      external: true
s

Srikanth Chekuri

07/05/2023, 1:49 AM
Copy code
OTEL_EXPORTER_OTLP_ENDPOINT=<http://clickhouse-setup_otel-collector_1:4317>
This is probably incorrect. Please make sure n/w stuff is correct.
f

fahad yamin

07/05/2023, 12:23 PM
Acc to this documentation: https://signoz.io/blog/opentelemetry-fastapi/ if we run signoz in via docker-compose then
Copy code
OTEL_EXPORTER_OTLP_ENDPOINT=<http://clickhouse-setup_otel-collector_1:4317>
s

Srikanth Chekuri

07/05/2023, 1:19 PM
Can you remove --reload and check?
f

fahad yamin

07/06/2023, 8:10 AM
thank you @Srikanth Chekuri, yes that was the issue.
3 Views