Skip to main content

推送Sentry报错信息到钉钉群,并且@具体的人员

Project description

Sentry DingTalk Notify People

Sentry 集成钉钉机器人通知,并且通知人员。
本插件是基于sentry-dingtalk-notify 进行的二次开发,加上了自定义的需求。

Requirments

  • sentry >= 21.5.1

特性

  • 发送异常通知到钉钉
  • 支持钉钉机器人webhook设置关键字
  • 支持通知到具体的用户
  • 配置环境变量
    • DINGTALK_WEBHOOK: Optional(string)
    • DINGTALK_CUSTOM_KEYWORD: Optional(string)
    • DINGTALK_PHONES: Optional(string)

快速使用

安装

  1. 使用 pip 命令

    $ pip install dt-notify-to-people
    
  2. 写入依赖文件 onpremise-xxx/sentry/requirements.txt

    $ echo dt-notify-to-people= >> requirements.txt
    

钉钉机器人

配置钉钉机器人并拿到对应的 webhook, 可以对机器人设置 关键词、签名、IP限制。

配置

  1. Sentry安装项目下的requirements.txt,添加dt-notify-to-people==1.0.8;
  2. 在 Sentry 面板 Settings > Integrations 中找到 DingTalk 并配置 webhook、关键词等信息,添加项目,创建告警规则;

关于插件编写

  1. 具体教程可以阅读这边文章《如何开发自己的Python库》

  2. 编写自己的插件代码;

  3. 打包自己的插件代码:

    python setup.py sdist bdist_wheel
    
  4. 上传自己的插件:

    twine upload --repository-url https://upload.pypi.org/legacy/ dist/*
    

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dt_notify_to_people-1.9.7.tar.gz (6.3 kB view hashes)

Uploaded Source

Built Distribution

dt_notify_to_people-1.9.7-py3-none-any.whl (6.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page