-
Notifications
You must be signed in to change notification settings - Fork 264
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: dynamic selectors with alert_foreign_logs_enricher #1600
feat: dynamic selectors with alert_foreign_logs_enricher #1600
Conversation
@@ -8,6 +8,7 @@ | |||
from hikaru.model.rel_1_26 import Node | |||
from kubernetes import client | |||
from kubernetes.client import V1Pod, V1PodList, exceptions | |||
from playbooks.robusta_playbooks.util import resolve_selectors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this import looks like the issue with pytest
2024-10-18 12:51:43.140 ERROR failed to module alerts_integration
Traceback (most recent call last):
File "/app/src/robusta/runner/config_loader.py", line 1[82](https://github.com/robusta-dev/robusta/actions/runs/11403920443/job/31731978176?pr=1600#step:11:83), in __import_playbooks_package
m = importlib.reload(importlib.import_module(module_name))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 6[90](https://github.com/robusta-dev/robusta/actions/runs/11403920443/job/31731978176?pr=1600#step:11:91), in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 940, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/venv/lib/python3.11/site-packages/robusta_playbooks/alerts_integration.py", line 11, in <module>
from playbooks.robusta_playbooks.util import resolve_selectors
ModuleNotFoundError: No module named 'playbooks'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if it's a code that is common to different playbooks packages, maybe it's better to put in in the core
package, and not in the playbooks
package
playbooks packages are loaded dynamically, so having dependencies between playbooks file must validate the are loaded in the right order (with the core
package, this problem doesn't exist)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@arikalon1 As this PR adds no more imports than were already existing I suggest to make that change in another PR if you think it's warranted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice work!
Fixes #1529 |
This adds support for calling the logs enricher based on the labels of a prometheus alert
Documentation