robusta-api 0.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (294) hide show
  1. robusta_api-0.0.0/LICENSE +21 -0
  2. robusta_api-0.0.0/PKG-INFO +60 -0
  3. robusta_api-0.0.0/pyproject.toml +138 -0
  4. robusta_api-0.0.0/src/robusta/__init__.py +0 -0
  5. robusta_api-0.0.0/src/robusta/_version.py +2 -0
  6. robusta_api-0.0.0/src/robusta/api/__init__.py +330 -0
  7. robusta_api-0.0.0/src/robusta/cli/__init__.py +0 -0
  8. robusta_api-0.0.0/src/robusta/cli/auth.py +166 -0
  9. robusta_api-0.0.0/src/robusta/cli/backend_profile.py +54 -0
  10. robusta_api-0.0.0/src/robusta/cli/eula.py +27 -0
  11. robusta_api-0.0.0/src/robusta/cli/integrations_cmd.py +154 -0
  12. robusta_api-0.0.0/src/robusta/cli/main.py +517 -0
  13. robusta_api-0.0.0/src/robusta/cli/playbooks_cmd.py +386 -0
  14. robusta_api-0.0.0/src/robusta/cli/self_host.py +238 -0
  15. robusta_api-0.0.0/src/robusta/cli/slack_feedback_message.py +86 -0
  16. robusta_api-0.0.0/src/robusta/cli/slack_verification.py +104 -0
  17. robusta_api-0.0.0/src/robusta/cli/utils.py +146 -0
  18. robusta_api-0.0.0/src/robusta/core/__init__.py +0 -0
  19. robusta_api-0.0.0/src/robusta/core/discovery/__init__.py +0 -0
  20. robusta_api-0.0.0/src/robusta/core/discovery/discovery.py +818 -0
  21. robusta_api-0.0.0/src/robusta/core/discovery/resource_names.py +88 -0
  22. robusta_api-0.0.0/src/robusta/core/discovery/top_service_resolver.py +76 -0
  23. robusta_api-0.0.0/src/robusta/core/discovery/utils.py +45 -0
  24. robusta_api-0.0.0/src/robusta/core/exceptions.py +16 -0
  25. robusta_api-0.0.0/src/robusta/core/model/__init__.py +0 -0
  26. robusta_api-0.0.0/src/robusta/core/model/base_params.py +346 -0
  27. robusta_api-0.0.0/src/robusta/core/model/cluster_status.py +34 -0
  28. robusta_api-0.0.0/src/robusta/core/model/env_vars.py +124 -0
  29. robusta_api-0.0.0/src/robusta/core/model/events.py +168 -0
  30. robusta_api-0.0.0/src/robusta/core/model/helm_release.py +67 -0
  31. robusta_api-0.0.0/src/robusta/core/model/jobs.py +182 -0
  32. robusta_api-0.0.0/src/robusta/core/model/k8s_operation_type.py +7 -0
  33. robusta_api-0.0.0/src/robusta/core/model/namespaces.py +20 -0
  34. robusta_api-0.0.0/src/robusta/core/model/nodes.py +51 -0
  35. robusta_api-0.0.0/src/robusta/core/model/pods.py +264 -0
  36. robusta_api-0.0.0/src/robusta/core/model/runner_config.py +102 -0
  37. robusta_api-0.0.0/src/robusta/core/model/services.py +127 -0
  38. robusta_api-0.0.0/src/robusta/core/persistency/__init__.py +0 -0
  39. robusta_api-0.0.0/src/robusta/core/persistency/in_memory.py +20 -0
  40. robusta_api-0.0.0/src/robusta/core/persistency/scheduled_jobs_states_dal.py +66 -0
  41. robusta_api-0.0.0/src/robusta/core/playbooks/__init__.py +0 -0
  42. robusta_api-0.0.0/src/robusta/core/playbooks/actions_registry.py +109 -0
  43. robusta_api-0.0.0/src/robusta/core/playbooks/base_trigger.py +36 -0
  44. robusta_api-0.0.0/src/robusta/core/playbooks/common.py +121 -0
  45. robusta_api-0.0.0/src/robusta/core/playbooks/container_playbook_utils.py +69 -0
  46. robusta_api-0.0.0/src/robusta/core/playbooks/crash_reporter.py +65 -0
  47. robusta_api-0.0.0/src/robusta/core/playbooks/generation.py +131 -0
  48. robusta_api-0.0.0/src/robusta/core/playbooks/internal/discovery_events.py +87 -0
  49. robusta_api-0.0.0/src/robusta/core/playbooks/job_utils.py +47 -0
  50. robusta_api-0.0.0/src/robusta/core/playbooks/node_playbook_utils.py +28 -0
  51. robusta_api-0.0.0/src/robusta/core/playbooks/oom_killer_utils.py +95 -0
  52. robusta_api-0.0.0/src/robusta/core/playbooks/playbook_utils.py +67 -0
  53. robusta_api-0.0.0/src/robusta/core/playbooks/playbooks_event_handler.py +76 -0
  54. robusta_api-0.0.0/src/robusta/core/playbooks/playbooks_event_handler_impl.py +365 -0
  55. robusta_api-0.0.0/src/robusta/core/playbooks/pod_utils/crashloop_utils.py +62 -0
  56. robusta_api-0.0.0/src/robusta/core/playbooks/pod_utils/imagepull_utils.py +229 -0
  57. robusta_api-0.0.0/src/robusta/core/playbooks/pod_utils/pending_pod_utils.py +162 -0
  58. robusta_api-0.0.0/src/robusta/core/playbooks/prometheus_enrichment_utils.py +542 -0
  59. robusta_api-0.0.0/src/robusta/core/playbooks/trigger.py +27 -0
  60. robusta_api-0.0.0/src/robusta/core/pubsub/__init__.py +0 -0
  61. robusta_api-0.0.0/src/robusta/core/pubsub/event_emitter.py +7 -0
  62. robusta_api-0.0.0/src/robusta/core/pubsub/event_subscriber.py +17 -0
  63. robusta_api-0.0.0/src/robusta/core/pubsub/events_pubsub.py +20 -0
  64. robusta_api-0.0.0/src/robusta/core/reporting/__init__.py +67 -0
  65. robusta_api-0.0.0/src/robusta/core/reporting/action_requests.py +57 -0
  66. robusta_api-0.0.0/src/robusta/core/reporting/base.py +383 -0
  67. robusta_api-0.0.0/src/robusta/core/reporting/blocks.py +820 -0
  68. robusta_api-0.0.0/src/robusta/core/reporting/callbacks.py +49 -0
  69. robusta_api-0.0.0/src/robusta/core/reporting/consts.py +96 -0
  70. robusta_api-0.0.0/src/robusta/core/reporting/custom_rendering.py +76 -0
  71. robusta_api-0.0.0/src/robusta/core/reporting/finding_subjects.py +52 -0
  72. robusta_api-0.0.0/src/robusta/core/reporting/utils.py +46 -0
  73. robusta_api-0.0.0/src/robusta/core/schedule/__init__.py +0 -0
  74. robusta_api-0.0.0/src/robusta/core/schedule/model.py +47 -0
  75. robusta_api-0.0.0/src/robusta/core/schedule/scheduler.py +153 -0
  76. robusta_api-0.0.0/src/robusta/core/sinks/__init__.py +3 -0
  77. robusta_api-0.0.0/src/robusta/core/sinks/common/__init__.py +1 -0
  78. robusta_api-0.0.0/src/robusta/core/sinks/common/channel_transformer.py +106 -0
  79. robusta_api-0.0.0/src/robusta/core/sinks/common/html_tools.py +108 -0
  80. robusta_api-0.0.0/src/robusta/core/sinks/datadog/__init__.py +2 -0
  81. robusta_api-0.0.0/src/robusta/core/sinks/datadog/datadog_sink.py +127 -0
  82. robusta_api-0.0.0/src/robusta/core/sinks/datadog/datadog_sink_params.py +17 -0
  83. robusta_api-0.0.0/src/robusta/core/sinks/discord/__init__.py +2 -0
  84. robusta_api-0.0.0/src/robusta/core/sinks/discord/discord_sink.py +15 -0
  85. robusta_api-0.0.0/src/robusta/core/sinks/discord/discord_sink_params.py +17 -0
  86. robusta_api-0.0.0/src/robusta/core/sinks/file/__init__.py +0 -0
  87. robusta_api-0.0.0/src/robusta/core/sinks/file/file_sink.py +33 -0
  88. robusta_api-0.0.0/src/robusta/core/sinks/file/file_sink_params.py +19 -0
  89. robusta_api-0.0.0/src/robusta/core/sinks/file/object_traverser.py +90 -0
  90. robusta_api-0.0.0/src/robusta/core/sinks/google_chat/__init__.py +0 -0
  91. robusta_api-0.0.0/src/robusta/core/sinks/google_chat/google_chat.py +19 -0
  92. robusta_api-0.0.0/src/robusta/core/sinks/google_chat/google_chat_params.py +19 -0
  93. robusta_api-0.0.0/src/robusta/core/sinks/jira/__init__.py +2 -0
  94. robusta_api-0.0.0/src/robusta/core/sinks/jira/jira_sink.py +15 -0
  95. robusta_api-0.0.0/src/robusta/core/sinks/jira/jira_sink_params.py +31 -0
  96. robusta_api-0.0.0/src/robusta/core/sinks/kafka/__init__.py +2 -0
  97. robusta_api-0.0.0/src/robusta/core/sinks/kafka/kafka_sink.py +80 -0
  98. robusta_api-0.0.0/src/robusta/core/sinks/kafka/kafka_sink_params.py +19 -0
  99. robusta_api-0.0.0/src/robusta/core/sinks/mail/__init__.py +0 -0
  100. robusta_api-0.0.0/src/robusta/core/sinks/mail/mail_sink.py +18 -0
  101. robusta_api-0.0.0/src/robusta/core/sinks/mail/mail_sink_params.py +27 -0
  102. robusta_api-0.0.0/src/robusta/core/sinks/mattermost/__init__.py +2 -0
  103. robusta_api-0.0.0/src/robusta/core/sinks/mattermost/mattermost_sink.py +26 -0
  104. robusta_api-0.0.0/src/robusta/core/sinks/mattermost/mattermost_sink_params.py +35 -0
  105. robusta_api-0.0.0/src/robusta/core/sinks/msteams/__init__.py +2 -0
  106. robusta_api-0.0.0/src/robusta/core/sinks/msteams/msteams_sink.py +15 -0
  107. robusta_api-0.0.0/src/robusta/core/sinks/msteams/msteams_sink_params.py +17 -0
  108. robusta_api-0.0.0/src/robusta/core/sinks/opsgenie/__init__.py +2 -0
  109. robusta_api-0.0.0/src/robusta/core/sinks/opsgenie/opsgenie_sink.py +103 -0
  110. robusta_api-0.0.0/src/robusta/core/sinks/opsgenie/opsgenie_sink_params.py +22 -0
  111. robusta_api-0.0.0/src/robusta/core/sinks/pagerduty/__init__.py +2 -0
  112. robusta_api-0.0.0/src/robusta/core/sinks/pagerduty/pagerduty_sink.py +254 -0
  113. robusta_api-0.0.0/src/robusta/core/sinks/pagerduty/pagerduty_sink_params.py +17 -0
  114. robusta_api-0.0.0/src/robusta/core/sinks/pushover/__init__.py +2 -0
  115. robusta_api-0.0.0/src/robusta/core/sinks/pushover/pushover_client.py +60 -0
  116. robusta_api-0.0.0/src/robusta/core/sinks/pushover/pushover_sink.py +123 -0
  117. robusta_api-0.0.0/src/robusta/core/sinks/pushover/pushover_sink_params.py +22 -0
  118. robusta_api-0.0.0/src/robusta/core/sinks/robusta/__init__.py +2 -0
  119. robusta_api-0.0.0/src/robusta/core/sinks/robusta/dal/__init__.py +0 -0
  120. robusta_api-0.0.0/src/robusta/core/sinks/robusta/dal/model_conversion.py +203 -0
  121. robusta_api-0.0.0/src/robusta/core/sinks/robusta/dal/supabase_dal.py +712 -0
  122. robusta_api-0.0.0/src/robusta/core/sinks/robusta/discovery_metrics.py +30 -0
  123. robusta_api-0.0.0/src/robusta/core/sinks/robusta/prometheus_health_checker.py +108 -0
  124. robusta_api-0.0.0/src/robusta/core/sinks/robusta/robusta_sink.py +675 -0
  125. robusta_api-0.0.0/src/robusta/core/sinks/robusta/robusta_sink_params.py +29 -0
  126. robusta_api-0.0.0/src/robusta/core/sinks/robusta/rrm/__init__.py +0 -0
  127. robusta_api-0.0.0/src/robusta/core/sinks/robusta/rrm/account_resource_fetcher.py +22 -0
  128. robusta_api-0.0.0/src/robusta/core/sinks/robusta/rrm/base_resource_manager.py +13 -0
  129. robusta_api-0.0.0/src/robusta/core/sinks/robusta/rrm/prometheus_alert_resource_manager.py +202 -0
  130. robusta_api-0.0.0/src/robusta/core/sinks/robusta/rrm/rrm.py +85 -0
  131. robusta_api-0.0.0/src/robusta/core/sinks/robusta/rrm/types.py +62 -0
  132. robusta_api-0.0.0/src/robusta/core/sinks/rocketchat/__init__.py +0 -0
  133. robusta_api-0.0.0/src/robusta/core/sinks/rocketchat/rocketchat_sink.py +19 -0
  134. robusta_api-0.0.0/src/robusta/core/sinks/rocketchat/rocketchat_sink_params.py +27 -0
  135. robusta_api-0.0.0/src/robusta/core/sinks/servicenow/__init__.py +0 -0
  136. robusta_api-0.0.0/src/robusta/core/sinks/servicenow/servicenow_sink.py +15 -0
  137. robusta_api-0.0.0/src/robusta/core/sinks/servicenow/servicenow_sink_params.py +24 -0
  138. robusta_api-0.0.0/src/robusta/core/sinks/sink_base.py +185 -0
  139. robusta_api-0.0.0/src/robusta/core/sinks/sink_base_params.py +158 -0
  140. robusta_api-0.0.0/src/robusta/core/sinks/sink_config.py +15 -0
  141. robusta_api-0.0.0/src/robusta/core/sinks/sink_factory.py +64 -0
  142. robusta_api-0.0.0/src/robusta/core/sinks/slack/__init__.py +2 -0
  143. robusta_api-0.0.0/src/robusta/core/sinks/slack/slack_sink.py +80 -0
  144. robusta_api-0.0.0/src/robusta/core/sinks/slack/slack_sink_params.py +32 -0
  145. robusta_api-0.0.0/src/robusta/core/sinks/telegram/__init__.py +2 -0
  146. robusta_api-0.0.0/src/robusta/core/sinks/telegram/telegram_client.py +47 -0
  147. robusta_api-0.0.0/src/robusta/core/sinks/telegram/telegram_sink.py +93 -0
  148. robusta_api-0.0.0/src/robusta/core/sinks/telegram/telegram_sink_params.py +22 -0
  149. robusta_api-0.0.0/src/robusta/core/sinks/timing.py +67 -0
  150. robusta_api-0.0.0/src/robusta/core/sinks/transformer.py +262 -0
  151. robusta_api-0.0.0/src/robusta/core/sinks/victorops/__init__.py +2 -0
  152. robusta_api-0.0.0/src/robusta/core/sinks/victorops/victorops_sink.py +82 -0
  153. robusta_api-0.0.0/src/robusta/core/sinks/victorops/victorops_sink_params.py +17 -0
  154. robusta_api-0.0.0/src/robusta/core/sinks/webex/__init__.py +2 -0
  155. robusta_api-0.0.0/src/robusta/core/sinks/webex/webex_sink.py +20 -0
  156. robusta_api-0.0.0/src/robusta/core/sinks/webex/webex_sink_params.py +18 -0
  157. robusta_api-0.0.0/src/robusta/core/sinks/webhook/__init__.py +2 -0
  158. robusta_api-0.0.0/src/robusta/core/sinks/webhook/webhook_sink.py +140 -0
  159. robusta_api-0.0.0/src/robusta/core/sinks/webhook/webhook_sink_params.py +23 -0
  160. robusta_api-0.0.0/src/robusta/core/sinks/yamessenger/__init__.py +2 -0
  161. robusta_api-0.0.0/src/robusta/core/sinks/yamessenger/yamessenger_client.py +84 -0
  162. robusta_api-0.0.0/src/robusta/core/sinks/yamessenger/yamessenger_sink.py +96 -0
  163. robusta_api-0.0.0/src/robusta/core/sinks/yamessenger/yamessenger_sink_params.py +30 -0
  164. robusta_api-0.0.0/src/robusta/core/sinks/zulip/__init__.py +2 -0
  165. robusta_api-0.0.0/src/robusta/core/sinks/zulip/zulip_sink.py +32 -0
  166. robusta_api-0.0.0/src/robusta/core/sinks/zulip/zulip_sink_params.py +28 -0
  167. robusta_api-0.0.0/src/robusta/core/triggers/container_oom_killed_trigger.py +32 -0
  168. robusta_api-0.0.0/src/robusta/core/triggers/custom_triggers.py +31 -0
  169. robusta_api-0.0.0/src/robusta/core/triggers/error_event_trigger.py +150 -0
  170. robusta_api-0.0.0/src/robusta/core/triggers/helm_releases_triggers.py +176 -0
  171. robusta_api-0.0.0/src/robusta/core/triggers/job_failed_trigger.py +53 -0
  172. robusta_api-0.0.0/src/robusta/core/triggers/multi_resources_trigger.py +59 -0
  173. robusta_api-0.0.0/src/robusta/core/triggers/oom_killed_trigger_base.py +110 -0
  174. robusta_api-0.0.0/src/robusta/core/triggers/pod_crash_loop_trigger.py +75 -0
  175. robusta_api-0.0.0/src/robusta/core/triggers/pod_evicted_trigger.py +55 -0
  176. robusta_api-0.0.0/src/robusta/core/triggers/pod_image_pull_backoff.py +83 -0
  177. robusta_api-0.0.0/src/robusta/core/triggers/pod_oom_killed_trigger.py +32 -0
  178. robusta_api-0.0.0/src/robusta/integrations/__init__.py +0 -0
  179. robusta_api-0.0.0/src/robusta/integrations/argocd/argocd_client.py +25 -0
  180. robusta_api-0.0.0/src/robusta/integrations/common/__init__.py +0 -0
  181. robusta_api-0.0.0/src/robusta/integrations/common/requests.py +72 -0
  182. robusta_api-0.0.0/src/robusta/integrations/discord/__init__.py +0 -0
  183. robusta_api-0.0.0/src/robusta/integrations/discord/sender.py +300 -0
  184. robusta_api-0.0.0/src/robusta/integrations/git/__init__.py +0 -0
  185. robusta_api-0.0.0/src/robusta/integrations/git/git_repo.py +296 -0
  186. robusta_api-0.0.0/src/robusta/integrations/git/well_known_hosts.py +16 -0
  187. robusta_api-0.0.0/src/robusta/integrations/google_chat/__init__.py +0 -0
  188. robusta_api-0.0.0/src/robusta/integrations/google_chat/sender.py +143 -0
  189. robusta_api-0.0.0/src/robusta/integrations/grafana.py +118 -0
  190. robusta_api-0.0.0/src/robusta/integrations/helper.py +16 -0
  191. robusta_api-0.0.0/src/robusta/integrations/jira/__init__.py +0 -0
  192. robusta_api-0.0.0/src/robusta/integrations/jira/client.py +294 -0
  193. robusta_api-0.0.0/src/robusta/integrations/jira/sender.py +252 -0
  194. robusta_api-0.0.0/src/robusta/integrations/kubernetes/__init__.py +0 -0
  195. robusta_api-0.0.0/src/robusta/integrations/kubernetes/api_client_utils.py +288 -0
  196. robusta_api-0.0.0/src/robusta/integrations/kubernetes/autogenerated/__init__.py +0 -0
  197. robusta_api-0.0.0/src/robusta/integrations/kubernetes/autogenerated/events.py +1219 -0
  198. robusta_api-0.0.0/src/robusta/integrations/kubernetes/autogenerated/models.py +12 -0
  199. robusta_api-0.0.0/src/robusta/integrations/kubernetes/autogenerated/triggers.py +2035 -0
  200. robusta_api-0.0.0/src/robusta/integrations/kubernetes/autogenerated/v1/__init__.py +0 -0
  201. robusta_api-0.0.0/src/robusta/integrations/kubernetes/autogenerated/v1/models.py +27 -0
  202. robusta_api-0.0.0/src/robusta/integrations/kubernetes/base_event.py +33 -0
  203. robusta_api-0.0.0/src/robusta/integrations/kubernetes/base_triggers.py +282 -0
  204. robusta_api-0.0.0/src/robusta/integrations/kubernetes/custom_models.py +775 -0
  205. robusta_api-0.0.0/src/robusta/integrations/kubernetes/model_not_found_exception.py +4 -0
  206. robusta_api-0.0.0/src/robusta/integrations/kubernetes/process_utils.py +125 -0
  207. robusta_api-0.0.0/src/robusta/integrations/kubernetes/templates.py +31 -0
  208. robusta_api-0.0.0/src/robusta/integrations/mail/__init__.py +0 -0
  209. robusta_api-0.0.0/src/robusta/integrations/mail/sender.py +109 -0
  210. robusta_api-0.0.0/src/robusta/integrations/mattermost/__init__.py +0 -0
  211. robusta_api-0.0.0/src/robusta/integrations/mattermost/client.py +167 -0
  212. robusta_api-0.0.0/src/robusta/integrations/mattermost/sender.py +169 -0
  213. robusta_api-0.0.0/src/robusta/integrations/msteams/__init__.py +1 -0
  214. robusta_api-0.0.0/src/robusta/integrations/msteams/msteams_adaptive_card_files.py +27 -0
  215. robusta_api-0.0.0/src/robusta/integrations/msteams/msteams_adaptive_card_files_image.py +69 -0
  216. robusta_api-0.0.0/src/robusta/integrations/msteams/msteams_adaptive_card_files_text.py +170 -0
  217. robusta_api-0.0.0/src/robusta/integrations/msteams/msteams_elements/__init__.py +0 -0
  218. robusta_api-0.0.0/src/robusta/integrations/msteams/msteams_elements/msteams_action.py +28 -0
  219. robusta_api-0.0.0/src/robusta/integrations/msteams/msteams_elements/msteams_base.py +6 -0
  220. robusta_api-0.0.0/src/robusta/integrations/msteams/msteams_elements/msteams_card.py +20 -0
  221. robusta_api-0.0.0/src/robusta/integrations/msteams/msteams_elements/msteams_column.py +38 -0
  222. robusta_api-0.0.0/src/robusta/integrations/msteams/msteams_elements/msteams_container.py +24 -0
  223. robusta_api-0.0.0/src/robusta/integrations/msteams/msteams_elements/msteams_images.py +22 -0
  224. robusta_api-0.0.0/src/robusta/integrations/msteams/msteams_elements/msteams_table.py +24 -0
  225. robusta_api-0.0.0/src/robusta/integrations/msteams/msteams_elements/msteams_text_block.py +74 -0
  226. robusta_api-0.0.0/src/robusta/integrations/msteams/msteams_mark_down_fix_url.py +22 -0
  227. robusta_api-0.0.0/src/robusta/integrations/msteams/msteams_msg.py +184 -0
  228. robusta_api-0.0.0/src/robusta/integrations/msteams/sender.py +66 -0
  229. robusta_api-0.0.0/src/robusta/integrations/openshift/__init__.py +1 -0
  230. robusta_api-0.0.0/src/robusta/integrations/openshift/token.py +17 -0
  231. robusta_api-0.0.0/src/robusta/integrations/prometheus/__init__.py +0 -0
  232. robusta_api-0.0.0/src/robusta/integrations/prometheus/models.py +235 -0
  233. robusta_api-0.0.0/src/robusta/integrations/prometheus/trigger.py +207 -0
  234. robusta_api-0.0.0/src/robusta/integrations/prometheus/utils.py +178 -0
  235. robusta_api-0.0.0/src/robusta/integrations/receiver.py +346 -0
  236. robusta_api-0.0.0/src/robusta/integrations/resource_analysis/__init__.py +0 -0
  237. robusta_api-0.0.0/src/robusta/integrations/resource_analysis/cpu_analyzer.py +28 -0
  238. robusta_api-0.0.0/src/robusta/integrations/resource_analysis/memory_analyzer.py +138 -0
  239. robusta_api-0.0.0/src/robusta/integrations/resource_analysis/node_cpu_analyzer.py +96 -0
  240. robusta_api-0.0.0/src/robusta/integrations/resource_analysis/prometheus_analyzer.py +49 -0
  241. robusta_api-0.0.0/src/robusta/integrations/rocketchat/__init__.py +0 -0
  242. robusta_api-0.0.0/src/robusta/integrations/rocketchat/sender.py +371 -0
  243. robusta_api-0.0.0/src/robusta/integrations/scheduled/__init__.py +0 -0
  244. robusta_api-0.0.0/src/robusta/integrations/scheduled/event.py +19 -0
  245. robusta_api-0.0.0/src/robusta/integrations/scheduled/models.py +7 -0
  246. robusta_api-0.0.0/src/robusta/integrations/scheduled/playbook_scheduler.py +19 -0
  247. robusta_api-0.0.0/src/robusta/integrations/scheduled/playbook_scheduler_manager.py +10 -0
  248. robusta_api-0.0.0/src/robusta/integrations/scheduled/playbook_scheduler_manager_impl.py +127 -0
  249. robusta_api-0.0.0/src/robusta/integrations/scheduled/trigger.py +55 -0
  250. robusta_api-0.0.0/src/robusta/integrations/servicenow/__init__.py +0 -0
  251. robusta_api-0.0.0/src/robusta/integrations/servicenow/sender.py +138 -0
  252. robusta_api-0.0.0/src/robusta/integrations/slack/__init__.py +1 -0
  253. robusta_api-0.0.0/src/robusta/integrations/slack/sender.py +519 -0
  254. robusta_api-0.0.0/src/robusta/integrations/webex/__init__.py +0 -0
  255. robusta_api-0.0.0/src/robusta/integrations/webex/sender.py +193 -0
  256. robusta_api-0.0.0/src/robusta/integrations/zulip/__init__.py +1 -0
  257. robusta_api-0.0.0/src/robusta/integrations/zulip/sender.py +171 -0
  258. robusta_api-0.0.0/src/robusta/model/alert_relabel_config.py +14 -0
  259. robusta_api-0.0.0/src/robusta/model/config.py +223 -0
  260. robusta_api-0.0.0/src/robusta/model/playbook_action.py +23 -0
  261. robusta_api-0.0.0/src/robusta/model/playbook_definition.py +44 -0
  262. robusta_api-0.0.0/src/robusta/patch/patch.py +167 -0
  263. robusta_api-0.0.0/src/robusta/runner/__init__.py +0 -0
  264. robusta_api-0.0.0/src/robusta/runner/config_loader.py +286 -0
  265. robusta_api-0.0.0/src/robusta/runner/log_init.py +21 -0
  266. robusta_api-0.0.0/src/robusta/runner/main.py +53 -0
  267. robusta_api-0.0.0/src/robusta/runner/not_found_exception.py +5 -0
  268. robusta_api-0.0.0/src/robusta/runner/object_updater.py +14 -0
  269. robusta_api-0.0.0/src/robusta/runner/process_setup.py +21 -0
  270. robusta_api-0.0.0/src/robusta/runner/ssl_utils.py +40 -0
  271. robusta_api-0.0.0/src/robusta/runner/telemetry.py +21 -0
  272. robusta_api-0.0.0/src/robusta/runner/telemetry_service.py +64 -0
  273. robusta_api-0.0.0/src/robusta/runner/web.py +166 -0
  274. robusta_api-0.0.0/src/robusta/runner/web_api.py +84 -0
  275. robusta_api-0.0.0/src/robusta/utils/__init__.py +0 -0
  276. robusta_api-0.0.0/src/robusta/utils/auth_provider.py +54 -0
  277. robusta_api-0.0.0/src/robusta/utils/base64_utils.py +9 -0
  278. robusta_api-0.0.0/src/robusta/utils/cluster_provider_discovery.py +111 -0
  279. robusta_api-0.0.0/src/robusta/utils/common.py +43 -0
  280. robusta_api-0.0.0/src/robusta/utils/decorators.py +22 -0
  281. robusta_api-0.0.0/src/robusta/utils/docs.py +52 -0
  282. robusta_api-0.0.0/src/robusta/utils/documented_pydantic.py +61 -0
  283. robusta_api-0.0.0/src/robusta/utils/error_codes.py +41 -0
  284. robusta_api-0.0.0/src/robusta/utils/file_system_watcher.py +49 -0
  285. robusta_api-0.0.0/src/robusta/utils/function_hashes.py +24 -0
  286. robusta_api-0.0.0/src/robusta/utils/json_schema.py +162 -0
  287. robusta_api-0.0.0/src/robusta/utils/parsing.py +23 -0
  288. robusta_api-0.0.0/src/robusta/utils/rate_limiter.py +29 -0
  289. robusta_api-0.0.0/src/robusta/utils/scope.py +95 -0
  290. robusta_api-0.0.0/src/robusta/utils/server_start.py +15 -0
  291. robusta_api-0.0.0/src/robusta/utils/service_discovery.py +25 -0
  292. robusta_api-0.0.0/src/robusta/utils/silence_utils.py +170 -0
  293. robusta_api-0.0.0/src/robusta/utils/stack_tracer.py +25 -0
  294. robusta_api-0.0.0/src/robusta/utils/task_queue.py +73 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021-2023 Robusta Dev Ltd
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,60 @@
1
+ Metadata-Version: 2.1
2
+ Name: robusta-api
3
+ Version: 0.0.0
4
+ Summary:
5
+ Author: Arik Alon
6
+ Author-email: arikalon1@users.noreply.github.com
7
+ Requires-Python: >=3.8,<3.11
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Programming Language :: Python :: 3.8
10
+ Classifier: Programming Language :: Python :: 3.9
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Provides-Extra: all
13
+ Requires-Dist: CairoSVG (>=2.5.2,<3.0.0) ; extra == "all"
14
+ Requires-Dist: Flask (>=3.0.0,<4.0.0) ; extra == "all"
15
+ Requires-Dist: PyJWT (==2.4.0)
16
+ Requires-Dist: apprise (>=1.5.0,<2.0.0)
17
+ Requires-Dist: attrs (>=23.1.0,<24.0.0)
18
+ Requires-Dist: better-exceptions (>=0.3.3,<0.4.0) ; extra == "all"
19
+ Requires-Dist: bitmath (>=1.3.3.1,<2.0.0.0)
20
+ Requires-Dist: boto3 (==1.28.72)
21
+ Requires-Dist: botocore (==1.31.72)
22
+ Requires-Dist: click-spinner (>=0.1.10,<0.2.0)
23
+ Requires-Dist: colorlog (>=5.0.1,<6.0.0)
24
+ Requires-Dist: croniter (>=1.3.15,<2.0.0)
25
+ Requires-Dist: cryptography (>=42.0.5,<43.0.0)
26
+ Requires-Dist: datadog-api-client (>=1.2.0,<2.0.0) ; extra == "all"
27
+ Requires-Dist: docutils (==0.19)
28
+ Requires-Dist: dpath (>=2.0.5,<3.0.0)
29
+ Requires-Dist: dulwich (==0.20.28) ; extra == "all"
30
+ Requires-Dist: fpdf2 (>=2.7.1,<3.0.0)
31
+ Requires-Dist: grafana-api (>=1.0.3,<2.0.0) ; extra == "all"
32
+ Requires-Dist: hikaru-model-26 (>=1.1.1,<2.0.0)
33
+ Requires-Dist: humanize (>=3.13.1,<4.0.0)
34
+ Requires-Dist: idna (>=3.7)
35
+ Requires-Dist: jinja2 (>=3.1.4)
36
+ Requires-Dist: kafka-python (>=2.0.2,<3.0.0) ; extra == "all"
37
+ Requires-Dist: kubernetes (>=26.1.0,<27.0.0)
38
+ Requires-Dist: markdown2 (>=2.4.2,<3.0.0)
39
+ Requires-Dist: opsgenie-sdk (>=2.1.5,<3.0.0)
40
+ Requires-Dist: poetry-core (==1.1.0a7) ; extra == "all"
41
+ Requires-Dist: prometheus-client (>=0.12.0,<0.13.0)
42
+ Requires-Dist: prometrix (==0.1.16)
43
+ Requires-Dist: pydantic (>=1.8.1,<2.0.0)
44
+ Requires-Dist: pydash (==8.0.0)
45
+ Requires-Dist: pymsteams (>=0.1.16,<0.2.0)
46
+ Requires-Dist: pytz (>=2021.3,<2022.0)
47
+ Requires-Dist: pyyaml (>=6.0,<7.0)
48
+ Requires-Dist: rocketchat-api (>=1.30.0,<2.0.0)
49
+ Requires-Dist: sentry-sdk (>=1.5.2,<2.0.0) ; extra == "all"
50
+ Requires-Dist: setuptools (>=68.2.2,<69.0.0)
51
+ Requires-Dist: slack-sdk (>=3.23.0,<4.0.0)
52
+ Requires-Dist: supabase (>=2.4,<3.0) ; extra == "all"
53
+ Requires-Dist: tabulate (>=0.8.10,<0.9.0) ; extra == "all"
54
+ Requires-Dist: toml (>=0.10.2,<0.11.0)
55
+ Requires-Dist: typer (>=0.4.1,<0.5.0)
56
+ Requires-Dist: watchdog (>=2.1.0,<3.0.0) ; extra == "all"
57
+ Requires-Dist: watchgod (>=0.7,<0.8)
58
+ Requires-Dist: webexteamssdk (>=1.6.1,<2.0.0)
59
+ Requires-Dist: websocket-client (==1.3.3)
60
+ Requires-Dist: werkzeug (>=3.0.3)
@@ -0,0 +1,138 @@
1
+ [tool.poetry]
2
+ name = "robusta-api"
3
+ version = "0.0.0"
4
+ description = ""
5
+ authors = ["Arik Alon <arikalon1@users.noreply.github.com>"]
6
+ packages = [
7
+ { include = "robusta", from = "src" },
8
+ ]
9
+
10
+ [tool.black]
11
+ line-length = 120
12
+ target-version = ['py37']
13
+
14
+ [tool.isort]
15
+ line_length = 120
16
+ multi_line_output = 3
17
+ include_trailing_comma = true
18
+
19
+
20
+ [tool.poetry.dependencies]
21
+ # Robusta CLI should work on 3.8, but the core code requires 3.9+. Both
22
+ # are known not to work on 3.11. Unfortunately this spec is shared between
23
+ # the CLI and core, so we have to specify 3.8+.
24
+ python = "^3.8, <3.11"
25
+ setuptools = "^68.2.2"
26
+ typer = "^0.4.1"
27
+ colorlog = "^5.0.1"
28
+ pydantic = "^1.8.1"
29
+ kubernetes = "^26.1.0"
30
+ click-spinner = "^0.1.10"
31
+ pymsteams = "^0.1.16"
32
+ idna= { version = ">=3.7", optional = true }
33
+ supabase = "^2.4"
34
+ tabulate = { version = "^0.8.10" }
35
+ slack-sdk = { version = "^3.23.0" }
36
+ Flask = { version = "^3.0.0", optional = true }
37
+ werkzeug = { version = ">=3.0.3", optional = true }
38
+ jinja2 = { version = ">=3.1.4", optional = true }
39
+ grafana-api = { version = "^1.0.3", optional = true }
40
+ watchdog = { version = "^2.1.0", optional = true }
41
+ better-exceptions = { version = "^0.3.3", optional = true }
42
+ CairoSVG = { version = "^2.5.2", optional = true }
43
+ kafka-python = { version = "^2.0.2", optional = true }
44
+ datadog-api-client = { version = "^1.2.0", optional = true }
45
+ dpath = "^2.0.5"
46
+ websocket-client = "1.3.3"
47
+ prometheus-client = "^0.12.0"
48
+ pyyaml = "^6.0"
49
+ pytz = "^2021.3"
50
+ poetry-core = "1.1.0a7"
51
+ docutils="0.19"
52
+ sentry-sdk = { version = "^1.5.2", optional = true }
53
+ opsgenie-sdk = "^2.1.5"
54
+ markdown2 = "^2.4.2"
55
+ toml = "^0.10.2"
56
+ watchgod = "^0.7"
57
+ webexteamssdk = "^1.6.1"
58
+ bitmath = "^1.3.3.1"
59
+ croniter = "^1.3.15"
60
+ humanize = "^3.13.1"
61
+ # we're freezing a specific version here because the latest version doesn't have prebuilt wheels on pypi
62
+ # and therefore requires gcc to install which we'd like to avoid
63
+ # this is similar to the issue at https://github.com/dulwich/dulwich/issues/839
64
+ dulwich = { version = "0.20.28", optional = true }
65
+ cryptography = "^42.0.5"
66
+ PyJWT = "2.4.0"
67
+ fpdf2 = "^2.7.1"
68
+ attrs = "^23.1.0"
69
+ prometrix = "0.1.16"
70
+ hikaru-model-26 = "^1.1.1"
71
+ apprise = "^1.5.0"
72
+ rocketchat-api = "^1.30.0"
73
+ pydash = "8.0.0"
74
+ # The following are added to speed up poetry dependency resolution
75
+ botocore = "1.31.72"
76
+ boto3 = "1.28.72"
77
+
78
+ [tool.poetry.dev-dependencies]
79
+ pre-commit = "^2.13.0"
80
+ pytest = "^6.2.4"
81
+ python-dotenv = "^0.18.0"
82
+ Sphinx = "6.2.1"
83
+ #furo = "^2021.11.12"
84
+ sphinx-autobuild = "^2021.3.14"
85
+ sphinx-copybutton = "^0.4.0"
86
+ sphinx-design = "0.5.0"
87
+ witchhazel = "^2018.8.23"
88
+ sphinx-autodoc-typehints = "^1.12.0"
89
+ sphinxcontrib-images = "^0.9.4"
90
+ jsonref = "^0.2"
91
+ Pillow = "^10.3.0"
92
+ sphinxcontrib-mermaid = "^0.7.1"
93
+ cssselect = "^1.1.0"
94
+ pygal = "^3.0.0"
95
+ tinycss = "^0.4"
96
+ rsa = "^4.8"
97
+ sphinxcontrib-details-directive = "^0.1.0"
98
+ sphinx-immaterial = { git = "https://github.com/robusta-dev/robusta-immaterial.git" }
99
+ # TODO: Attempt to have different groups (docs, lint, etc) and install them separately
100
+ # Flake8 5.0.4 is the last version that supports Python 3.7
101
+ # As it does not work witn sphynx-immaterial, we need to exclude it from the dev dependencies
102
+ # Please, install it manually if you need to run flake8
103
+ # flake8 = "5.0.4"
104
+ black = "22.3.0"
105
+ mypy = "0.991"
106
+ isort = "5.10.1"
107
+ absolufy-imports = "^0.3.1"
108
+ types-pytz = "^2022.6.0.1"
109
+ types-requests = "^2.28.11.5"
110
+ types-cachetools = "^5.2.1"
111
+ types-PyYAML = "^6.0.0"
112
+ types-click-spinner = "^0.1.10"
113
+ types-toml = "^0.10.2"
114
+ types-tabulate = "^0.8.10"
115
+
116
+ [tool.poetry.extras]
117
+ all = ["Flask", "grafana-api", "watchdog", "dulwich", "better-exceptions", "CairoSVG", "tabulate", "kafka-python", "prometheus-api-client", "supabase", "datadog-api-client", "pygal", "tinycss", "cssselect", "rsa", "sentry-sdk", "poetry-core"]
118
+
119
+ [tool.poetry.group.dev.dependencies]
120
+ sphinx-jinja = { git = "https://github.com/robusta-dev/sphinx-jinja.git" }
121
+ sphinx-reredirects = "^0.1.1"
122
+ freezegun = "^1.4.0"
123
+
124
+ [build-system]
125
+ requires = ["poetry-core>=1.0.0"]
126
+ build-backend = "poetry.core.masonry.api"
127
+
128
+ # https://github.com/mtkennerly/poetry-dynamic-versioning
129
+ # we can use this in github actions by running `poetry run poetry-dynamic-versioning`
130
+ #[tool.poetry-dynamic-versioning]
131
+ #vcs = "git"
132
+ #pattern = "^(?P<base>\\d+\\.\\d+\\.\\d+)"
133
+
134
+ [tool.pytest.ini_options]
135
+ filterwarnings = [
136
+ "ignore::DeprecationWarning",
137
+ "ignore:::slack_sdk"
138
+ ]
File without changes
@@ -0,0 +1,2 @@
1
+ # this is updated by .github/workflows/release.yaml
2
+ __version__ = "0.0.0"
@@ -0,0 +1,330 @@
1
+ from hikaru.model.rel_1_26 import Container, DaemonSet, Deployment, Pod, ReplicaSet, StatefulSet, Volume
2
+
3
+ from robusta.core.discovery.discovery import (
4
+ extract_containers_k8,
5
+ extract_ready_pods,
6
+ extract_total_pods,
7
+ extract_volumes_k8,
8
+ is_pod_finished,
9
+ is_release_managed_by_helm,
10
+ should_report_pod,
11
+ )
12
+ from robusta.core.discovery.resource_names import ResourceNameLister
13
+ from robusta.core.model.base_params import (
14
+ ActionParams,
15
+ AlertResourceGraphEnricherParams,
16
+ BashParams,
17
+ ChartValuesFormat,
18
+ CustomGraphEnricherParams,
19
+ EventEnricherParams,
20
+ FindingKeyParams,
21
+ GrafanaAnnotationParams,
22
+ GrafanaParams,
23
+ LogEnricherParams,
24
+ NamedRegexPattern,
25
+ PodResourceGraphEnricherParams,
26
+ PodRunningParams,
27
+ ProcessParams,
28
+ PrometheusDateRange,
29
+ PrometheusDuration,
30
+ PrometheusParams,
31
+ PrometheusQueryParams,
32
+ RateLimitParams,
33
+ ResourceChartItemType,
34
+ ResourceChartResourceType,
35
+ ResourceGraphEnricherParams,
36
+ OOMGraphEnricherParams,
37
+ OomKillParams,
38
+ TimedPrometheusParams,
39
+ VideoEnricherParams,
40
+ )
41
+ from robusta.core.model.env_vars import (
42
+ CLUSTER_DOMAIN,
43
+ CLUSTER_STATUS_PERIOD_SEC,
44
+ CUSTOM_PLAYBOOKS_ROOT,
45
+ DEFAULT_PLAYBOOKS_PIP_INSTALL,
46
+ DEFAULT_PLAYBOOKS_ROOT,
47
+ DEFAULT_TIMEZONE,
48
+ DISCORD_TABLE_COLUMNS_LIMIT,
49
+ DISCOVERY_PERIOD_SEC,
50
+ ENABLE_TELEMETRY,
51
+ FLOAT_PRECISION_LIMIT,
52
+ GIT_MAX_RETRIES,
53
+ GRAFANA_READ_TIMEOUT,
54
+ GRAFANA_RENDERER_URL,
55
+ IMAGE_REGISTRY,
56
+ INCOMING_EVENTS_QUEUE_MAX_SIZE,
57
+ INCOMING_REQUEST_TIME_WINDOW_SECONDS,
58
+ INSTALLATION_NAMESPACE,
59
+ INTERNAL_PLAYBOOKS_ROOT,
60
+ NUM_EVENT_THREADS,
61
+ PLAYBOOKS_CONFIG_FILE_PATH,
62
+ PLAYBOOKS_ROOT,
63
+ PORT,
64
+ PRINTED_TABLE_MAX_WIDTH,
65
+ PROMETHEUS_ENABLED,
66
+ PROMETHEUS_REQUEST_TIMEOUT_SECONDS,
67
+ RELAY_EXTERNAL_ACTIONS_URL,
68
+ RELEASE_NAME,
69
+ RESOURCE_UPDATES_CACHE_TTL_SEC,
70
+ ROBUSTA_LOGO_URL,
71
+ ROBUSTA_TELEMETRY_ENDPOINT,
72
+ ROBUSTA_UI_DOMAIN,
73
+ RUNNER_SERVICE_ACCOUNT,
74
+ RUNNER_VERSION,
75
+ SEND_ADDITIONAL_TELEMETRY,
76
+ SERVICE_CACHE_MAX_SIZE,
77
+ SERVICE_CACHE_TTL_SEC,
78
+ SLACK_TABLE_COLUMNS_LIMIT,
79
+ TEAMS_IMAGE_WIDTH,
80
+ TELEMETRY_PERIODIC_SEC,
81
+ TRACE_INCOMING_REQUESTS,
82
+ WEBSOCKET_PING_INTERVAL,
83
+ WEBSOCKET_PING_TIMEOUT,
84
+ )
85
+ from robusta.core.model.events import ExecutionBaseEvent
86
+ from robusta.core.model.k8s_operation_type import K8sOperationType
87
+ from robusta.core.model.pods import (
88
+ ContainerResources,
89
+ PodContainer,
90
+ PodResources,
91
+ ResourceAttributes,
92
+ find_most_recent_oom_killed_container,
93
+ format_unit,
94
+ get_oom_kill_time,
95
+ get_oom_killed_container,
96
+ is_state_in_oom_status,
97
+ k8s_memory_factors,
98
+ pod_limits,
99
+ pod_most_recent_oom_killed_container,
100
+ pod_other_requests,
101
+ pod_requests,
102
+ pod_resources,
103
+ pod_restarts,
104
+ )
105
+ from robusta.core.model.services import ContainerInfo, EnvVar, Resources, ServiceConfig, ServiceInfo, VolumeInfo
106
+ from robusta.core.persistency.in_memory import get_persistent_data
107
+ from robusta.core.playbooks.actions_registry import Action, action
108
+ from robusta.core.playbooks.common import get_event_timestamp, get_resource_events, get_resource_events_table
109
+ from robusta.core.playbooks.container_playbook_utils import create_container_graph
110
+ from robusta.core.playbooks.job_utils import CONTROLLER_UID, get_job_all_pods, get_job_latest_pod, get_job_selector
111
+ from robusta.core.playbooks.node_playbook_utils import create_node_graph_enrichment
112
+ from robusta.core.playbooks.pod_utils.crashloop_utils import get_crash_report_enrichments
113
+ from robusta.core.playbooks.pod_utils.imagepull_utils import (
114
+ get_image_pull_backoff_enrichment,
115
+ get_image_pull_backoff_container_statuses,
116
+ )
117
+ from robusta.core.playbooks.pod_utils.pending_pod_utils import get_pending_pod_enrichment
118
+ from robusta.core.playbooks.crash_reporter import send_crash_report
119
+ from robusta.core.playbooks.prometheus_enrichment_utils import (
120
+ XAxisLine,
121
+ create_chart_from_prometheus_query,
122
+ create_graph_enrichment,
123
+ create_resource_enrichment,
124
+ get_node_internal_ip,
125
+ run_prometheus_query,
126
+ run_prometheus_query_range,
127
+ )
128
+ from robusta.core.playbooks.trigger import (
129
+ BaseTrigger,
130
+ CustomTriggers,
131
+ K8sTriggers,
132
+ PrometheusAlertTriggers,
133
+ ScheduledTriggers,
134
+ Trigger,
135
+ )
136
+ from robusta.core.reporting import (
137
+ BaseBlock,
138
+ CallbackBlock,
139
+ CallbackChoice,
140
+ DividerBlock,
141
+ Emojis,
142
+ Enrichment,
143
+ FileBlock,
144
+ EmptyFileBlock,
145
+ Filterable,
146
+ Finding,
147
+ FindingSeverity,
148
+ FindingStatus,
149
+ FindingSubject,
150
+ HeaderBlock,
151
+ JsonBlock,
152
+ KubernetesDiffBlock,
153
+ KubernetesFieldsBlock,
154
+ ListBlock,
155
+ MarkdownBlock,
156
+ PrometheusBlock,
157
+ ScanReportBlock,
158
+ PopeyeScanReportBlock,
159
+ KRRScanReportBlock,
160
+ ScanReportRow,
161
+ TableBlock,
162
+ VideoLink,
163
+ )
164
+
165
+ from robusta.core.reporting.base import EnrichmentType
166
+ from robusta.core.reporting.blocks import GraphBlock
167
+ from robusta.core.reporting.action_requests import (
168
+ ActionRequestBody,
169
+ ExternalActionRequest,
170
+ OutgoingActionRequest,
171
+ PartialAuth,
172
+ sign_action_request,
173
+ )
174
+ from robusta.core.reporting.callbacks import ExternalActionRequestBuilder
175
+ from robusta.core.reporting.consts import (
176
+ EnrichmentAnnotation,
177
+ FindingAggregationKey,
178
+ FindingSource,
179
+ FindingSubjectType,
180
+ FindingType,
181
+ ScanType,
182
+ SlackAnnotations,
183
+ )
184
+ from robusta.core.reporting.custom_rendering import RendererType, charts_style, render_value
185
+ from robusta.core.reporting.finding_subjects import KubeObjFindingSubject, PodFindingSubject
186
+ from robusta.core.schedule.model import (
187
+ DynamicDelayRepeat,
188
+ FixedDelayRepeat,
189
+ JobState,
190
+ JobStatus,
191
+ ScheduledJob,
192
+ SchedulingInfo,
193
+ )
194
+ from robusta.core.playbooks.node_playbook_utils import create_node_graph_enrichment
195
+ from robusta.core.sinks import SinkBase, SinkBaseParams, SinkConfigBase
196
+ from robusta.core.sinks.kafka import KafkaSink, KafkaSinkConfigWrapper, KafkaSinkParams
197
+ from robusta.core.triggers.helm_releases_triggers import HelmReleasesEvent, HelmReleasesTriggerEvent
198
+ from robusta.integrations.argocd.argocd_client import ArgoCDClient
199
+ from robusta.integrations.git.git_repo import ClusterChanges, GitRepo, GitRepoManager, SingleChange
200
+ from robusta.integrations.grafana import Grafana
201
+ from robusta.integrations.kubernetes.api_client_utils import (
202
+ exec_commands,
203
+ exec_shell_command,
204
+ get_pod_logs,
205
+ list_available_services,
206
+ parse_kubernetes_datetime,
207
+ parse_kubernetes_datetime_to_ms,
208
+ parse_kubernetes_datetime_with_ms,
209
+ prepare_pod_command,
210
+ to_kubernetes_name,
211
+ upload_file,
212
+ wait_for_pod_status,
213
+ wait_until,
214
+ wait_until_job_complete,
215
+ )
216
+ from robusta.integrations.kubernetes.autogenerated.events import (
217
+ KIND_TO_EVENT_CLASS,
218
+ LOADERS_MAPPINGS,
219
+ ClusterRoleAttributes,
220
+ ClusterRoleBindingAttributes,
221
+ ClusterRoleBindingChangeEvent,
222
+ ClusterRoleBindingEvent,
223
+ ClusterRoleChangeEvent,
224
+ ClusterRoleEvent,
225
+ ConfigMapAttributes,
226
+ ConfigMapChangeEvent,
227
+ ConfigMapEvent,
228
+ DaemonSetAttributes,
229
+ DaemonSetChangeEvent,
230
+ DaemonSetEvent,
231
+ DeploymentAttributes,
232
+ DeploymentChangeEvent,
233
+ DeploymentEvent,
234
+ EventAttributes,
235
+ EventChangeEvent,
236
+ EventEvent,
237
+ HorizontalPodAutoscalerAttributes,
238
+ HorizontalPodAutoscalerChangeEvent,
239
+ HorizontalPodAutoscalerEvent,
240
+ JobAttributes,
241
+ JobChangeEvent,
242
+ JobEvent,
243
+ KubernetesAnyChangeEvent,
244
+ KubernetesResourceEvent,
245
+ NamespaceAttributes,
246
+ NamespaceChangeEvent,
247
+ NamespaceEvent,
248
+ NodeAttributes,
249
+ NodeChangeEvent,
250
+ NodeEvent,
251
+ PersistentVolumeAttributes,
252
+ PersistentVolumeChangeEvent,
253
+ PersistentVolumeEvent,
254
+ PodAttributes,
255
+ PodChangeEvent,
256
+ PodEvent,
257
+ ReplicaSetAttributes,
258
+ ReplicaSetChangeEvent,
259
+ ReplicaSetEvent,
260
+ ResourceAttributes,
261
+ ResourceLoader,
262
+ ServiceAccountAttributes,
263
+ ServiceAccountChangeEvent,
264
+ ServiceAccountEvent,
265
+ ServiceAttributes,
266
+ ServiceChangeEvent,
267
+ ServiceEvent,
268
+ StatefulSetAttributes,
269
+ StatefulSetChangeEvent,
270
+ StatefulSetEvent,
271
+ )
272
+ from robusta.integrations.kubernetes.autogenerated.models import VERSION_KIND_TO_MODEL_CLASS, get_api_version
273
+ from robusta.integrations.kubernetes.custom_models import (
274
+ JobSecret,
275
+ Process,
276
+ ProcessList,
277
+ RegexReplacementStyle,
278
+ RobustaDeployment,
279
+ RobustaEvent,
280
+ RobustaJob,
281
+ RobustaPod,
282
+ build_selector_query,
283
+ does_daemonset_have_toleration,
284
+ does_node_have_taint,
285
+ extract_image_list,
286
+ extract_images,
287
+ get_images,
288
+ list_pods_using_selector,
289
+ )
290
+ from robusta.integrations.kubernetes.process_utils import ProcessFinder, ProcessType
291
+ from robusta.integrations.prometheus.models import (
292
+ SEVERITY_MAP,
293
+ AlertManagerEvent,
294
+ PrometheusAlert,
295
+ PrometheusKubernetesAlert,
296
+ )
297
+ from robusta.integrations.prometheus.utils import (
298
+ AlertManagerDiscovery,
299
+ PrometheusDiscovery,
300
+ ServiceDiscovery,
301
+ get_prometheus_connect,
302
+ )
303
+ from robusta.integrations.resource_analysis.cpu_analyzer import CpuAnalyzer
304
+ from robusta.integrations.resource_analysis.memory_analyzer import MemoryAnalyzer, pretty_size
305
+ from robusta.integrations.resource_analysis.node_cpu_analyzer import NodeCpuAnalyzer
306
+ from robusta.integrations.scheduled.event import ScheduledExecutionEvent
307
+ from robusta.integrations.scheduled.playbook_scheduler_manager_impl import (
308
+ PlaybooksSchedulerManagerImpl,
309
+ ScheduledIntegrationParams,
310
+ )
311
+ from robusta.integrations.scheduled.trigger import DynamicDelayRepeatTrigger, FixedDelayRepeatTrigger
312
+ from robusta.integrations.slack.sender import SlackSender
313
+ from robusta.runner.object_updater import update_item_attr
314
+ from robusta.utils.base64_utils import is_base64_encoded
315
+ from robusta.utils.cluster_provider_discovery import cluster_provider
316
+ from robusta.utils.common import duplicate_without_fields, is_matching_diff
317
+ from robusta.utils.error_codes import ActionException, ErrorCodes
318
+ from robusta.utils.function_hashes import action_hash
319
+ from robusta.utils.parsing import load_json
320
+ from robusta.utils.rate_limiter import RateLimiter
321
+ from robusta.utils.silence_utils import (
322
+ AddSilenceParams,
323
+ AlertManagerParams,
324
+ DeleteSilenceParams,
325
+ Silence,
326
+ SilenceOperation,
327
+ gen_alertmanager_headers,
328
+ get_alertmanager_url,
329
+ get_alertmanager_url_path,
330
+ )
File without changes