Skip to content

Commit f7e524b

Browse files
committed
fix: nil meter instance used in exporter
1 parent cc3d7be commit f7e524b

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

exporter/clickhousemetricsexporterv2/exporter.go

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
semconv "go.opentelemetry.io/collector/semconv/v1.5.0"
2020
"go.opentelemetry.io/otel/attribute"
2121
metricapi "go.opentelemetry.io/otel/metric"
22+
"go.opentelemetry.io/otel/metric/noop"
2223
"go.uber.org/zap"
2324
)
2425

@@ -36,6 +37,7 @@ var (
3637
timeSeriesSQLTmpl = "INSERT INTO %s.%s (env, temporality, metric_name, description, unit, type, is_monotonic, fingerprint, unix_milli, labels, attrs, scope_attrs, resource_attrs) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
3738
expHistSQLTmpl = "INSERT INTO %s.%s (env, temporality, metric_name, fingerprint, unix_milli, count, sum, min, max, sketch) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
3839
metadataSQLTmpl = "INSERT INTO %s.%s (temporality, metric_name, description, unit, type, is_monotonic, attr_name, attr_type, attr_datatype, attr_string_value, first_reported_unix_milli, last_reported_unix_milli) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
40+
meterScope = "github.com/SigNoz/signoz-otel-collector/exporter/clickhousemetricsexporterv2"
3941
)
4042

4143
type clickhouseMetricsExporter struct {
@@ -181,6 +183,7 @@ func defaultOptions() []ExporterOption {
181183
WithCache(cache),
182184
WithLogger(zap.NewNop()),
183185
WithEnableExpHist(false),
186+
WithMeter(noop.NewMeterProvider().Meter(meterScope)),
184187
}
185188
}
186189

exporter/clickhousemetricsexporterv2/factory.go

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ func createMetricsExporter(ctx context.Context, set exporter.Settings,
4747
WithConfig(chCfg),
4848
WithConn(conn),
4949
WithLogger(set.Logger),
50+
WithMeter(set.MeterProvider.Meter(meterScope)),
5051
WithEnableExpHist(chCfg.EnableExpHist),
5152
)
5253
if err != nil {

0 commit comments

Comments
 (0)