mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-15 03:25:53 +08:00
docs: added documentation for query-service local setup (#1426)
* docs: added documentation for query-service local setup * fix: updated clickhouse setup link * Use Env Var for the alertmanager endpoint
This commit is contained in:
parent
ff9c41464b
commit
a771c3b9a6
@ -215,7 +215,7 @@ Please ping us in the [`#contributing`](https://signoz-community.slack.com/archi
|
|||||||
|
|
||||||
# 4. Contribute to Backend (Query-Service) 🌑
|
# 4. Contribute to Backend (Query-Service) 🌑
|
||||||
|
|
||||||
**Need to Update:** [**https://github.com/SigNoz/signoz/tree/develop/pkg/query-service**](https://github.com/SigNoz/signoz/tree/develop/pkg/query-service)
|
[**https://github.com/SigNoz/signoz/tree/develop/pkg/query-service**](https://github.com/SigNoz/signoz/tree/develop/pkg/query-service)
|
||||||
|
|
||||||
## 4.1 To run ClickHouse setup (recommended for local development)
|
## 4.1 To run ClickHouse setup (recommended for local development)
|
||||||
|
|
||||||
|
@ -6,8 +6,37 @@ Query service is the interface between frontend and databases. It is written in
|
|||||||
- parse response from databases and handle error if any
|
- parse response from databases and handle error if any
|
||||||
- clickhouse response in the format accepted by Frontend
|
- clickhouse response in the format accepted by Frontend
|
||||||
|
|
||||||
|
# Complete the clickhouse setup locally.
|
||||||
|
https://github.com/SigNoz/signoz/blob/main/CONTRIBUTING.md#to-run-clickhouse-setup-recommended-for-local-development
|
||||||
|
|
||||||
|
- Comment out the query-service and the frontend section in `signoz/deploy/docker/clickhouse-setup/docker-compose.yaml`
|
||||||
|
- Change the alertmanager section in `signoz/deploy/docker/clickhouse-setup/docker-compose.yaml` as follows:
|
||||||
|
```console
|
||||||
|
alertmanager:
|
||||||
|
image: signoz/alertmanager:0.23.0-0.1
|
||||||
|
volumes:
|
||||||
|
- ./data/alertmanager:/data
|
||||||
|
expose:
|
||||||
|
- "9093"
|
||||||
|
ports:
|
||||||
|
- "8080:9093"
|
||||||
|
# depends_on:
|
||||||
|
# query-service:
|
||||||
|
# condition: service_healthy
|
||||||
|
restart: on-failure
|
||||||
|
command:
|
||||||
|
- --queryService.url=http://172.17.0.1:8085
|
||||||
|
- --storage.path=/data
|
||||||
|
```
|
||||||
|
- Run the following:
|
||||||
|
```console
|
||||||
|
cd signoz/
|
||||||
|
If you are using x86_64 processors (All Intel/AMD processors) run sudo make run-x86
|
||||||
|
If you are on arm64 processors (Apple M1 Macs) run sudo make run-arm
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Backend Configuration
|
||||||
|
|
||||||
#### Configuration
|
|
||||||
- Open ./constants/constants.go
|
- Open ./constants/constants.go
|
||||||
- Replace ```const RELATIONAL_DATASOURCE_PATH = "/var/lib/signoz/signoz.db"``` \
|
- Replace ```const RELATIONAL_DATASOURCE_PATH = "/var/lib/signoz/signoz.db"``` \
|
||||||
with ```const RELATIONAL_DATASOURCE_PATH = "./signoz.db".```
|
with ```const RELATIONAL_DATASOURCE_PATH = "./signoz.db".```
|
||||||
@ -15,8 +44,9 @@ Query service is the interface between frontend and databases. It is written in
|
|||||||
- Query Service needs below `env` variables to run:
|
- Query Service needs below `env` variables to run:
|
||||||
|
|
||||||
```
|
```
|
||||||
ClickHouseUrl=tcp://localhost:9001
|
export ClickHouseUrl=tcp://localhost:9001
|
||||||
STORAGE=clickhouse
|
export STORAGE=clickhouse
|
||||||
|
export ALERTMANAGER_API_PREFIX=http://localhost:9093/api/
|
||||||
```
|
```
|
||||||
|
|
||||||
<!-- 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` -->
|
||||||
@ -28,5 +58,24 @@ go build -o build/query-service main.go
|
|||||||
ClickHouseUrl=tcp://localhost:9001 STORAGE=clickhouse build/query-service
|
ClickHouseUrl=tcp://localhost:9001 STORAGE=clickhouse build/query-service
|
||||||
```
|
```
|
||||||
|
|
||||||
|
# Frontend Configuration for local query-service.
|
||||||
|
|
||||||
|
- Set the following environment variables
|
||||||
|
```console
|
||||||
|
export FRONTEND_API_ENDPOINT=http://localhost:8080
|
||||||
|
```
|
||||||
|
|
||||||
|
- Run the following
|
||||||
|
```console
|
||||||
|
cd signoz\frontend\
|
||||||
|
yarn install
|
||||||
|
yarn dev
|
||||||
|
```
|
||||||
|
|
||||||
|
## Note:
|
||||||
|
If you use go version 1.18 for development and contributions, then please checkout the following issue.
|
||||||
|
https://github.com/SigNoz/signoz/issues/1371
|
||||||
|
|
||||||
|
|
||||||
#### Docker Images
|
#### Docker Images
|
||||||
The docker images of query-service is available at https://hub.docker.com/r/signoz/query-service
|
The docker images of query-service is available at https://hub.docker.com/r/signoz/query-service
|
||||||
|
Loading…
x
Reference in New Issue
Block a user