Skip to content

Commit

Permalink
Fix: update documentation for query-service.
Browse files Browse the repository at this point in the history
  • Loading branch information
axaysagathiya committed Feb 24, 2022
1 parent 5aa46c7 commit eb28459
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 deletions.
11 changes: 9 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
23 changes: 13 additions & 10 deletions pkg/query-service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

<!-- 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
Expand Down

0 comments on commit eb28459

Please sign in to comment.