scrapinghub / spidermon

Scrapy Extension for monitoring spiders execution.
https://spidermon.readthedocs.io
BSD 3-Clause "New" or "Revised" License
530 stars 96 forks source link

Add SNS Action for Spidermon Notifications #413

Closed felipdc closed 1 year ago

felipdc commented 1 year ago

Summary:

This pull request introduces a new action that allows Spidermon to send notifications via AWS Simple Notification Service (SNS). This provides users with an alternative way to receive notifications and integrate Spidermon with other AWS services or third-party applications through SNS.

Changes:

Benefits:

How to Test:

  1. Set up AWS credentials and an SNS topic as described in the documentation.
  2. Configure Spidermon to use the new SNS action.
  3. Trigger a Spidermon notification to see it being sent to the specified SNS topic.

Looking forward to feedback and any additional changes required.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 95.74% and project coverage change: +0.24% :tada:

Comparison is base (0cbb563) 79.14% compared to head (3ddfc2a) 79.39%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #413 +/- ## ========================================== + Coverage 79.14% 79.39% +0.24% ========================================== Files 74 76 +2 Lines 3175 3222 +47 Branches 530 534 +4 ========================================== + Hits 2513 2558 +45 - Misses 591 593 +2 Partials 71 71 ``` | [Files Changed](https://app.codecov.io/gh/scrapinghub/spidermon/pull/413?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scrapinghub) | Coverage Δ | | |---|---|---| | [spidermon/contrib/actions/sns/\_\_init\_\_.py](https://app.codecov.io/gh/scrapinghub/spidermon/pull/413?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scrapinghub#diff-c3BpZGVybW9uL2NvbnRyaWIvYWN0aW9ucy9zbnMvX19pbml0X18ucHk=) | `94.44% <94.44%> (ø)` | | | [spidermon/contrib/actions/sns/notifiers.py](https://app.codecov.io/gh/scrapinghub/spidermon/pull/413?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scrapinghub#diff-c3BpZGVybW9uL2NvbnRyaWIvYWN0aW9ucy9zbnMvbm90aWZpZXJzLnB5) | `100.00% <100.00%> (ø)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

rennerocha commented 1 year ago

thought This is not related to this PR specifically, but maybe it would be nice, if we move any action that it is AWS related to a aws module. This would keep the code more organized and easier to locate.

So we could have:

spidermon/contrib/actions/aws/__init__.py
spidermon/contrib/actions/aws/sns.py
spidermon/contrib/actions/aws/ses.py  # for Amazon SES email

Maybe we could discuss this in a separate issue anyway.