Conversation
|
This PR has been automatically converted to draft. All PRs must start as drafts per our contributing guidelines. Next steps:
|
Semver Impact of This PR⚪ None (no version bump detected) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨Langchain
Bug Fixes 🐛Ci
Openai
Other
Documentation 📚
Internal Changes 🔧Langchain
Openai
Other
Other
🤖 This preview updates automatically when you update the PR. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| ) | ||
| ) | ||
|
|
||
| if self.options["_experiments"].get("otel_powered_performance", False): |
There was a problem hiding this comment.
Accidentally removed otel_powered_performance experiment handling code
High Severity
The block handling the _experiments["otel_powered_performance"] option was removed alongside the Python 3.6 compat code, but it's unrelated to Python 3.6 compatibility. This code was responsible for setting instrumenter to INSTRUMENTER.OTEL and dynamically adding OpenTelemetryIntegration to _DEFAULT_INTEGRATIONS. Without it, the experimental OTel-powered performance feature silently stops working. The option is still defined in consts.py and still referenced by tests in test_experimental.py, which will now fail.
| ) | ||
| ) | ||
|
|
||
| if self.options["_experiments"].get("otel_powered_performance", False): | ||
| logger.debug( | ||
| "[OTel] Enabling experimental OTel-powered performance monitoring." | ||
| ) | ||
| self.options["instrumenter"] = INSTRUMENTER.OTEL | ||
| if ( | ||
| "sentry_sdk.integrations.opentelemetry.integration.OpenTelemetryIntegration" | ||
| not in _DEFAULT_INTEGRATIONS | ||
| ): | ||
| _DEFAULT_INTEGRATIONS.append( | ||
| "sentry_sdk.integrations.opentelemetry.integration.OpenTelemetryIntegration", | ||
| ) | ||
|
|
||
| self.integrations = setup_integrations( | ||
| self.options["integrations"], | ||
| with_defaults=self.options["default_integrations"], |
There was a problem hiding this comment.
Bug: The removal of the otel_powered_performance experiment handling logic breaks the feature. Setting this experiment flag will no longer enable the OpenTelemetryIntegration as intended.
Severity: MEDIUM
Suggested Fix
Restore the deleted code block in sentry_sdk/client.py. This block correctly checks for the otel_powered_performance experiment and enables the OpenTelemetryIntegration. It was not Python 3.6 compatibility code and was removed by mistake.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: sentry_sdk/client.py#L414-L419
Potential issue: The pull request removes a block of code responsible for activating
OpenTelemetry-powered performance monitoring. This logic checks for the
`otel_powered_performance` experiment flag and, if enabled, sets the instrumenter to
`INSTRUMENTER.OTEL` and adds the `OpenTelemetryIntegration`. With this code removed,
setting `_experiments={"otel_powered_performance": True}` during `sentry_init` will no
longer have any effect. This is a silent regression, as the feature will simply stop
working for users who have opted into this experiment, without any warning or error. The
experiment flag is still declared and tests exist that expect this functionality to
work.
Did we get this right? 👍 / 👎 to inform future reviews.
remove PY37 constant, re.Pattern try/except fallbacks, custom nullcontext, ModuleNotFoundError try/except, pre-3.7 aws lambda runtime branch, and gevent version_info guard. does not touch contextvars or datetime_from_isoformat compat fixes getsentry#5040
40f3c2c to
0a6eac1
Compare
|
This PR has been closed. The referenced issue does not show a discussion between you and a maintainer. To avoid wasted effort on both sides, please discuss your proposed approach in the issue first and wait for a maintainer to respond before opening a PR. Please review our contributing guidelines for more details. |


remove compat code that only existed for python 3.6 - PY37 constant, re.Pattern fallbacks, custom nullcontext, ModuleNotFoundError shim, pre-3.7 aws lambda runtime, and gevent version guard. does not touch contextvars or datetime_from_isoformat
fixes #5040