Skip to content

🔧 chore(slack): remove unused metrics #93281

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

iamrajjoshi
Copy link
Member

we don't have any dashboards or use any of these metrics, so lets remove and save us some 💸 it should be close to 1k in savings

also changed some loggers from exception to info since we don't need the stacktrace or issues for a lot of these issues

@iamrajjoshi iamrajjoshi self-assigned this Jun 10, 2025
@iamrajjoshi iamrajjoshi requested review from a team as code owners June 10, 2025 21:15
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jun 10, 2025
Copy link

codecov bot commented Jun 10, 2025

❌ 5 Tests Failed:

Tests completed Failed Passed Skipped
26365 5 26360 212
View the top 3 failed test(s) by shortest run time
tests.sentry.integrations.slack.test_link_identity.SlackIntegrationLinkIdentityTest::test_basic_flow_with_webhook_client_error
Stack Traces | 2.04s run time
#x1B[1m#x1B[.../integrations/slack/test_link_identity.py#x1B[0m:101: in test_basic_flow_with_webhook_client_error
    assert mock_logger.exception.call_count == 1
#x1B[1m#x1B[31mE   AssertionError: assert 0 == 1#x1B[0m
#x1B[1m#x1B[31mE    +  where 0 = <MagicMock name='_logger.exception' id='139887267145984'>.call_count#x1B[0m
#x1B[1m#x1B[31mE    +    where <MagicMock name='_logger.exception' id='139887267145984'> = <MagicMock name='_logger' id='139887278848192'>.exception#x1B[0m
tests.sentry.integrations.slack.test_link_identity.SlackIntegrationLinkIdentityTest::test_basic_flow_with_web_client_error
Stack Traces | 2.13s run time
#x1B[1m#x1B[.../integrations/slack/test_link_identity.py#x1B[0m:141: in test_basic_flow_with_web_client_error
    assert mock_logger.exception.call_count == 1
#x1B[1m#x1B[31mE   AssertionError: assert 0 == 1#x1B[0m
#x1B[1m#x1B[31mE    +  where 0 = <MagicMock name='_logger.exception' id='140500847472528'>.call_count#x1B[0m
#x1B[1m#x1B[31mE    +    where <MagicMock name='_logger.exception' id='140500847472528'> = <MagicMock name='_logger' id='140500840492608'>.exception#x1B[0m
tests.sentry.incidents.action_handlers.test_slack.SlackActionHandlerTest::test_fire_metric_alert_sdk_error
Stack Traces | 2.77s run time
#x1B[1m#x1B[.../hostedtoolcache/Python/3.13.1................../x64/lib/python3.13/unittest/mock.py#x1B[0m:1421: in patched
    with self.decoration_helper(patched,
#x1B[1m#x1B[.../hostedtoolcache/Python/3.13.1................../x64/lib/python3.13/contextlib.py#x1B[0m:141: in __enter__
    return next(self.gen)
#x1B[1m#x1B[.../hostedtoolcache/Python/3.13.1................../x64/lib/python3.13/unittest/mock.py#x1B[0m:1403: in decoration_helper
    arg = exit_stack.enter_context(patching)
#x1B[1m#x1B[.../hostedtoolcache/Python/3.13.1................../x64/lib/python3.13/contextlib.py#x1B[0m:530: in enter_context
    result = _enter(cm)
#x1B[1m#x1B[.../hostedtoolcache/Python/3.13.1................../x64/lib/python3.13/unittest/mock.py#x1B[0m:1495: in __enter__
    original, local = self.get_original()
#x1B[1m#x1B[.../hostedtoolcache/Python/3.13.1................../x64/lib/python3.13/unittest/mock.py#x1B[0m:1465: in get_original
    raise AttributeError(
#x1B[1m#x1B[31mE   AttributeError: <module 'sentry.integrations.slack.utils.notifications' from '.../slack/utils/notifications.py'> does not have the attribute 'metrics'#x1B[0m

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

tags={"type": "update_message"},
)
_logger.exception("slack.webhook.update_status.response-error")
_logger.info("slack.webhook.update_status.response-error")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we add some context/info to help debug the error ?

tags={"type": f"{self.dialog_type}_modal_open"},
)
_logger.exception(
_logger.info(
"slack.action.response-error",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for here and in the other logger.info -> logger.exception, would it be helpful to add the exc_info or report the error to sentry?

@iamrajjoshi iamrajjoshi changed the title 🔧 chore(slack(: remove unused metrics 🔧 chore(slack): remove unused metrics Jun 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants