Git Product home page Git Product logo

keep's People

Contributors

35c4n0r avatar artartem avatar asharonbaltazar avatar blaklafter avatar d-lite avatar dependabot[bot] avatar devblin avatar dmarshaltu avatar ezhil56x avatar frwl404 avatar gabrielsamberg avatar kanvabhatia avatar matvey-kuk avatar meetwithyash avatar mobley-trent avatar mohanish2504 avatar nmbarel avatar onurio avatar pehlicd avatar rajeshj11 avatar rmaceissoft avatar rons4 avatar sakthirathinam avatar sc231997 avatar shahargl avatar srikary12 avatar takshpanchal avatar talboren avatar vijay-jangir avatar vladimirfilonov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

keep's Issues

Docs: add a hint about the #alerts-playground channel in the README file.

Is your feature request related to a problem? Please describe.

For beginners who might not have their own slack workspace the #alerts-playground channel could be useful!

Describe the solution you'd like

Just add the link with some explanation to the README :)

Describe alternatives you've considered

Additional context

Enhancement: Merge step and action class implementation (e.g. base class)

Actions and Steps are practically the same entities, but the fact that Actions has conditions (and we want conditions for steps as well) and "throttling" logic, and Step calls query when executed while Actions calls notify.

The reason this is now needed is that we want to add an on-failure strategy for both Actions and Steps and would like to have the same logic implemented for both. (And in general, this can reduce code and complexity).

Update readme to define what an alert is

Is your feature request related to a problem? Please describe.
Feature request

Describe the solution you'd like
Define what an alert is

Additional context
Got this from #devops on SRE

Test coverage automation

Is your feature request related to a problem? Please describe.
There is no automated process that gives a coverage report of the tests when submitting a PR.
If there was one it would be easier to maintain the quality and would allow being in control of the actual coverage changes in real time when submitting new pieces of code.

Describe the solution you'd like
1.Clean up tests.
2. Integration with Codecov.
3. add coverage badge to "readme"

Describe alternatives you've considered
It could be done manually but in is complicated and not justified.

Additional context

Add Zenduty Provider

Is your feature request related to a problem? Please describe.
Zenduty is an incident response and issue management platform that could be plugged into Keep to route incidents.

Describe the solution you'd like
A Zenduty provider similar to other out-of-the-box providers available right now

Add basic "watch the watcher" mechanism

Suggested by Christopher
Original feedback:
"Solve the "who watches the watchmen" problem by including an example that does an http notification to something that can do heartbeat monitoring like Opsgenie. This ties into the need for a known or configurable query/notification interval."

Cover parser with unit test

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Implement Postgresql Provider

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Hot reload alerts from file/url

Is your feature request related to a problem? Please describe.
It is not related with any problem but when changing an alert file/upload new alert file, I'd like to have the option to hot reload the alert instead of having to restart the service.

Describe the solution you'd like
Hot reload alerts from url/file/directory on the fly

Missing ntfy as notification provider

I think adding ntfy as a notification provider would be awesome.

ntfy is an open source free notification service to send notification to you phone/desktop.
You can use a public free server instance, or easily self-host it.
Notifications can include text, images, attachments, action buttons to respond to notifications etc.

IOHandler ast.parse fails when Datadog Client HTML escape the string

This string, which in "rendered", throws
"description='Open " ^ SyntaxError: unterminated string literal (detected at line 321)

"keep.len([{'content': {'attributes': {'attributes': {'logging': {'googleapis': {'com/timestamp': '2023-05-20T09:01:47.727497Z'}}},\n                            'data': {'insertId': '64688c7b000b19c93cd98bd8',\n                                     'jsonPayload': {'asctime': '2023-05-20 '\n                                                                '09:01:47,727',\n                                                     'filename': 'on.py',\n                                                     'levelname': 'INFO',\n                                                     'message': 'Application '\n                                                                'shutdown '\n                                                                'complete.',\n                                                     'name': 'uvicorn.error'},\n                                     'labels': {'commit-sha': '0dfb56efcaf2362e73645a43096f27cbe0cde90e',\n                                                'gcb-build-id': 'd9aa30ad-b22e-45f1-a1e2-9b668c0af037',\n                                                'gcb-trigger-id': '6903d692-6135-45e8-bc32-f25b65334d47',\n                                                'instanceId': '004d9db0beeddba311d7ec2e137989965cffaf47af6d62dc2a0d9fef15125ffc153dd463107ee793deeb07444741c2d2948eed113e78dcf15eaadccdbdd1fde883',\n                                                'managed-by': 'gcp-cloud-build-deploy-cloud-run'},\n                                     'logName': 'projects/keephq-sandbox/logs/run.googleapis.com%2Fstdout',\n                                     'receiveTimestamp': '2023-05-20T09:01:47.95981358Z',\n                                     'resource': {'labels': {'configuration_name': 'keep-github-app',\n                                                             'location': 'us-central1',\n                                                             'project_id': 'keephq-sandbox',\n                                                             'revision_name': 'keep-github-app-00041-4gf',\n                                                             'service_name': 'keep-github-app'},\n                                                  'type': 'cloud_run_revision'},\n                                     'timestamp': '2023-05-20T09:01:47.727497Z'},\n                            'messageId': '7768642501777050',\n                            'message_id': '7768642501777050',\n                            'publishTime': datetime.datetime(2023, 5, 20, 9, 1, 53, 136000, tzinfo=tzutc()),\n                            'publish_time': datetime.datetime(2023, 5, 20, 9, 1, 53, 136000, tzinfo=tzutc()),\n                            'subscription': 'projects/keephq-sandbox/subscriptions/export-logs-to-datadog'},\n             'service': 'keep-github-app',\n             'tags': ['configuration_name:keep-github-app',\n                      'datadog.submission_auth:private_api_key',\n                      'location:us-central1',\n                      'project_id:keephq-sandbox',\n                      'revision_name:keep-github-app-00041-4gf',\n                      'service_name:keep-github-app',\n                      'source:gcp.cloud.run.revision'],\n             'timestamp': datetime.datetime(2023, 5, 20, 9, 1, 47, 727000, tzinfo=tzutc())},\n 'id': 'AgAAAYg4ZMNPeJ1IlQAAAAAAAAAYAAAAAEFZZzRaTnpFQUFDN25fYnE5MzJ5TGdBQQAAACQAAAAAMDE4ODM4NjQtYzM0Zi00ZjJjLWFlZTctNGRjYWJmMGYyOTEy'}, {'content': {'attributes': {'attributes': {'logging': {'googleapis': {'com/timestamp': '2023-05-20T09:01:47.727586Z'}}},\n                            'data': {'insertId': '64688c7b000b1a22bfdc1077',\n                                     'jsonPayload': {'asctime': '2023-05-20 '\n                                                                '09:01:47,727',\n                                                     'color_message': 'Finished '\n                                                                      'server '\n                                                                      'process '\n                                                                      '[\\x1b[36m%d\\x1b[0m]',\n                                                     'filename': 'server.py',\n                                                     'levelname': 'INFO',\n                                                     'message': 'Finished '\n                                                                'server '\n                                                                'process [1]',\n                                                     'name': 'uvicorn.error'},\n                                     'labels': {'commit-sha': '0dfb56efcaf2362e73645a43096f27cbe0cde90e',\n                                                'gcb-build-id': 'd9aa30ad-b22e-45f1-a1e2-9b668c0af037',\n                                                'gcb-trigger-id': '6903d692-6135-45e8-bc32-f25b65334d47',\n                                                'instanceId': '004d9db0beeddba311d7ec2e137989965cffaf47af6d62dc2a0d9fef15125ffc153dd463107ee793deeb07444741c2d2948eed113e78dcf15eaadccdbdd1fde883',\n                                                'managed-by': 'gcp-cloud-build-deploy-cloud-run'},\n                                     'logName': 'projects/keephq-sandbox/logs/run.googleapis.com%2Fstdout',\n                                     'receiveTimestamp': '2023-05-20T09:01:47.95981358Z',\n                                     'resource': {'labels': {'configuration_name': 'keep-github-app',\n                                                             'location': 'us-central1',\n                                                             'project_id': 'keephq-sandbox',\n                                                             'revision_name': 'keep-github-app-00041-4gf',\n                                                             'service_name': 'keep-github-app'},\n                                                  'type': 'cloud_run_revision'},\n                                     'timestamp': '2023-05-20T09:01:47.727586Z'},\n                            'messageId': '7768642501777044',\n                            'message_id': '7768642501777044',\n                            'publishTime': datetime.datetime(2023, 5, 20, 9, 1, 53, 136000, tzinfo=tzutc()),\n                            'publish_time': datetime.datetime(2023, 5, 20, 9, 1, 53, 136000, tzinfo=tzutc()),\n                            'subscription': 'projects/keephq-sandbox/subscriptions/export-logs-to-datadog'},\n             'service': 'keep-github-app',\n             'tags': ['configuration_name:keep-github-app',\n                      'datadog.submission_auth:private_api_key',\n                      'location:us-central1',\n                      'project_id:keephq-sandbox',\n                      'revision_name:keep-github-app-00041-4gf',\n                      'service_name:keep-github-app',\n                      'source:gcp.cloud.run.revision'],\n             'timestamp': datetime.datetime(2023, 5, 20, 9, 1, 47, 727000, tzinfo=tzutc())},\n 'id': 'AgAAAYg4ZMNPVOfBEQAAAAAAAAAYAAAAAEFZZzRaTnpDQUFEOWhwQXhLUUI1cEFBQQAAACQAAAAAMDE4ODM4NjQtYzM0Zi00ZjJjLWFlZTctNGRjYWJmMGYyOTEy'}, {'content': {'attributes': {'attributes': {'logging': {'googleapis': {'com/timestamp': '2023-05-20T09:01:47.727315Z'}}},\n                            'data': {'insertId': '64688c7b000b191371d6f1b6',\n                                     'jsonPayload': {'asctime': '2023-05-20 '\n                                                                '09:01:47,727',\n                                                     'filename': 'on.py',\n                                                     'levelname': 'INFO',\n                                                     'message': 'Waiting for '\n                                                                'application '\n                                                                'shutdown.',\n                                                     'name': 'uvicorn.error'},\n                                     'labels': {'commit-sha': '0dfb56efcaf2362e73645a43096f27cbe0cde90e',\n                                                'gcb-build-id': 'd9aa30ad-b22e-45f1-a1e2-9b668c0af037',\n                                                'gcb-trigger-id': '6903d692-6135-45e8-bc32-f25b65334d47',\n                                                'instanceId': '004d9db0beeddba311d7ec2e137989965cffaf47af6d62dc2a0d9fef15125ffc153dd463107ee793deeb07444741c2d2948eed113e78dcf15eaadccdbdd1fde883',\n                                                'managed-by': 'gcp-cloud-build-deploy-cloud-run'},\n                                     'logName': 'projects/keephq-sandbox/logs/run.googleapis.com%2Fstdout',\n                                     'receiveTimestamp': '2023-05-20T09:01:47.95981358Z',\n                                     'resource': {'labels': {'configuration_name': 'keep-github-app',\n                                                             'location': 'us-central1',\n                                                             'project_id': 'keephq-sandbox',\n                                                             'revision_name': 'keep-github-app-00041-4gf',\n                                                             'service_name': 'keep-github-app'},\n                                                  'type': 'cloud_run_revision'},\n                                     'timestamp': '2023-05-20T09:01:47.727315Z'},\n                            'messageId': '7768642501777049',\n                            'message_id': '7768642501777049',\n                            'publishTime': datetime.datetime(2023, 5, 20, 9, 1, 53, 136000, tzinfo=tzutc()),\n                            'publish_time': datetime.datetime(2023, 5, 20, 9, 1, 53, 136000, tzinfo=tzutc()),\n                            'subscription': 'projects/keephq-sandbox/subscriptions/export-logs-to-datadog'},\n             'service': 'keep-github-app',\n             'tags': ['configuration_name:keep-github-app',\n                      'datadog.submission_auth:private_api_key',\n                      'location:us-central1',\n                      'project_id:keephq-sandbox',\n                      'revision_name:keep-github-app-00041-4gf',\n                      'service_name:keep-github-app',\n                      'source:gcp.cloud.run.revision'],\n             'timestamp': datetime.datetime(2023, 5, 20, 9, 1, 47, 727000, tzinfo=tzutc())},\n 'id': 'AgAAAYg4ZMNPER2sKgAAAAAAAAAYAAAAAEFZZzRaTnpKQUFEVHBfUENQOTc1U0FBQQAAACQAAAAAMDE4ODM4NjQtYzM0Zi00ZjJjLWFlZTctNGRjYWJmMGYyOTEy'}, {'content': {'attributes': {'attributes': {'logging': {'googleapis': {'com/timestamp': '2023-05-20T09:01:47.723303Z'}}},\n                            'data': {'insertId': '64688c7b000b096756f6e64d',\n                                     'jsonPayload': {'asctime': '2023-05-20 '\n                                                                '09:01:47,723',\n                                                     'color_message': 'Finished '\n                                                                      'server '\n                                                                      'process '\n                                                                      '[\\x1b[36m%d\\x1b[0m]',\n                                                     'filename': 'server.py',\n                                                     'levelname': 'INFO',\n                                                     'message': 'Finished '\n                                                                'server '\n                                                                'process [1]',\n                                                     'name': 'uvicorn.error'},\n                                     'labels': {'commit-sha': '0dfb56efcaf2362e73645a43096f27cbe0cde90e',\n                                                'gcb-build-id': 'd9aa30ad-b22e-45f1-a1e2-9b668c0af037',\n                                                'gcb-trigger-id': '6903d692-6135-45e8-bc32-f25b65334d47',\n                                                'instanceId': '004d9db0becfe24a73910bba3f80c540abac1e9a31483fff20cb6a7798d78180bed75779a5ba7d4c1d2050368a8aa0a6c438e259fe7675a93e59bcb899a8da471a',\n                                                'managed-by': 'gcp-cloud-build-deploy-cloud-run'},\n                                     'logName': 'projects/keephq-sandbox/logs/run.googleapis.com%2Fstdout',\n                                     'receiveTimestamp': '2023-05-20T09:01:47.95981358Z',\n                                     'resource': {'labels': {'configuration_name': 'keep-github-app',\n                                                             'location': 'us-central1',\n                                                             'project_id': 'keephq-sandbox',\n                                                             'revision_name': 'keep-github-app-00041-4gf',\n                                                             'service_name': 'keep-github-app'},\n                                                  'type': 'cloud_run_revision'},\n                                     'timestamp': '2023-05-20T09:01:47.723303Z'},\n                            'messageId': '7768642501777046',\n                            'message_id': '7768642501777046',\n                            'publishTime': datetime.datetime(2023, 5, 20, 9, 1, 53, 136000, tzinfo=tzutc()),\n                            'publish_time': datetime.datetime(2023, 5, 20, 9, 1, 53, 136000, tzinfo=tzutc()),\n                            'subscription': 'projects/keephq-sandbox/subscriptions/export-logs-to-datadog'},\n             'service': 'keep-github-app',\n             'tags': ['configuration_name:keep-github-app',\n                      'datadog.submission_auth:private_api_key',\n                      'location:us-central1',\n                      'project_id:keephq-sandbox',\n                      'revision_name:keep-github-app-00041-4gf',\n                      'service_name:keep-github-app',\n                      'source:gcp.cloud.run.revision'],\n             'timestamp': datetime.datetime(2023, 5, 20, 9, 1, 47, 723000, tzinfo=tzutc())},\n 'id': 'AgAAAYg4ZMNL90gC6wAAAAAAAAAYAAAAAEFZZzRaTnpFQUFBTVBTcGwtSGFteGdBQQAAACQAAAAAMDE4ODM4NjQtYzM0Zi00ZjJjLWFlZTctNGRjYWJmMGYyOTEy'}, {'content': {'attributes': {'attributes': {'logging': {'googleapis': {'com/timestamp': '2023-05-20T09:01:47.72319Z'}}},\n                            'data': {'insertId': '64688c7b000b08f6ed2d0d3a',\n                                     'jsonPayload': {'asctime': '2023-05-20 '\n                                                                '09:01:47,723',\n                                                     'filename': 'on.py',\n                                                     'levelname': 'INFO',\n                                                     'message': 'Application '\n                                                                'shutdown '\n                                                                'complete.',\n                                                     'name': 'uvicorn.error'},\n                                     'labels': {'commit-sha': '0dfb56efcaf2362e73645a43096f27cbe0cde90e',\n                                                'gcb-build-id': 'd9aa30ad-b22e-45f1-a1e2-9b668c0af037',\n                                                'gcb-trigger-id': '6903d692-6135-45e8-bc32-f25b65334d47',\n                                                'instanceId': '004d9db0becfe24a73910bba3f80c540abac1e9a31483fff20cb6a7798d78180bed75779a5ba7d4c1d2050368a8aa0a6c438e259fe7675a93e59bcb899a8da471a',\n                                                'managed-by': 'gcp-cloud-build-deploy-cloud-run'},\n                                     'logName': 'projects/keephq-sandbox/logs/run.googleapis.com%2Fstdout',\n                                     'receiveTimestamp': '2023-05-20T09:01:47.95981358Z',\n                                     'resource': {'labels': {'configuration_name': 'keep-github-app',\n                                                             'location': 'us-central1',\n                                                             'project_id': 'keephq-sandbox',\n                                                             'revision_name': 'keep-github-app-00041-4gf',\n                                                             'service_name': 'keep-github-app'},\n                                                  'type': 'cloud_run_revision'},\n                                     'timestamp': '2023-05-20T09:01:47.72319Z'},\n                            'messageId': '7768642501777045',\n                            'message_id': '7768642501777045',\n                            'publishTime': datetime.datetime(2023, 5, 20, 9, 1, 53, 136000, tzinfo=tzutc()),\n                            'publish_time': datetime.datetime(2023, 5, 20, 9, 1, 53, 136000, tzinfo=tzutc()),\n                            'subscription': 'projects/keephq-sandbox/subscriptions/export-logs-to-datadog'},\n             'service': 'keep-github-app',\n             'tags': ['configuration_name:keep-github-app',\n                      'datadog.submission_auth:private_api_key',\n                      'location:us-central1',\n                      'project_id:keephq-sandbox',\n                      'revision_name:keep-github-app-00041-4gf',\n                      'service_name:keep-github-app',\n                      'source:gcp.cloud.run.revision'],\n             'timestamp': datetime.datetime(2023, 5, 20, 9, 1, 47, 723000, tzinfo=tzutc())},\n 'id': 'AgAAAYg4ZMNL2O5ZJAAAAAAAAAAYAAAAAEFZZzRaTnpGQUFDYThYcDU2cFBQdlFBQQAAACQAAAAAMDE4ODM4NjQtYzM0Zi00ZjJjLWFlZTctNGRjYWJmMGYyOTEy'}, {'content': {'attributes': {'attributes': {'logging': {'googleapis': {'com/timestamp': '2023-05-20T09:01:47.72298Z'}}},\n                            'data': {'insertId': '64688c7b000b082450fb073c',\n                                     'jsonPayload': {'asctime': '2023-05-20 '\n                                                                '09:01:47,722',\n                                                     'filename': 'on.py',\n                                                     'levelname': 'INFO',\n                                                     'message': 'Waiting for '\n                                                                'application '\n                                                                'shutdown.',\n                                                     'name': 'uvicorn.error'},\n                                     'labels': {'commit-sha': '0dfb56efcaf2362e73645a43096f27cbe0cde90e',\n                                                'gcb-build-id': 'd9aa30ad-b22e-45f1-a1e2-9b668c0af037',\n                                                'gcb-trigger-id': '6903d692-6135-45e8-bc32-f25b65334d47',\n                                                'instanceId': '004d9db0becfe24a73910bba3f80c540abac1e9a31483fff20cb6a7798d78180bed75779a5ba7d4c1d2050368a8aa0a6c438e259fe7675a93e59bcb899a8da471a',\n                                                'managed-by': 'gcp-cloud-build-deploy-cloud-run'},\n                                     'logName': 'projects/keephq-sandbox/logs/run.googleapis.com%2Fstdout',\n                                     'receiveTimestamp': '2023-05-20T09:01:47.95981358Z',\n                                     'resource': {'labels': {'configuration_name': 'keep-github-app',\n                                                             'location': 'us-central1',\n                                                             'project_id': 'keephq-sandbox',\n                                                             'revision_name': 'keep-github-app-00041-4gf',\n                                                             'service_name': 'keep-github-app'},\n                                                  'type': 'cloud_run_revision'},\n                                     'timestamp': '2023-05-20T09:01:47.72298Z'},\n                            'messageId': '7768642501777048',\n                            'message_id': '7768642501777048',\n                            'publishTime': datetime.datetime(2023, 5, 20, 9, 1, 53, 136000, tzinfo=tzutc()),\n                            'publish_time': datetime.datetime(2023, 5, 20, 9, 1, 53, 136000, tzinfo=tzutc()),\n                            'subscription': 'projects/keephq-sandbox/subscriptions/export-logs-to-datadog'},\n             'service': 'keep-github-app',\n             'tags': ['configuration_name:keep-github-app',\n                      'datadog.submission_auth:private_api_key',\n                      'location:us-central1',\n                      'project_id:keephq-sandbox',\n                      'revision_name:keep-github-app-00041-4gf',\n                      'service_name:keep-github-app',\n                      'source:gcp.cloud.run.revision'],\n             'timestamp': datetime.datetime(2023, 5, 20, 9, 1, 47, 722000, tzinfo=tzutc())},\n 'id': 'AgAAAYg4ZMNKpy4C6wAAAAAAAAAYAAAAAEFZZzRaTnpIQUFCWFYtdUxzM2pEUVFBQQAAACQAAAAAMDE4ODM4NjQtYzM0Zi00ZjJjLWFlZTctNGRjYWJmMGYyOTEy'}, {'content': {'attributes': {'attributes': {'logging': {'googleapis': {'com/timestamp': '2023-05-20T09:01:47.626694Z'}}},\n                            'data': {'insertId': '64688c7b000990064a7bbc28',\n                                     'jsonPayload': {'asctime': '2023-05-20 '\n                                                                '09:01:47,626',\n                                                     'filename': 'server.py',\n                                                     'levelname': 'INFO',\n                                                     'message': 'Shutting down',\n                                                     'name': 'uvicorn.error'},\n                                     'labels': {'commit-sha': '0dfb56efcaf2362e73645a43096f27cbe0cde90e',\n                                                'gcb-build-id': 'd9aa30ad-b22e-45f1-a1e2-9b668c0af037',\n                                                'gcb-trigger-id': '6903d692-6135-45e8-bc32-f25b65334d47',\n                                                'instanceId': '004d9db0beeddba311d7ec2e137989965cffaf47af6d62dc2a0d9fef15125ffc153dd463107ee793deeb07444741c2d2948eed113e78dcf15eaadccdbdd1fde883',\n                                                'managed-by': 'gcp-cloud-build-deploy-cloud-run'},\n                                     'logName': 'projects/keephq-sandbox/logs/run.googleapis.com%2Fstdout',\n                                     'receiveTimestamp': '2023-05-20T09:01:47.95981358Z',\n                                     'resource': {'labels': {'configuration_name': 'keep-github-app',\n                                                             'location': 'us-central1',\n                                                             'project_id': 'keephq-sandbox',\n                                                             'revision_name': 'keep-github-app-00041-4gf',\n                                                             'service_name': 'keep-github-app'},\n                                                  'type': 'cloud_run_revision'},\n                                     'timestamp': '2023-05-20T09:01:47.626694Z'},\n                            'messageId': '7768642501777047',\n                            'message_id': '7768642501777047',\n                            'publishTime': datetime.datetime(2023, 5, 20, 9, 1, 53, 136000, tzinfo=tzutc()),\n                            'publish_time': datetime.datetime(2023, 5, 20, 9, 1, 53, 136000, tzinfo=tzutc()),\n                            'subscription': 'projects/keephq-sandbox/subscriptions/export-logs-to-datadog'},\n             'service': 'keep-github-app',\n             'tags': ['configuration_name:keep-github-app',\n                      'datadog.submission_auth:private_api_key',\n                      'location:us-central1',\n                      'project_id:keephq-sandbox',\n                      'revision_name:keep-github-app-00041-4gf',\n                      'service_name:keep-github-app',\n                      'source:gcp.cloud.run.revision'],\n             'timestamp': datetime.datetime(2023, 5, 20, 9, 1, 47, 626000, tzinfo=tzutc())},\n 'id': 'AgAAAYg4ZMLqpwcC6wAAAAAAAAAYAAAAAEFZZzRaTnpCQUFCWFYtdUxzM2pER2dBQQAAACQAAAAAMDE4ODM4NjQtYzM0Zi00ZjJjLWFlZTctNGRjYWJmMGYyOTEy'}, {'content': {'attributes': {'attributes': {'logging': {'googleapis': {'com/timestamp': '2023-05-20T09:01:47.621451Z'}}},\n                            'data': {'insertId': '64688c7b00097b8b2c20a505',\n                                     'jsonPayload': {'asctime': '2023-05-20 '\n                                                                '09:01:47,621',\n                                                     'filename': 'server.py',\n                                                     'levelname': 'INFO',\n                                                     'message': 'Shutting down',\n                                                     'name': 'uvicorn.error'},\n                                     'labels': {'commit-sha': '0dfb56efcaf2362e73645a43096f27cbe0cde90e',\n                                                'gcb-build-id': 'd9aa30ad-b22e-45f1-a1e2-9b668c0af037',\n                                                'gcb-trigger-id': '6903d692-6135-45e8-bc32-f25b65334d47',\n                                                'instanceId': '004d9db0becfe24a73910bba3f80c540abac1e9a31483fff20cb6a7798d78180bed75779a5ba7d4c1d2050368a8aa0a6c438e259fe7675a93e59bcb899a8da471a',\n                                                'managed-by': 'gcp-cloud-build-deploy-cloud-run'},\n                                     'logName': 'projects/keephq-sandbox/logs/run.googleapis.com%2Fstdout',\n                                     'receiveTimestamp': '2023-05-20T09:01:47.627346593Z',\n                                     'resource': {'labels': {'configuration_name': 'keep-github-app',\n                                                             'location': 'us-central1',\n                                                             'project_id': 'keephq-sandbox',\n                                                             'revision_name': 'keep-github-app-00041-4gf',\n                                                             'service_name': 'keep-github-app'},\n                                                  'type': 'cloud_run_revision'},\n                                     'timestamp': '2023-05-20T09:01:47.621451Z'},\n                            'messageId': '7768647647274170',\n                            'message_id': '7768647647274170',\n                            'publishTime': datetime.datetime(2023, 5, 20, 9, 1, 49, 516000, tzinfo=tzutc()),\n                            'publish_time': datetime.datetime(2023, 5, 20, 9, 1, 49, 516000, tzinfo=tzutc()),\n                            'subscription': 'projects/keephq-sandbox/subscriptions/export-logs-to-datadog'},\n             'service': 'keep-github-app',\n             'tags': ['configuration_name:keep-github-app',\n                      'datadog.submission_auth:private_api_key',\n                      'location:us-central1',\n                      'project_id:keephq-sandbox',\n                      'revision_name:keep-github-app-00041-4gf',\n                      'service_name:keep-github-app',\n                      'source:gcp.cloud.run.revision'],\n             'timestamp': datetime.datetime(2023, 5, 20, 9, 1, 47, 621000, tzinfo=tzutc())},\n 'id': 'AgAAAYg4ZMLl7xeRWQAAAAAAAAAYAAAAAEFZZzRaTTZWQUFBR3lDVkU1aDYycEFBQQAAACQAAAAAMDE4ODM4NjQtYzM0Zi00ZjJjLWFlZTctNGRjYWJmMGYyOTEy'}, {'content': {'attributes': {'attributes': {'logging': {'googleapis': {'com/timestamp': '2023-05-20T08:46:49.50873Z'}}},\n                            'data': {'insertId': '646888f90007c33a9d882684',\n                                     'jsonPayload': {'asctime': '2023-05-20 '\n                                                                '08:46:49,508',\n                                                     'event': "action='opened' "\n                                                              "sender=GitHubSender(login='shahargl', "\n                                                              'id=12069200, '\n                                                              "type='User') "\n                                                              'installation=GitHubInstallation(id=37564956) '\n                                                              'repository=GitHubRepository(id=597502256, '\n                                                              "name='keep', "\n                                                              "full_name='keephq/keep', "\n                                                              "description='Open "\n                                                              'source alerting '\n                                                              'management for '\n                                                              'software '\n                                                              "developers.') "\n                                                              'pull_request=GitHubPullRequest(id=1357905213, '\n                                                              'number=136) '\n                                                              'comment=None',\n                                                     'filename': 'github_handler.py',\n                                                     'levelname': 'INFO',\n                                                     'message': 'Handled pull '\n                                                                'request event',\n                                                     'name': 'app.utils.github_handler'},\n                                     'labels': {'commit-sha': '0dfb56efcaf2362e73645a43096f27cbe0cde90e',\n                                                'gcb-build-id': 'd9aa30ad-b22e-45f1-a1e2-9b668c0af037',\n                                                'gcb-trigger-id': '6903d692-6135-45e8-bc32-f25b65334d47',\n                                                'instanceId': '004d9db0becfe24a73910bba3f80c540abac1e9a31483fff20cb6a7798d78180bed75779a5ba7d4c1d2050368a8aa0a6c438e259fe7675a93e59bcb899a8da471a',\n                                                'managed-by': 'gcp-cloud-build-deploy-cloud-run'},\n                                     'logName': 'projects/keephq-sandbox/logs/run.googleapis.com%2Fstdout',\n                                     'receiveTimestamp': '2023-05-20T08:46:49.819277288Z',\n                                     'resource': {'labels': {'configuration_name': 'keep-github-app',\n                                                             'location': 'us-central1',\n                                                             'project_id': 'keephq-sandbox',\n                                                             'revision_name': 'keep-github-app-00041-4gf',\n                                                             'service_name': 'keep-github-app'},\n                                                  'type': 'cloud_run_revision'},\n                                     'timestamp': '2023-05-20T08:46:49.50873Z'},\n                            'messageId': '7768560481522501',\n                            'message_id': '7768560481522501',\n                            'publishTime': datetime.datetime(2023, 5, 20, 8, 46, 52, 130000, tzinfo=tzutc()),\n                            'publish_time': datetime.datetime(2023, 5, 20, 8, 46, 52, 130000, tzinfo=tzutc()),\n                            'subscription': 'projects/keephq-sandbox/subscriptions/export-logs-to-datadog'},\n             'service': 'keep-github-app',\n             'tags': ['configuration_name:keep-github-app',\n                      'datadog.submission_auth:private_api_key',\n                      'location:us-central1',\n                      'project_id:keephq-sandbox',\n                      'revision_name:keep-github-app-00041-4gf',\n                      'service_name:keep-github-app',\n                      'source:gcp.cloud.run.revision'],\n             'timestamp': datetime.datetime(2023, 5, 20, 8, 46, 49, 508000, tzinfo=tzutc())},\n 'id': 'AgAAAYg4Vw6koQb-xQAAAAAAAAAYAAAAAEFZZzRWeHpGQUFBRmRWdTdNQXNjbkFBQQAAACQAAAAAMDE4ODM4NjQtYzM0Zi00ZjJjLWFlZTctNGRjYWJmMGYyOTEy'}, {'content': {'attributes': {'attributes': {'logging': {'googleapis': {'com/timestamp': '2023-05-20T08:46:37.96134Z'}}},\n                            'data': {'insertId': '646888ed000eab3c6d53077f',\n                                     'jsonPayload': {'asctime': '2023-05-20 '\n                                                                '08:46:37,961',\n                                                     'filename': 'github_handler.py',\n                                                     'levelname': 'INFO',\n                                                     'message': 'Initializing '\n                                                                'GitHub pull '\n                                                                'request',\n                                                     'name': 'app.utils.github_handler',\n                                                     'pull_request_number': 136,\n                                                     'repository_name': 'keephq/keep'},\n                                     'labels': {'commit-sha': '0dfb56efcaf2362e73645a43096f27cbe0cde90e',\n                                                'gcb-build-id': 'd9aa30ad-b22e-45f1-a1e2-9b668c0af037',\n                                                'gcb-trigger-id': '6903d692-6135-45e8-bc32-f25b65334d47',\n                                                'instanceId': '004d9db0becfe24a73910bba3f80c540abac1e9a31483fff20cb6a7798d78180bed75779a5ba7d4c1d2050368a8aa0a6c438e259fe7675a93e59bcb899a8da471a',\n                                                'managed-by': 'gcp-cloud-build-deploy-cloud-run'},\n                                     'logName': 'projects/keephq-sandbox/logs/run.googleapis.com%2Fstdout',\n                                     'receiveTimestamp': '2023-05-20T08:46:38.164712103Z',\n                                     'resource': {'labels': {'configuration_name': 'keep-github-app',\n                                                             'location': 'us-central1',\n                                                             'project_id': 'keephq-sandbox',\n                                                             'revision_name': 'keep-github-app-00041-4gf',\n                                                             'service_name': 'keep-github-app'},\n                                                  'type': 'cloud_run_revision'},\n                                     'timestamp': '2023-05-20T08:46:37.96134Z'},\n                            'messageId': '7768564004154994',\n                            'message_id': '7768564004154994',\n                            'publishTime': datetime.datetime(2023, 5, 20, 8, 46, 42, 635000, tzinfo=tzutc()),\n                            'publish_time': datetime.datetime(2023, 5, 20, 8, 46, 42, 635000, tzinfo=tzutc()),\n                            'subscription': 'projects/keephq-sandbox/subscriptions/export-logs-to-datadog'},\n             'service': 'keep-github-app',\n             'tags': ['configuration_name:keep-github-app',\n                      'datadog.submission_auth:private_api_key',\n                      'location:us-central1',\n                      'project_id:keephq-sandbox',\n                      'revision_name:keep-github-app-00041-4gf',\n                      'service_name:keep-github-app',\n                      'source:gcp.cloud.run.revision'],\n             'timestamp': datetime.datetime(2023, 5, 20, 8, 46, 37, 961000, tzinfo=tzutc())},\n 'id': 'AgAAAYg4VuGJUNxDnwAAAAAAAAAYAAAAAEFZZzRWdlpTQUFEeUFPRTYtZTR2LVFBQQAAACQAAAAAMDE4ODM4NjQtYzM0Zi00ZjJjLWFlZTctNGRjYWJmMGYyOTEy'}])"

Type validation fails for example in readme

Describe the bug
While checking out keep for the first time, I saw that the db-disk-space alert from the readme fails with message:

[ERROR] keep.alert.alert: Action trigger-slack failed: Invalid threshold value, currently support only numeric and percentage values but got 91% and 90%

After looking into it, I saw that the issue is in keep/conditions/threshold_condition.py in the _validate function, where this exception is raised on the condition if isinstance(compare_value, type(compare_to)), which seems to be the opposite of what is desired. The current condition should be negated (if not)

This seems to have been introduced in PR #115 , where the previous condition was this:

if type(compare_value) != type(compare_to)

The new condition does the opposite, rather than checking that types match, it checks that they don't match, which is most likely not the intended behavior. New broken condition:

if isinstance(compare_value, type(compare_to))

To Reproduce
Steps to reproduce the behavior:

  1. Clone the repository
  2. Install keep
  3. Configure slack-demo provider with webhook
  4. keep run --alerts-file examples/alerts/db_disk_space.yml

Expected behavior
90% and 91% values in db_disk_space.yml alert should pass validation

Screenshots

(keep-py3.11) cictor@Victors-MacBook-Pro keep % git pull
Already up to date.
(keep-py3.11) cictor@Victors-MacBook-Pro keep % git status
On branch main
Your branch is up to date with 'origin/main'.

nothing to commit, working tree clean
(keep-py3.11) cictor@Victors-MacBook-Pro keep % keep run --alerts-file examples/alerts/db_disk_space.yml
2023-04-22 16:10:02,705 [INFO] keep.alertmanager.alertmanager: Running alert(s) from examples/alerts/db_disk_space.yml
2023-04-22 16:10:02,712 [INFO] keep.alertmanager.alertmanager: Running alert db-disk-space
2023-04-22 16:10:02,712 [INFO] keep.alert.alert: Running step db-no-space
2023-04-22 16:10:02,712 [INFO] keep.alert.alert: Step db-no-space ran successfully
2023-04-22 16:10:02,712 [INFO] keep.alert.alert: Running action trigger-slack
2023-04-22 16:10:02,713 [ERROR] keep.alert.alert: Action trigger-slack failed: Invalid threshold value, currently support only numeric and percentage values but got 91% and 90%
2023-04-22 16:10:02,713 [INFO] keep.alertmanager.alertmanager: Alert db-disk-space ran with errors
2023-04-22 16:10:02,713 [ERROR] keep.alertmanager.alertmanager: Alert(s) from examples/alerts/db_disk_space.yml ran with errors
2023-04-22 16:10:02,713 [ERROR] keep.cli.cli: Error running alert examples/alerts/db_disk_space.yml: Alert(s) ran with errors

Desktop (please complete the following information):

  • OS: macOS
  • Version 12.2.1

Additional context
Running from the current master which is commit 693755b

Improve the "foreach" mechanism to be more solid

Current state

When running alert in "foreach" mode, the foreach context can be accessed via {{ foreach.value }}

For example, let's consider the next step:

    - name: check-disk-defects
      provider:
        type: postgres
        config: "{{ providers.postgres-server }}"
        with:
          query: "select * from disk"
      foreach: "{{ steps.this.results }}"
      condition:
        - name: threshold-condition
          type: threshold
          value:  " {{ foreach.value[13] }} " # disk defect is the 13th column
          compare_to: 50, 40, 30
          level: major, medium, minor

We can see that when we use foreach: "{{ steps.this.results }}" every column can be accessed via " {{ foreach.value[i] }} "

But now we have a problem - the condition applies a level to each foreach - level: major, medium, minor, how can we store it as context so it'll be accessible via {{ foreach.level }}?

So the current workaround for that is to add **kwargs to set_condition_results so every other context (e.g. level) will be stored in the additional context.

What needs to be done

We need to design a better way for the foreach mechanism. I thought maybe using some contextmanager (e.g. enter and exit every time you are in foreach mode) or even treating the foreach context as a dataclass or something

IOHandler eval "NameError: name 'tzutc' is not defined"

When rendering output of Datadog Provider, the library uses dateutil.tz.tzutc to express dates, and when "eval" is used in the handler, we are getting

eval(_arg)
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "<string>", line 1, in <module>
NameError: name 'tzutc' is not defined

Missing OpsGenie

Is your feature request related to a problem? Please describe.
Looks like a great tool but we use OpsGenie so I think we need a provider to make use of this tool

Describe the solution you'd like
OpsGenie provider

Describe alternatives you've considered
n/a

Additional context
n/a

Missing Telegram Provider

It would be great to get alert messages on telegram. This would probably involve creating a bot and passing the bot token to such a new provider.

Install providers separately

Be able to install only parts of keep if I don't need all of the providers.
e.g.

keep install provider ssh
keep install provider gcloud

The goal is to decrease the overall size and dependencies needed to start working

Non deterministic behavior of the parser function

Describe the bug
The different calls for the parse function are dependent.
reference :

# This test depends on the previous one because of global providers configuration

To Reproduce
Steps to reproduce the behavior:
This test reproduces the bug:

# This test depends on the previous one because of global providers configuration

Expected behavior
If the above tests are passing that would indicate that the calls for parser are no longer dependent and hence the bug is fixed.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.