Skip to content

Commit

Permalink
ref(metrics): Change push_scope to new_scope
Browse files Browse the repository at this point in the history
`sentry_sdk.push_scope` is soft-deprecated, and will soon be hard-
deprecated (see sentry-python#3347), so replace the `push_scope`
calls with appropriate new API. Here, we use `sentry_sdk.new_scope`,
since we are setting tags for a `capture_message` call.

Closes #74938
  • Loading branch information
szokeasaurusrex committed Jul 26, 2024
1 parent f781d7a commit cf287e1
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def create_extraction_rule_config(request: Request, project: Project, config_upd
or len(obj["conditions"]) == 0
or (len(obj["conditions"]) == 1 and obj["conditions"][0] == "")
):
with sentry_sdk.push_scope() as scope:
with sentry_sdk.new_scope() as scope:
scope.set_tag("project", project.slug)
sentry_sdk.capture_message(
"A MetricExtractionRuleConfig without conditions was created.",
Expand Down

0 comments on commit cf287e1

Please sign in to comment.