Skip to content

Commit

Permalink
[ClickHouse org] make creating db and tables optional
Browse files Browse the repository at this point in the history
  • Loading branch information
RoryCrispin committed Nov 27, 2023
1 parent b5f6831 commit 1127acc
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
17 changes: 9 additions & 8 deletions exporter/clickhouseexporter/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,15 @@ func TestLoadConfig(t *testing.T) {
{
id: component.NewIDWithName(metadata.Type, "full"),
expected: &Config{
Endpoint: defaultEndpoint,
Database: "otel",
Username: "foo",
Password: "bar",
TTL: 72 * time.Hour,
LogsTableName: "otel_logs",
TracesTableName: "otel_traces",
MetricsTableName: "otel_metrics",
Endpoint: defaultEndpoint,
Database: "otel",
Username: "foo",
Password: "bar",
TTL: 72 * time.Hour,
CreateDBAndTables: true,
LogsTableName: "otel_logs",
TracesTableName: "otel_traces",
MetricsTableName: "otel_metrics",
TimeoutSettings: exporterhelper.TimeoutSettings{
Timeout: 5 * time.Second,
},
Expand Down
19 changes: 10 additions & 9 deletions exporter/clickhouseexporter/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,16 @@ func createDefaultConfig() component.Config {
queueSettings.NumConsumers = 1

return &Config{
TimeoutSettings: exporterhelper.NewDefaultTimeoutSettings(),
QueueSettings: queueSettings,
RetrySettings: exporterhelper.NewDefaultRetrySettings(),
ConnectionParams: map[string]string{},
Database: defaultDatabase,
LogsTableName: "otel_logs",
TracesTableName: "otel_traces",
MetricsTableName: "otel_metrics",
TTL: 0,
TimeoutSettings: exporterhelper.NewDefaultTimeoutSettings(),
QueueSettings: queueSettings,
RetrySettings: exporterhelper.NewDefaultRetrySettings(),
ConnectionParams: map[string]string{},
Database: defaultDatabase,
CreateDBAndTables: true, // this isn't actually default.
LogsTableName: "otel_logs",
TracesTableName: "otel_traces",
MetricsTableName: "otel_metrics",
TTL: 0,
}
}

Expand Down

0 comments on commit 1127acc

Please sign in to comment.