-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
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
[internal/datadog] Fix Datarace in metrics client #31964
[internal/datadog] Fix Datarace in metrics client #31964
Conversation
You will need to rebase this one after #31972 is merged |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need a changelog? Seems users can run into this bug
@songy23 I would prefer not to add changelog for a data race bug. |
…-data-race-metrics-client
I agree with Yang that this would need a changelog, I mistakenly assumed this did not have user-facing implications |
Co-authored-by: Yang Song <songy23@users.noreply.github.com>
**Description:** <Describe what has changed.> <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> Fixes the data race. ``` fatal error: concurrent map read and map write goroutine 72665 [running]: github.com/open-telemetry/opentelemetry-collector-contrib/internal/datadog.(*metricsClient).Gauge.func1({0x7b895a0?, 0xc07c930790?}, {0x940dac8, 0xc1996ce180}) github.com/open-telemetry/opentelemetry-collector-contrib/internal/datadog@v0.96.0/metrics_client.go:49 +0x85 go.opentelemetry.io/otel/sdk/metric.(*meter).float64ObservableInstrument.func1.1({0x9443f08, 0xef10b00}) go.opentelemetry.io/otel/sdk/metric@v1.24.0/meter.go:286 +0x55 go.opentelemetry.io/otel/sdk/metric.(*pipeline).produce(0xc002852bd0, {0x9443f08, 0xef10b00}, 0xc108dd46c0) go.opentelemetry.io/otel/sdk/metric@v1.24.0/pipeline.go:122 +0x168 go.opentelemetry.io/otel/sdk/metric.(*ManualReader).Collect(0xc0030d2aa0, {0x9443f08, 0xef10b00}, 0xc108dd46c0) go.opentelemetry.io/otel/sdk/metric@v1.24.0/manual_reader.go:123 +0xe2 go.opentelemetry.io/otel/exporters/prometheus.(*collector).Collect(0xc0030e4aa0, 0xc10a0083c0) go.opentelemetry.io/otel/exporters/prometheus@v0.46.0/exporter.go:158 +0x72 github.com/prometheus/client_golang/prometheus.(*Registry).Gather.func1() github.com/prometheus/client_golang@v1.19.0/prometheus/registry.go:457 +0xe5 created by github.com/prometheus/client_golang/prometheus.(*Registry).Gather in goroutine 5 ``` **Link to tracking Issue:** <Issue number if applicable> **Testing:** <Describe what testing was performed and which tests were added.> **Documentation:** <Describe the documentation added.> --------- Co-authored-by: Yang Song <songy23@users.noreply.github.com>
Description:
Fixes the data race.
Link to tracking Issue:
Testing:
Documentation: