Skip to content
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

feat(aci milestone 3): anomaly detection condition handler #88647

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

mifu67
Copy link
Contributor

@mifu67 mifu67 commented Apr 2, 2025

Open question:

  • Which ID do we want to use to key data in Seer? How do we pass this ID to the handler?

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 2, 2025
SEER_ANOMALY_DETECTION_CONNECTION_POOL = connection_from_url(
settings.SEER_ANOMALY_DETECTION_URL,
timeout=settings.SEER_ANOMALY_DETECTION_TIMEOUT,
)


@condition_handler_registry.register(Condition.ANOMALY_DETECTION)
Copy link
Contributor

Choose a reason for hiding this comment

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

should this data condition live in the incidents directory? 🤔 it's all hooked into the workflow_engine with this registry, which allows us to store it anywhere.

i think that might help keep the workflow_engine a bit more isolated, then if we want to add anomaly detection to other kinds of detectors in the future, we can worry about making it more generic then.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should we made a new condition handler subdirectory within the incidents directory?

Copy link

codecov bot commented Apr 2, 2025

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
25001 1 25000 298
View the top 1 failed test(s) by shortest run time
tests.sentry.test_devimports::test_startup_imports[sentry]
Stack Traces | 38.4s run time
#x1B[1m#x1B[31mtests/sentry/test_devimports.py#x1B[0m:111: in test_startup_imports
    validate_package(pkg, EXCLUDED, XFAIL)
#x1B[1m#x1B[31mtests/sentry/test_devimports.py#x1B[0m:106: in validate_package
    raise AssertionError(ret.stdout)
#x1B[1m#x1B[31mE   AssertionError: error importing sentry.workflow_engine.handlers.condition.anomaly_detection_handler:#x1B[0m
#x1B[1m#x1B[31mE   #x1B[0m
#x1B[1m#x1B[31mE   Traceback (most recent call last):#x1B[0m
#x1B[1m#x1B[31mE     File "<string>", line 35, in <module>#x1B[0m
#x1B[1m#x1B[31mE       __import__(name)#x1B[0m
#x1B[1m#x1B[31mE       ~~~~~~~~~~^^^^^^#x1B[0m
#x1B[1m#x1B[31mE     File "<string>", line 15, in _import#x1B[0m
#x1B[1m#x1B[31mE       return orig(name, globals=globals, locals=locals, fromlist=fromlist, level=level)#x1B[0m
#x1B[1m#x1B[31mE     File ".../handlers/condition/anomaly_detection_handler.py", line 40, in <module>#x1B[0m
#x1B[1m#x1B[31mE       class AnomalyDetectionHandler(DataConditionHandler[DataPacket]):#x1B[0m
#x1B[1m#x1B[31mE       ...<40 lines>...#x1B[0m
#x1B[1m#x1B[31mE               return SEER_EVALUATION_TO_DETECTOR_PRIORITY[anomaly_type]#x1B[0m
#x1B[1m#x1B[31mE     File ".../handlers/condition/anomaly_detection_handler.py", line 41, in AnomalyDetectionHandler#x1B[0m
#x1B[1m#x1B[31mE       type = [DataConditionHandler.Type.DETECTOR_TRIGGER]#x1B[0m
#x1B[1m#x1B[31mE               ^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[0m
#x1B[1m#x1B[31mE   AttributeError: type object 'DataConditionHandler' has no attribute 'Type'#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.

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