Hi Team, I am trying to install query-service loca...
# contributing
s
Hi Team, I am trying to install query-service locally. There is a section that explains how to setup query-service locally in order to start contributing to the repo https://github.com/SigNoz/signoz/tree/main/pkg/query-service I get the following error when I run the query-service binary locally
Copy code
2022-07-03T16:08:21.434+0530	ERROR	clickhouseReader/reader.go:108error connecting to primary db: dial tcp 127.0.0.1:9001: connect: connection refused
Probably this requires clickhouse up and running, so I tried to setup clickhouse first, there I change the clickhouse-setup/docker-compose.yaml as follows:
Copy code
services:
  clickhouse:
    image: clickhouse/clickhouse-server:22.4.5-alpine
    expose:
      - "9000"
    ports:
      - "9001:9000"
    # - "8123:8123"
    tty: true
    volumes:
      - ./clickhouse-config.xml:/etc/clickhouse-server/config.xml
      - ./clickhouse-users.xml:/etc/clickhouse-server/users.xml
      # - ./clickhouse-storage.xml:/etc/clickhouse-server/config.d/storage.xml
      - ./data/clickhouse/:/var/lib/clickhouse/
    restart: on-failure
    logging:
      options:
        max-size: 50m
        max-file: "3"
    healthcheck:
      # "clickhouse", "client", "-u ${CLICKHOUSE_USER}", "--password ${CLICKHOUSE_PASSWORD}", "-q 'SELECT 1'"
      test: ["CMD", "wget", "--spider", "-q", "localhost:8123/ping"]
      interval: 30s
      timeout: 5s
      retries: 3

  alertmanager:
    image: signoz/alertmanager:0.23.0-0.1
    volumes:
      - ./data/alertmanager:/data
    depends_on:
      query-service:
        condition: service_healthy
    restart: on-failure
    command:
      - --queryService.url=<http://query-service:8085>
      - --storage.path=/data

# Notes for Maintainers/Contributors who will change Line Numbers of Frontend & Query-Section. Please Update Line Numbers in `./scripts/commentLinesForSetup.sh` & `./CONTRIBUTING.md`

#  query-service:
#    image: signoz/query-service:0.9.1
#    container_name: query-service
#    command: ["-config=/root/config/prometheus.yml"]
    # ports:
    #   - "6060:6060"     # pprof port
    #   - "8080:8080"     # query-service port
#    volumes:
#      - ./prometheus.yml:/root/config/prometheus.yml
#      - ../dashboards:/root/config/dashboards
#      - ./data/signoz/:/var/lib/signoz/
#    environment:
#      - ClickHouseUrl=<tcp://clickhouse:9000/?database=signoz_traces>
#      - STORAGE=clickhouse
#      - GODEBUG=netdns=go
#      - TELEMETRY_ENABLED=true
#      - DEPLOYMENT_TYPE=docker-standalone-amd
#    restart: on-failure
#    healthcheck:
#      test: ["CMD", "wget", "--spider", "-q", "localhost:8080/api/v1/version"]
#      interval: 30s
#      timeout: 5s
#      retries: 3
#    depends_on:
#      clickhouse:
#        condition: service_healthy

#  frontend:
#    image: signoz/frontend:0.9.1
#    container_name: frontend
#    restart: on-failure
#    depends_on:
#      - alertmanager
#      - query-service
#    ports:
#      - "3301:3301"
#    volumes:
#      - ../common/nginx-config.conf:/etc/nginx/conf.d/default.conf
and then I run
Copy code
sudo make run-x86
I get the following error saying query-service is a pre-requisite for alertmanager.
Copy code
ERROR: Service 'alertmanager' depends on service 'query-service' which is undefined.
make: *** [Makefile:83: run-x86] Error 1
Can anyone please confirm if I am following the correct setup page? If so what am I doing wrong?
p
Hey @Shiwam Jaiswal! From
v0.8
onwards,
query-service
is a dependency for
alertmanager
You can comment out the
alertmanager
service from docker-compose YAML if your contributions do not require alerts.
If it does, you can remove the
depends_on
section of alertmanager, and replace
query-service:8085
to host-machine address i.e.
172.17.0.1:8085
for Linux and
host.docker.internal:8085
for MacOS.
s
Hi @Prashant Shahi Thanks for the reply. Currently I am just studying the code-base to understand what's going on there, so wanted to run the query-service locally. Sure will try out your suggestions. If it works then it might be a good start for me to create an issue for this and add these suggestions to contributions.md , so other beginner contributors would not face this issue?
p
Yeah, that would be very helpful.
❤️ 1