Skip to content

Commit

Permalink
Many fixes
Browse files Browse the repository at this point in the history
Signed-off-by: haanhvu <[email protected]>
  • Loading branch information
haanhvu committed Jan 2, 2024
1 parent e961689 commit 0de83b3
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 5 deletions.
6 changes: 3 additions & 3 deletions cmd/jaeger/internal/exporters/storageexporter/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ type storageExporter struct {

func newExporter(config *Config, otel component.TelemetrySettings) *storageExporter {
return &storageExporter{
config: config,
logger: otel.Logger,
clickhouse: false,
config: config,
logger: otel.Logger,
}
}

Expand All @@ -46,6 +45,7 @@ func (exp *storageExporter) start(ctx context.Context, host component.Host) erro
t.CreateSpansTable(ctx)
exp.chExportTraces = t.ExportSpans
default:
exp.clickhouse = false
if exp.spanWriter, err = f.CreateSpanWriter(); err != nil {
return fmt.Errorf("cannot create span writer: %w", err)
}
Expand Down
51 changes: 51 additions & 0 deletions config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
service:
extensions: [jaeger_storage, jaeger_query]
pipelines:
traces:
receivers: [otlp, jaeger, zipkin]
processors: [batch]
exporters: [jaeger_storage_exporter]

extensions:
# health_check:
# pprof:
# endpoint: 0.0.0.0:1777
# zpages:
# endpoint: 0.0.0.0:55679

jaeger_query:
trace_storage: ch_store
ui_config: ./cmd/jaeger/config-ui.json

jaeger_storage:
memory:
memstore:
max_traces: 100000
memstore_archive:
max_traces: 100000
clickhouse:
ch_store:
endpoint: tcp://127.0.0.1:9000?dial_timeout=10s&compress=lz4
spans_table_name: jaeger_spans

receivers:
otlp:
protocols:
grpc:
http:

jaeger:
protocols:
grpc:
thrift_binary:
thrift_compact:
thrift_http:

zipkin:

processors:
batch:

exporters:
jaeger_storage_exporter:
trace_storage: ch_store
4 changes: 3 additions & 1 deletion plugin/storage/clickhouse/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ type Config struct {
// Materialized views' names?
}

var driverName = "clickhouse"

const (
defaultDatabase = "default"
defaultUsername = "default"
Expand Down Expand Up @@ -67,7 +69,7 @@ func (cfg *Config) NewClient(ctx context.Context) (*sql.DB, error) {
return nil, err
}

db, err := sql.Open("", dsn)
db, err := sql.Open(driverName, dsn)
if err != nil {
return nil, err
}
Expand Down
3 changes: 2 additions & 1 deletion plugin/storage/clickhouse/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ func createTraces(count int) ptrace.Traces {
}

func initClickhouseTestServer(t *testing.T, recorder recorder) {
sql.Register("", &testClickhouseDriver{
driverName = "test"
sql.Register(driverName, &testClickhouseDriver{
recorder: recorder,
})
}
Expand Down

0 comments on commit 0de83b3

Please sign in to comment.