-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
[exporter/stefexporter] Fix a context cancellation bug in STEF exporter #37944
Merged
dmitryax
merged 1 commit into
open-telemetry:main
from
tigrannajaryan:tigran/fixstefbug
Feb 18, 2025
Merged
[exporter/stefexporter] Fix a context cancellation bug in STEF exporter #37944
dmitryax
merged 1 commit into
open-telemetry:main
from
tigrannajaryan:tigran/fixstefbug
Feb 18, 2025
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
atoulme
approved these changes
Feb 16, 2025
STEF exporter used context that was passed to exportMetrics() as the context for the entire gRPC stream. This was wrong since the context is cancelled immediately after exportMetrics returns. The exporter now uses a separate context for the gRPC stream. This context has a longer duration, matching the duration of the gRPC stream. The context passed to exportMetrics() continues to be used as the context for connection attempt. If connection is not established within the limits of that context then the attempt to connect is correctly aborted. This now correctly decouples the context (and cancellation) for connection attempt from the context of the connected gRPC stream.
834c54c
to
e7e104e
Compare
yiquanzhou
added a commit
to dash0hq/opentelemetry-collector-contrib
that referenced
this pull request
Feb 18, 2025
* main: (111 commits) fix(azuremonitorreceiver): Azure Monitor receiver should not produce gaps in data points for PT1M time grains (open-telemetry#37342) fix(deps): update module sigs.k8s.io/controller-runtime to v0.20.2 (open-telemetry#37996) fix(deps): update module github.com/hashicorp/consul/api to v1.31.2 (open-telemetry#38031) [processor/resourcedetection] add instructions for recommended use of the dynatrace detector (open-telemetry#37962) fix(deps): update module github.com/go-sql-driver/mysql to v1.9.0 (open-telemetry#38007) fix(deps): update module google.golang.org/api to v0.221.0 (open-telemetry#38027) prometheusreceiver: deprecate start time adjustment (open-telemetry#37879) fix(deps): update module github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common to v1.0.1100 (open-telemetry#37995) chore(deps): update golang docker tag to v1.24 (open-telemetry#37997) fix(deps): update all github.com/aws packages (open-telemetry#37983) chore(deps): update prom/prometheus docker tag to v3.2.0 (open-telemetry#37998) fix(deps): update kubernetes packages to v0.32.2 (open-telemetry#38004) fix(deps): update module github.com/clickhouse/clickhouse-go/v2 to v2.32.1 (open-telemetry#38006) fix(deps): update module github.com/google/go-github/v69 to v69.2.0 (open-telemetry#38014) fix(deps): update module github.com/sap/go-hdb to v1.13.3 (open-telemetry#38021) fix(deps): update module go.etcd.io/bbolt to v1.4.0 (open-telemetry#38024) [exporter/stefexporter] Fix a context cancellation bug in STEF exporter (open-telemetry#37944) fix(deps): update module github.com/spf13/cobra to v1.9.1 (open-telemetry#38023) fix(deps): update module github.com/envoyproxy/go-control-plane/envoy to v1.32.4 (open-telemetry#37990) fix(deps): update module github.com/hashicorp/consul/api to v1.31.1 (open-telemetry#37991) ...
yiquanzhou
added a commit
to dash0hq/opentelemetry-collector-contrib
that referenced
this pull request
Feb 19, 2025
* main: (111 commits) fix(azuremonitorreceiver): Azure Monitor receiver should not produce gaps in data points for PT1M time grains (open-telemetry#37342) fix(deps): update module sigs.k8s.io/controller-runtime to v0.20.2 (open-telemetry#37996) fix(deps): update module github.com/hashicorp/consul/api to v1.31.2 (open-telemetry#38031) [processor/resourcedetection] add instructions for recommended use of the dynatrace detector (open-telemetry#37962) fix(deps): update module github.com/go-sql-driver/mysql to v1.9.0 (open-telemetry#38007) fix(deps): update module google.golang.org/api to v0.221.0 (open-telemetry#38027) prometheusreceiver: deprecate start time adjustment (open-telemetry#37879) fix(deps): update module github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common to v1.0.1100 (open-telemetry#37995) chore(deps): update golang docker tag to v1.24 (open-telemetry#37997) fix(deps): update all github.com/aws packages (open-telemetry#37983) chore(deps): update prom/prometheus docker tag to v3.2.0 (open-telemetry#37998) fix(deps): update kubernetes packages to v0.32.2 (open-telemetry#38004) fix(deps): update module github.com/clickhouse/clickhouse-go/v2 to v2.32.1 (open-telemetry#38006) fix(deps): update module github.com/google/go-github/v69 to v69.2.0 (open-telemetry#38014) fix(deps): update module github.com/sap/go-hdb to v1.13.3 (open-telemetry#38021) fix(deps): update module go.etcd.io/bbolt to v1.4.0 (open-telemetry#38024) [exporter/stefexporter] Fix a context cancellation bug in STEF exporter (open-telemetry#37944) fix(deps): update module github.com/spf13/cobra to v1.9.1 (open-telemetry#38023) fix(deps): update module github.com/envoyproxy/go-control-plane/envoy to v1.32.4 (open-telemetry#37990) fix(deps): update module github.com/hashicorp/consul/api to v1.31.1 (open-telemetry#37991) ...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
STEF exporter used context that was passed to exportMetrics() as the context for the entire gRPC stream.
This was wrong since the context is cancelled immediately after exportMetrics returns.
The exporter now uses a separate context for the gRPC stream. This context has a longer duration, matching the duration of the gRPC stream.
The context passed to exportMetrics() continues to be used as the context for connection attempt. If connection is not established within the limits of that context then the attempt to connect is correctly aborted.
This now correctly decouples the context (and cancellation) for connection attempt from the context of the connected gRPC stream.
Testing
Added unit tests to verify the bug fix.