From eb28459847034dde84074021901e37c163e43466 Mon Sep 17 00:00:00 2001 From: axaysagathiya Date: Thu, 24 Feb 2022 15:10:52 +0530 Subject: [PATCH 1/2] Fix: update documentation for query-service. fixes #740 --- CONTRIBUTING.md | 11 +++++++++-- pkg/query-service/README.md | 23 +++++++++++++---------- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 412afd5eab..7b63015435 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -48,8 +48,15 @@ Need to update [https://github.com/SigNoz/signoz/tree/main/pkg/query-service](ht - git clone https://github.com/SigNoz/signoz.git - run `sudo make dev-setup` to configure local setup to run query-service -- comment out frontend service section at `docker/clickhouse-setup/docker-compose.yaml#L59` -- comment out query-service section at `docker/clickhouse-setup/docker-compose.yaml#L38` +- comment out frontend service section at `docker/clickhouse-setup/docker-compose.yaml#L45` +- comment out query-service section at `docker/clickhouse-setup/docker-compose.yaml#L28` +- add below configuration to clickhouse section at `docker/clickhouse-setup/docker-compose.yaml` +``` + expose: + - 9000 + ports: + - 9001:9000 +``` - Install signoz locally without the frontend and query-service - If you are using x86_64 processors (All Intel/AMD processors) run `sudo make run-x86` - If you are on arm64 processors (Apple M1 Macbooks) run `sudo make run-arm` diff --git a/pkg/query-service/README.md b/pkg/query-service/README.md index c4c96a9757..43921f52a1 100644 --- a/pkg/query-service/README.md +++ b/pkg/query-service/README.md @@ -2,27 +2,30 @@ Query service is the interface between forntend and databases. It is written in **Golang**. It will have modules for all supported databases. Query service is responsible to: - parse the request from Frontend -- create relevant Druid queries (and all other supported database queries) +- create relevant Clickhouse queries (and all other supported database queries) - parse response from databases and handle error if any -- build response in the format accepted by Frontend +- clickhouse response in the format accepted by Frontend -#### Druid Queries -Internally we use both native and sql queries to Druid. - #### Configuration -Query Service needs below `env` variables to run: +- Open ./constants/constants.go + - Replace ```const RELATIONAL_DATASOURCE_PATH = "/var/lib/signoz/signoz.db"``` \ + with ```const RELATIONAL_DATASOURCE_PATH = "./signoz.db".``` + +- Query Service needs below `env` variables to run: + ``` - DruidClientUrl: http://signoz-druid-router:8888 - DruidDatasource: flattened_spans + ClickHouseUrl=tcp://localhost:9001 + TORAGE=clickhouse ``` -The above values are the default ones used by SigNoz and are kept at `deploy/kubernetes/platform/signoz-charts/query-service/values.yaml` + + #### Build and Run locally ```console cd pkg/query-service go build -o build/query-service main.go -DruidClientUrl=xxxx DruidDatasource=flattened_spans build/query-service +ClickHouseUrl=tcp://localhost:9001 TORAGE=clickhouse build/query-service ``` #### Docker Images From 729ea586a831ec70694ee72f6e2ebcc5fc98235d Mon Sep 17 00:00:00 2001 From: axaysagathiya Date: Thu, 24 Feb 2022 17:27:22 +0530 Subject: [PATCH 2/2] fix the spelling mistakes. --- pkg/query-service/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/query-service/README.md b/pkg/query-service/README.md index 43921f52a1..72b69afc9a 100644 --- a/pkg/query-service/README.md +++ b/pkg/query-service/README.md @@ -16,7 +16,7 @@ Query service is the interface between forntend and databases. It is written in ``` ClickHouseUrl=tcp://localhost:9001 - TORAGE=clickhouse + STORAGE=clickhouse ``` @@ -25,7 +25,7 @@ Query service is the interface between forntend and databases. It is written in ```console cd pkg/query-service go build -o build/query-service main.go -ClickHouseUrl=tcp://localhost:9001 TORAGE=clickhouse build/query-service +ClickHouseUrl=tcp://localhost:9001 STORAGE=clickhouse build/query-service ``` #### Docker Images