sentry 使用钉钉,测试发送消息无法接收的问题
在添加钉钉token的时候很多人习惯把整个url链接填写进去,但通过以下钉钉插件的代码不难得知,token只需要填写最后的token字符串就行
进入到sentry worker 的容器
root@a256935eb1b7:/data/custom-packages/lib/python3.6/site-packages/sentry_dingding# more plugin.py
# coding: utf-8
import json
import requests
from sentry.plugins.bases.notify import NotificationPlugin
import sentry_dingding
from .forms import DingDingOptionsForm
DingTalk_API = "https://oapi.dingtalk.com/robot/send?access_token={token}" # 只需要传入这里的token就行
class DingDingPlugin(NotificationPlugin):
"""
Sentry plugin to send error counts to DingDing.
"""
author = 'ansheng'
author_url = 'https://github.com/anshengme/sentry-dingding'
version = sentry_dingding.VERSION
description = 'Send error counts to DingDing.'
resource_links = [
('Source', 'https://github.com/anshengme/sentry-dingding'),
('Bug Tracker', 'https://github.com/anshengme/sentry-dingding/issues'),
('README', 'https://github.com/anshengme/sentry-dingding/blob/master/README.md'),
]
slug = 'DingDing'
title = 'DingDing'
conf_key = slug
conf_title = title
project_conf_form = DingDingOptionsForm
def is_configured(self, project):
"""
Check if plugin is configured.
"""
pass