mirror of
https://github.com/hanzoai/otel-collector.git
synced 2026-10-30 18:26:25 +00:00
- imports: ClickHouse/ch-go, clickhouse-go/v2, srikanthccv/ClickHouse-go-mock
-> github.com/hanzo-ds/{native,go,mock} (require, clean semver, NO replace)
- identifiers/aliases/type-names/config-keys/type-IDs: clickhouse -> datastore
(receiver dir clickhousesystemtablesreceiver -> datastoresystemtablesreceiver)
- DSN scheme clickhouse:// -> datastore:// (driver treats non-http/https as Native)
- removed the go.opencensus.io version-pin replace (require-pinned instead)
- kept: real external refs (github.com/ClickHouse, clickhouse.com docs) and the
hanzo-ds/mock test API (NewClickHouseNative) pending the mock's own rename
Full ./... build passes. 0 replace directives, 0 signoz.
26 lines
405 B
Go
26 lines
405 B
Go
package datastoresystemtablesreceiver
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/hanzo-ds/go"
|
|
)
|
|
|
|
func newDatastoreClient(ctx context.Context, dsn string) (datastore.Conn, error) {
|
|
options, err := datastore.ParseDSN(dsn)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
db, err := datastore.Open(options)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
if err := db.Ping(ctx); err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return db, nil
|
|
}
|