signoz/pkg/query-service
Ankit Nayan be5d1f0090
feat: adding disable and anonymous functionality to telemetry collected (#637)
* chore: changed lib

* chore: changed lib

* chore: changed lib

* chore: changed lib

* chore: changes in params

* chore: changes in params

* chore: moving telemetry to a separate package

* feat: enabling telemetry via env var

* chore: removing posthog api_key

* feat: send heartbeat every 6hr

* feat: enabled version in application

* feat: added getter and setter apis and struct for user preferences

* feat: added version to properties to event

* feat: added apis to set and get user preferences and get version

* chore: refactored get and set userPreferences apis to dao pattern

* chore: added checks for telemetry enabled and anonymous during initialization

* chore: changed anonymous user functionality

* chore: sanitization

* chore: added uuid for userPreferences to send when user is anonymous
2022-01-26 21:40:44 +05:30
..
2021-01-03 18:15:44 +05:30
2021-01-03 18:15:44 +05:30
2021-01-03 18:15:44 +05:30
2021-09-02 13:18:47 +05:30
2021-09-02 13:18:47 +05:30
2022-01-21 00:31:58 +05:30
2021-01-08 00:40:19 +05:30

Query Service

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)
  • parse response from databases and handle error if any
  • build 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:

    DruidClientUrl: http://signoz-druid-router:8888
    DruidDatasource: flattened_spans

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

cd pkg/query-service
go build -o build/query-service main.go
DruidClientUrl=xxxx DruidDatasource=flattened_spans build/query-service

Docker Images

The docker images of query-service is available at https://hub.docker.com/r/signoz/query-service