File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
exporter/clickhouseexporter Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -188,6 +188,28 @@ SETTINGS index_granularity=8192, ttl_only_drop_parts = 1;
188188 ResourceAttributes,
189189 LogAttributes
190190 )`
191+ inlineinsertLogsSQLTemplate = `INSERT INTO %s SETTINGS async_insert=1, wait_for_async_insert=0 (
192+ Timestamp,
193+ TraceId,
194+ SpanId,
195+ TraceFlags,
196+ SeverityText,
197+ SeverityNumber,
198+ ServiceName,
199+ Body,
200+ ResourceAttributes,
201+ LogAttributes
202+ ) VALUES (
203+ ?,
204+ ?,
205+ ?,
206+ ?,
207+ ?,
208+ ?,
209+ ?,
210+ ?,
211+ ?,
212+ ?)`
191213)
192214
193215var driverName = "clickhouse" // for testing
@@ -274,5 +296,8 @@ func renderCreateLogsTableSQL(cfg *Config) string {
274296}
275297
276298func renderInsertLogsSQL (cfg * Config ) string {
299+ if strings .HasPrefix (cfg .Endpoint , "tcp" ) && cfg .ConnectionParams ["async_insert" ] == "1" {
300+ return fmt .Sprintf (inlineinsertLogsSQLTemplate , cfg .LogsTableName )
301+ }
277302 return fmt .Sprintf (insertLogsSQLTemplate , cfg .LogsTableName )
278303}
You can’t perform that action at this time.
0 commit comments