Ignore a deprecation warning from sentry_sdk#70
Merged
Conversation
As of its [2.21.0 release](https://github.com/getsentry/sentry-python/releases/tag/2.21.0) `sentry_sdk`'s Celery integration has begun emitting this deprecation warning: E DeprecationWarning: The `propagate_traces` parameter is deprecated. Please use `trace_propagation_targets` instead. .tox/tests/lib/python3.12/site-packages/sentry_sdk/integrations/celery/__init__.py:73: DeprecationWarning h-pyramid-sentry doesn't actually use the `propagate_traces` parameter. In fact all it's doing is inititalising `sentry_sdk`'s Celery integration with no arguments: from sentry_sdk.integrations.celery import CeleryIntegration init_options["integrations"].append(CeleryIntegration()) https://github.com/hypothesis/h-pyramid-sentry/blob/6de9124faa29ca99979bc08318af7c45e0487586/src/h_pyramid_sentry/__init__.py#L54-L56 `sentry_sdk` appears to emit the warning unconditionally whenever anyone uses the Celery integration: class CeleryIntegration(Integration): identifier = "celery" origin = f"auto.queue.{identifier}" def __init__( self, propagate_traces=True, monitor_beat_tasks=False, exclude_beat_tasks=None, ): # type: (bool, bool, Optional[List[str]]) -> None warnings.warn( "The `propagate_traces` parameter is deprecated. Please use `trace_propagation_targets` instead.", DeprecationWarning, stacklevel=2, ) https://github.com/getsentry/sentry-python/blob/25ddbcad9642cf38b7a9668e348f80fb9b1c892e/sentry_sdk/integrations/celery/__init__.py#L62-L77 The warning was added by this PR: getsentry/sentry-python#3899. Just ignore the warning, as there's no way for us to fix this.
seanh
commented
Feb 14, 2025
| @@ -0,0 +1 @@ | |||
| "ignore:The `propagate_traces` parameter is deprecated\\. Please use `trace_propagation_targets` instead\\.:DeprecationWarning:", | |||
Contributor
Author
There was a problem hiding this comment.
I'd like to limit this filter to a path, for example:
"ignore:The `propagate_traces` parameter is deprecated\\. Please use `trace_propagation_targets` instead\\.:DeprecationWarning:sentry_sdk.integrations.celery",...but I can't seem to get it to work. Only omitting the path entirely seems to work 🤷
acelaya
approved these changes
Feb 14, 2025
This file contains hidden or 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
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.
As of its 2.21.0 release
sentry_sdk's Celery integration has begun emitting this deprecation warning:h-pyramid-sentry doesn't actually use the
propagate_tracesparameter. In fact all it's doing is inititalisingsentry_sdk's Celery integration with no arguments:h-pyramid-sentry/src/h_pyramid_sentry/__init__.py
Lines 54 to 56 in 6de9124
sentry_sdkappears to emit the warning unconditionally whenever anyone uses the Celery integration:The warning was added by this PR: getsentry/sentry-python#3899.
Just ignore the warning, as there's no way for us to fix this.