Skip to content

Commit

Permalink
fix: nil meter instance used in exporter (#492)
Browse files Browse the repository at this point in the history
Fixes #491
  • Loading branch information
srikanthccv authored Dec 27, 2024
1 parent cc3d7be commit 2edb966
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions exporter/clickhousemetricsexporterv2/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand All @@ -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 {
Expand Down Expand Up @@ -181,6 +183,7 @@ func defaultOptions() []ExporterOption {
WithCache(cache),
WithLogger(zap.NewNop()),
WithEnableExpHist(false),
WithMeter(noop.NewMeterProvider().Meter(meterScope)),
}
}

Expand Down
1 change: 1 addition & 0 deletions exporter/clickhousemetricsexporterv2/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 2edb966

Please sign in to comment.