mirror of
https://github.com/SigNoz/signoz.git
synced 2025-12-17 15:36:48 +00:00
Deprecate all flags - Use querier.config.fluxInterval in lieu of passing `--flux-interval` and `--flux-interval-for-trace-detail` - Remove `--gateway-url` - Use telemetrystore.clickhouse.cluster in lieu of passing `--cluster` or `--cluster-name` - Add an `unparam` check in the linter. Updated some functions across the querier codebase to be compatible with this linter. - Remove prometheus config from docker builds.
34 lines
796 B
Go
34 lines
796 B
Go
package telemetrystore
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/ClickHouse/clickhouse-go/v2"
|
|
)
|
|
|
|
type TelemetryStore interface {
|
|
// ClickhouseDB returns the clickhouse database connection.
|
|
ClickhouseDB() clickhouse.Conn
|
|
|
|
// Cluster returns the cluster name.
|
|
Cluster() string
|
|
}
|
|
|
|
type TelemetryStoreHook interface {
|
|
BeforeQuery(ctx context.Context, event *QueryEvent) context.Context
|
|
AfterQuery(ctx context.Context, event *QueryEvent)
|
|
}
|
|
|
|
func WrapBeforeQuery(hooks []TelemetryStoreHook, ctx context.Context, event *QueryEvent) context.Context {
|
|
for _, hook := range hooks {
|
|
ctx = hook.BeforeQuery(ctx, event)
|
|
}
|
|
return ctx
|
|
}
|
|
|
|
func WrapAfterQuery(hooks []TelemetryStoreHook, ctx context.Context, event *QueryEvent) {
|
|
for i := len(hooks) - 1; i >= 0; i-- {
|
|
hooks[i].AfterQuery(ctx, event)
|
|
}
|
|
}
|