diff --git a/exporter/clickhousemetricsexporterv2/exporter.go b/exporter/clickhousemetricsexporterv2/exporter.go index 72baad88..8554d499 100644 --- a/exporter/clickhousemetricsexporterv2/exporter.go +++ b/exporter/clickhousemetricsexporterv2/exporter.go @@ -19,6 +19,7 @@ import ( semconv "go.opentelemetry.io/collector/semconv/v1.5.0" "go.opentelemetry.io/otel/attribute" metricapi "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/metric/noop" "go.uber.org/zap" ) @@ -36,6 +37,7 @@ var ( timeSeriesSQLTmpl = "INSERT INTO %s.%s (env, temporality, metric_name, description, unit, type, is_monotonic, fingerprint, unix_milli, labels, attrs, scope_attrs, resource_attrs) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" expHistSQLTmpl = "INSERT INTO %s.%s (env, temporality, metric_name, fingerprint, unix_milli, count, sum, min, max, sketch) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" 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 (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" + meterScope = "github.com/SigNoz/signoz-otel-collector/exporter/clickhousemetricsexporterv2" ) type clickhouseMetricsExporter struct { @@ -181,6 +183,7 @@ func defaultOptions() []ExporterOption { WithCache(cache), WithLogger(zap.NewNop()), WithEnableExpHist(false), + WithMeter(noop.NewMeterProvider().Meter(meterScope)), } } diff --git a/exporter/clickhousemetricsexporterv2/factory.go b/exporter/clickhousemetricsexporterv2/factory.go index 4b91e617..f6ecc8eb 100644 --- a/exporter/clickhousemetricsexporterv2/factory.go +++ b/exporter/clickhousemetricsexporterv2/factory.go @@ -47,6 +47,7 @@ func createMetricsExporter(ctx context.Context, set exporter.Settings, WithConfig(chCfg), WithConn(conn), WithLogger(set.Logger), + WithMeter(set.MeterProvider.Meter(meterScope)), WithEnableExpHist(chCfg.EnableExpHist), ) if err != nil {