Skip to content

Commit fb648cc

Browse files
Revert "chore: Investigating org slug already set to a different value (#45134)"
This reverts commit 76a4d84. Co-authored-by: armenzg <[email protected]>
1 parent e242496 commit fb648cc

File tree

1 file changed

+0
-30
lines changed

1 file changed

+0
-30
lines changed

src/sentry/utils/sdk.py

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import copy
22
import inspect
3-
import logging
43
import random
54

65
import sentry_sdk
@@ -19,8 +18,6 @@
1918
from sentry.utils.db import DjangoAtomicIntegration
2019
from sentry.utils.rust import RustInfoIntegration
2120

22-
logger = logging.getLogger(__name__)
23-
2421
UNSAFE_FILES = (
2522
"sentry/event_manager.py",
2623
"sentry/tasks/process_buffer.py",
@@ -448,38 +445,11 @@ def _kwargs_into_scope(self, scope, extra=None, tags=None, fingerprint=None, req
448445
scope.fingerprint = fingerprint
449446

450447

451-
def check_tag(tag_key: str, expected_value: str) -> bool:
452-
"""Detect a tag already set and being different than what we expect.
453-
454-
This function checks if a tag has been already been set and if it differs
455-
from what we want to set it to.
456-
"""
457-
with configure_scope() as scope:
458-
if scope._tags and tag_key in scope._tags and scope._tags[tag_key] != expected_value:
459-
extra = {
460-
f"previous_{tag_key}": scope._tags[tag_key],
461-
f"new_{tag_key}": expected_value,
462-
}
463-
logger.warning(f"Tag already set and different ({tag_key}).", extra=extra)
464-
# This can be used to find errors that may have been mistagged
465-
scope.set_tag("possible_mistag", True)
466-
return True
467-
468-
469-
# We have some events being tagged with organization.slug even when we don't have such info
470-
def log_if_tags_already_set(org_id: int, org_slug: str) -> None:
471-
"""If the tags are already set and differ, report them as a Sentry error."""
472-
if check_tag("organization", org_id) or check_tag("organization.slug", org_slug):
473-
logger.error("Intentional error for investigation. See WOR-2464.")
474-
475-
476448
def bind_organization_context(organization):
477449
helper = settings.SENTRY_ORGANIZATION_CONTEXT_HELPER
478450

479451
# XXX(dcramer): this is duplicated in organizationContext.jsx on the frontend
480452
with sentry_sdk.configure_scope() as scope:
481-
log_if_tags_already_set(organization.id, organization.slug)
482-
483453
scope.set_tag("organization", organization.id)
484454
scope.set_tag("organization.slug", organization.slug)
485455
scope.set_context("organization", {"id": organization.id, "slug": organization.slug})

0 commit comments

Comments
 (0)