Skip to content

Commit

Permalink
func name change
Browse files Browse the repository at this point in the history
  • Loading branch information
leartbeqiraj1 committed Nov 10, 2023
1 parent 485a367 commit a3efa6d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion exporter/clickhouseexporter/exporter_logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ func createLogsTable(ctx context.Context, cfg *Config, db *sql.DB) error {
}

func renderCreateLogsTableSQL(cfg *Config) string {
ttlExpr := ttlConfig(cfg.TTLDays, cfg.TTL)
ttlExpr := GenerateTTLExpr(cfg.TTLDays, cfg.TTL)
return fmt.Sprintf(createLogsTableSQL, cfg.LogsTableName, ttlExpr)
}

Expand Down
2 changes: 1 addition & 1 deletion exporter/clickhouseexporter/exporter_metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (e *metricsExporter) start(ctx context.Context, _ component.Host) error {

internal.SetLogger(e.logger)

ttlExpr := ttlConfig(e.cfg.TTLDays, e.cfg.TTL)
ttlExpr := GenerateTTLExpr(e.cfg.TTLDays, e.cfg.TTL)
return internal.NewMetricsTable(ctx, e.cfg.MetricsTableName, ttlExpr, e.client)
}

Expand Down
4 changes: 2 additions & 2 deletions exporter/clickhouseexporter/exporter_traces.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,12 +291,12 @@ func renderInsertTracesSQL(cfg *Config) string {
}

func renderCreateTracesTableSQL(cfg *Config) string {
ttlExpr := ttlConfig(cfg.TTLDays, cfg.TTL)
ttlExpr := GenerateTTLExpr(cfg.TTLDays, cfg.TTL)
return fmt.Sprintf(createTracesTableSQL, cfg.TracesTableName, ttlExpr)
}

func renderCreateTraceIDTsTableSQL(cfg *Config) string {
ttlExpr := ttlConfig(cfg.TTLDays, cfg.TTL)
ttlExpr := GenerateTTLExpr(cfg.TTLDays, cfg.TTL)
return fmt.Sprintf(createTraceIDTsTableSQL, cfg.TracesTableName, ttlExpr)
}

Expand Down
2 changes: 1 addition & 1 deletion exporter/clickhouseexporter/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func createMetricExporter(
)
}

func ttlConfig(ttlDays uint, ttl time.Duration) string {
func GenerateTTLExpr(ttlDays uint, ttl time.Duration) string {
if ttlDays > 0 {
return fmt.Sprintf(`TTL toDateTime(Timestamp) + toIntervalDay(%d)`, ttlDays)
}
Expand Down

0 comments on commit a3efa6d

Please sign in to comment.