We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
exporter/clickhouse
This bug is a regression after #33634 In case of not set service.name Resource Attribute for Metric clickhouse exporter will throw next panic:
service.name
opentelemetry-collector panic: runtime error: invalid memory address or nil pointer dereference opentelemetry-collector [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xa78bdc] opentelemetry-collector opentelemetry-collector goroutine 46 [running]: opentelemetry-collector go.opentelemetry.io/collector/pdata/pcommon.Value.Type(...) opentelemetry-collector go.opentelemetry.io/collector/[email protected]/pcommon/value.go:183 opentelemetry-collector go.opentelemetry.io/collector/pdata/pcommon.Value.AsString({0x0?, 0xc0006e0fa0?}) opentelemetry-collector go.opentelemetry.io/collector/[email protected]/pcommon/value.go:370 +0x1c opentelemetry-collector github.com/open-telemetry/opentelemetry-collector-contrib/exporter/clickhouseexporter/internal.(*gaugeMetrics).insert.func1(0x0?) opentelemetry-collector github.com/open-telemetry/opentelemetry-collector-contrib/exporter/[email protected]/internal/gauge_metrics.go:125 +0x367 opentelemetry-collector github.com/open-telemetry/opentelemetry-collector-contrib/exporter/clickhouseexporter/internal.doWithTx({0x6eac320?, 0xc0007bfce0?}, 0x0?, 0xc000b07f40) opentelemetry-collector github.com/open-telemetry/opentelemetry-collector-contrib/exporter/[email protected]/internal/metrics_model.go:210 +0xd3 opentelemetry-collector github.com/open-telemetry/opentelemetry-collector-contrib/exporter/clickhouseexporter/internal.(*gaugeMetrics).insert(0xc00060e0f0, {0x6eac320, 0xc0007bfce0}, 0xc0010d6750) opentelemetry-collector github.com/open-telemetry/opentelemetry-collector-contrib/exporter/[email protected]/internal/gauge_metrics.go:101 +0xd8 opentelemetry-collector github.com/open-telemetry/opentelemetry-collector-contrib/exporter/clickhouseexporter/internal.InsertMetrics.func1({0x6e5d6b0?, 0xc00060e0f0?}, 0xc0006e0fb0) opentelemetry-collector github.com/open-telemetry/opentelemetry-collector-contrib/exporter/[email protected]/internal/metrics_model.go:100 +0x43 opentelemetry-collector created by github.com/open-telemetry/opentelemetry-collector-contrib/exporter/clickhouseexporter/internal.InsertMetrics in goroutine 21 opentelemetry-collector github.com/open-telemetry/opentelemetry-collector-contrib/exporter/[email protected]/internal/metrics_model.go:99 +0xcc
This panic happens due to unsafe usage of pcommon.Map.Get() in next line: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/exporter/clickhouseexporter/internal/gauge_metrics.go#L112 While documentation explicitly states that "Calling any functions on the returned invalid instance may cause a panic.". This panic happens on line https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/exporter/clickhouseexporter/internal/gauge_metrics.go#L125, where in case of absent service.name in Map we are trying to call <invalid instance>.AsString()
pcommon.Map.Get()
<invalid instance>.AsString()
The bug is valid for all types of Metrics and also Traces, Logs are unaffected because they are using correct value check for some reason
Just try to export a Metric without service.name attribute using clickhouse exporter
clickhouse
No panic
Panic
0.116.0
No response
The text was updated successfully, but these errors were encountered:
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself.
Sorry, something went wrong.
PR with fix: #37034
Successfully merging a pull request may close this issue.
Component(s)
exporter/clickhouse
What happened?
Description
This bug is a regression after #33634
In case of not set
service.name
Resource Attribute for Metric clickhouse exporter will throw next panic:This panic happens due to unsafe usage of
pcommon.Map.Get()
in next line:https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/exporter/clickhouseexporter/internal/gauge_metrics.go#L112
While documentation explicitly states that "Calling any functions on the returned invalid instance may cause a panic.". This panic happens on line https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/exporter/clickhouseexporter/internal/gauge_metrics.go#L125, where in case of absent
service.name
in Map we are trying to call<invalid instance>.AsString()
The bug is valid for all types of Metrics and also Traces, Logs are unaffected because they are using correct value check for some reason
Steps to Reproduce
Just try to export a Metric without
service.name
attribute usingclickhouse
exporterExpected Result
No panic
Actual Result
Panic
Collector version
0.116.0
Environment information
No response
OpenTelemetry Collector configuration
No response
Log output
Additional context
No response
The text was updated successfully, but these errors were encountered: