mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-02 04:50:38 +08:00

* fix: inital changes for telemetry store * fix: add tests and use proper config for conn * fix: add telemetry store test * fix: add backward compatibility for old variables and update example conf * fix: move wrapper to telemetry store * fix: no need to pass query for settings * fix: remove redundant config for ch conn * fix: use clickhouse dsn instead * fix: update example config * fix: update backward compatibility code * fix: use hooks in telemetrystore * fix: address minor comments --------- Co-authored-by: Vibhu Pandey <vibhupandey28@gmail.com>
43 lines
987 B
Go
43 lines
987 B
Go
package db
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/ClickHouse/clickhouse-go/v2"
|
|
|
|
"github.com/jmoiron/sqlx"
|
|
|
|
"go.signoz.io/signoz/pkg/cache"
|
|
basechr "go.signoz.io/signoz/pkg/query-service/app/clickhouseReader"
|
|
"go.signoz.io/signoz/pkg/query-service/interfaces"
|
|
)
|
|
|
|
type ClickhouseReader struct {
|
|
conn clickhouse.Conn
|
|
appdb *sqlx.DB
|
|
*basechr.ClickHouseReader
|
|
}
|
|
|
|
func NewDataConnector(
|
|
localDB *sqlx.DB,
|
|
ch clickhouse.Conn,
|
|
promConfigPath string,
|
|
lm interfaces.FeatureLookup,
|
|
cluster string,
|
|
useLogsNewSchema bool,
|
|
useTraceNewSchema bool,
|
|
fluxIntervalForTraceDetail time.Duration,
|
|
cache cache.Cache,
|
|
) *ClickhouseReader {
|
|
chReader := basechr.NewReader(localDB, ch, promConfigPath, lm, cluster, useLogsNewSchema, useTraceNewSchema, fluxIntervalForTraceDetail, cache)
|
|
return &ClickhouseReader{
|
|
conn: ch,
|
|
appdb: localDB,
|
|
ClickHouseReader: chReader,
|
|
}
|
|
}
|
|
|
|
func (r *ClickhouseReader) Start(readerReady chan bool) {
|
|
r.ClickHouseReader.Start(readerReady)
|
|
}
|