33 lines
1.2 KiB
Markdown
Raw Normal View History

2021-01-08 00:40:19 +05:30
# Query Service
2022-07-06 11:45:42 +05:30
Query service is the interface between frontend and databases. It is written in **Golang**. It will have modules for all supported databases. Query service is responsible to:
2021-01-08 00:40:19 +05:30
- parse the request from Frontend
- create relevant Clickhouse queries (and all other supported database queries)
2021-01-08 00:40:19 +05:30
- parse response from databases and handle error if any
- clickhouse response in the format accepted by Frontend
2021-01-08 00:40:19 +05:30
#### Configuration
- 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:
2021-01-08 00:40:19 +05:30
```
ClickHouseUrl=tcp://localhost:9001
2022-02-24 17:27:22 +05:30
STORAGE=clickhouse
2021-01-08 00:40:19 +05:30
```
<!-- The above values are the default ones used by SigNoz and are kept at `deploy/kubernetes/platform/signoz-charts/query-service/values.yaml` -->
2021-01-08 00:40:19 +05:30
#### Build and Run locally
```console
cd pkg/query-service
go build -o build/query-service main.go
2022-02-24 17:27:22 +05:30
ClickHouseUrl=tcp://localhost:9001 STORAGE=clickhouse build/query-service
2021-01-08 00:40:19 +05:30
```
#### Docker Images
2022-07-06 11:45:42 +05:30
The docker images of query-service is available at https://hub.docker.com/r/signoz/query-service