Coder Social home page Coder Social logo

sentry-slack's Introduction

sentry-slack

DEPRECATED: This project now lives in sentry-plugins

An extension for Sentry which posts notifications to a Slack channel.

https://i.imgur.com/MFsjVmB.png

Install

Install the package via pip:

pip install https://github.com/getsentry/sentry-slack/archive/master.zip

or:

pip install sentry-slack

You can now configure webhooks via the plugin configuration panel within your project.

sentry-slack's People

Contributors

dcramer avatar drcapulet avatar hest avatar kazhuravlev avatar lebinh avatar mattrobenolt avatar myovchev avatar shonenada avatar whiskybar 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  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

sentry-slack's Issues

Advice needed

Hello there

I'm being a bit dull at the moment, and I'm struggling to understand how to use the new "Include triggering rules with notifications" option in the slack setup on my sentry install.

Could you give me a use case example of what that means, and how to achieve it?

Thanks in advance.

Slack integration doesn't show up

sentry: 8.2.2

There's no Slack integration in Team -> Settings -> All integrations.
In admin section in packages it's showing up correctly.

Unable to filter messages by level

Being able to to filter which messages to see in slack based on the level would be helpful. Right now the channel is being filled up with the lower levels while all I really would like to see are the errors.

Installing the plugin for celery workers

I'm running sentry in docker.
I have separate containers for the main sentry image, redis, postgres, celery beat and celery workers. After installing the sentry-slack plugin (via pip) in the sentry container the integration wasn't working, I had to install it on the celery-worker containers as well. Please mention that in the README.md.

test configuration error

[ERROR] Plugin(slack) raised an error during test
Traceback (most recent call last):
  File "/www/sentry/local/lib/python2.7/site-packages/sentry/web/helpers.py", line 169, in plugin_config
    test_results = plugin.test_configuration(project)
  File "/www/sentry/local/lib/python2.7/site-packages/sentry/plugins/bases/notify.py", line 120, in test_configuration
    return self.notify_users(event.group, event, fail_silently=False)
  File "/www/sentry/local/lib/python2.7/site-packages/sentry/plugins/bases/notify.py", line 62, in notify_users
    raise NotImplementedError

I have confused need help

I am new to the sentry, I have integrated the sentry with slack.

What I have done:
sentryaddederror

Just added the webhook link of slack on sentry

If you don't mind, Please help me

My mail Id: [email protected]

Option to reduce Slack real estate

Sentry errors currently look like this for my project:
screen shot 2016-07-23 at 11 57 15 pm

It would be nice if there was an option to use less vertical real estate like this:
screen shot 2016-07-23 at 11 57 15 pm copy

Looking at the code for the plugin, it seems like this would be doable by omitting all the fields in the SlackPlugin.notify() method based on a new BooleanField option called verbose that could be added.

Does this sound like a reasonable request?

Multiple notifications for every instance of an error

In Sentry, multiple instances of an error get aggregated. And I get just one email for all those events. Everything is good so far. However, in Slack, we get notifications for each instance of the error. That just floods the slack channel. According to this getsentry/sentry#1403 the issue is fixed in Sentry. As I get just one email and I can see the instances aggregated in Sentry, I'm guessing it's an issue with sentry-slack?

plugin not loading on personal getsentry

Hi

sorry for the dummy question, but I installed the package with pip on my sentry server, but the plugin doesn't show up. I cannot find a lot of documentation, do I need to add sentry-slack to a config file to load it? I tried restarting supervisor but that does not do the trick...

Add proxy support.

It would be nice being able to send the request via http proxy, for some environments where outbound http is filtered.

Has no notifications

Hello! I'm created sentry integration on slack.com (also I'm tryied to create just incoming webhook notification), then I'm installed sentry-slack and added slack URL. After trigerring error nothing happens =/ How I could turn on logging of a sentry-slack errors?

Can't find slack integration after update.

I just updated from version 7.7.4 to 8.0.3 of sentry. I can see the sentry-slack in packages and installed_apps, but in my intregation list i cant see the sentry-slack section.

Error when running test

Hey all, using the standalone sentry server. Just installed sentry-slack, configured it and am getting this exception when running the test:

  File "/home/deploy/sentry/local/lib/python2.7/site-packages/sentry/api/endpoints/project_plugin_details.py", line 55, in post
    test_results = plugin.test_configuration(project)
  File "/home/deploy/sentry/local/lib/python2.7/site-packages/sentry/plugins/bases/notify.py", line 160, in test_configuration
    return self.notify(notification)
  File "/home/deploy/sentry/local/lib/python2.7/site-packages/sentry_plugins/slack/plugin.py", line 238, in notify
    'title_link': self.add_notification_referrer_param(group.get_absolute_url()),
AttributeError: 'SlackPlugin' object has no attribute 'add_notification_referrer_param'
18:04:57 [ERROR] root: Plugin(slack) raised an error during test```

any guidance is appreciated, thank you!

Save button doesn't work with sentry 7.1.2

When I try to add slack webhook and i paste it in to input box and i save. It won't be saved even if the notification says otherwise. To actually save the webhook i have to paste it and then press enter.

This is reason why #3 is occuring.

Message in slack notification

It would be really great to get the error message included in the slack notification. (Or even select all the fields you're interested in!)

Installation on Fedora failed

Hello, I'm trying to install plugin.
Sentry 8.17.
Environment:

[root@sentry ge]# python --version
Python 2.7.5
[root@sentry ge]# clang --version
clang version 3.4.2 (tags/RELEASE_34/dot2-final)
Target: x86_64-redhat-linux-gnu
Thread model: posix
[root@sentry ge]# gcc --version
gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-7)
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[root@sentry ge]# cat /etc/issue
Fedora release 20 (Heisenbug)
Kernel \r on an \m (\l)

Here is a par of installation output from pip:

Downloading/unpacking libsourcemap>=0.5.0,<0.6.0 (from sentry>=7.0.0->sentry-slack)
  Downloading libsourcemap-0.5.0.zip (162kB): 162kB downloaded
  Running setup.py egg_info for package libsourcemap
    clang: error: unknown argument: '-fstack-protector-strong'
    clang: error: unknown argument: '-fstack-protector-strong'
    clang: error: unknown argument: '-fstack-protector-strong'
    clang: error: unknown argument: '-fstack-protector-strong'
    
        No working compiler found, or bogus compiler options
        passed to the compiler from Python's distutils module.
        See the error messages above.
        (If they are about -mno-fused-madd and you are on OS/X 10.8,
        see http://stackoverflow.com/questions/22313407/ .)
    Traceback (most recent call last):
...
    distutils.errors.DistutilsError: Setup script exited with 1
    Complete output from command python setup.py egg_info:
    clang: error: unknown argument: '-fstack-protector-strong'

clang: error: unknown argument: '-fstack-protector-strong'

clang: error: unknown argument: '-fstack-protector-strong'

clang: error: unknown argument: '-fstack-protector-strong'

I think this is because a old version of clang. How can I install it without new version of clang?

Filtering by label values

I'd like to be able to filter by label values. In particular, I'd like to only notify on errors not warnings.

Unable to disable project tag

If you add project to the excluded tags area it is ignored and is still displayed in Slack. The company I work for only has a single product we work on so this isn't required and just adds a bit of clutter.

'Project' object has no attribute 'get_full_name'

Stacktrace (most recent call last):

File "sentry/web/helpers.py", line 170, in plugin_config
test_results = plugin.test_configuration(project)
File "sentry/plugins/bases/notify.py", line 115, in test_configuration
return self.notify(notification)
File "sentry_slack/plugin.py", line 101, in notify
project_name = project.get_full_name().encode('utf-8')

Sentry: 7.7.0 (Self-hosted)
Sentry-slack: 0.3.0

Link to Webhook URL

It would be nice if we could link to where users can find the slack webhook URL from the plugin page.

Please release an update

It seems like there have been a number of bug fixes and changes that would merrit and updated pypi release. Thanks!

Error sending notify

2015-05-19T21:37:54.292599+00:00 app[web.1]: Error processing 'post_process' on 'SlackPlugin': __init__() got an unexpected keyword argument '_context'
2015-05-19T21:37:54.292604+00:00 app[web.1]: Traceback (most recent call last):
2015-05-19T21:37:54.292622+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/sentry/utils/safe.py", line 19, in safe_execute
2015-05-19T21:37:54.292623+00:00 app[web.1]:     result = func(*args, **kwargs)
2015-05-19T21:37:54.292625+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/sentry/plugins/bases/notify.py", line 110, in post_process
2015-05-19T21:37:54.292626+00:00 app[web.1]:     self.notify_users(group, event)
2015-05-19T21:37:54.292628+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/sentry_slack/plugin.py", line 95, in notify_users
2015-05-19T21:37:54.292629+00:00 app[web.1]:     return urllib2.urlopen(request).read()
2015-05-19T21:37:54.292631+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/urllib2.py", line 154, in urlopen
2015-05-19T21:37:54.292632+00:00 app[web.1]:     return opener.open(url, data, timeout)
2015-05-19T21:37:54.292634+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/urllib2.py", line 431, in open
2015-05-19T21:37:54.292635+00:00 app[web.1]:     response = self._open(req, data)
2015-05-19T21:37:54.292636+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/urllib2.py", line 449, in _open
2015-05-19T21:37:54.292638+00:00 app[web.1]:     '_open', req)
2015-05-19T21:37:54.292639+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/urllib2.py", line 409, in _call_chain
2015-05-19T21:37:54.292641+00:00 app[web.1]:     result = func(*args)
2015-05-19T21:37:54.292642+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/urllib2.py", line 1240, in https_open
2015-05-19T21:37:54.292643+00:00 app[web.1]:     context=self._context)
2015-05-19T21:37:54.292645+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/urllib2.py", line 1194, in do_open
2015-05-19T21:37:54.292646+00:00 app[web.1]:     h.request(req.get_method(), req.get_selector(), req.data, headers)
2015-05-19T21:37:54.292647+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/httplib.py", line 1001, in request
2015-05-19T21:37:54.292649+00:00 app[web.1]:     self._send_request(method, url, body, headers)
2015-05-19T21:37:54.292651+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/httplib.py", line 1035, in _send_request
2015-05-19T21:37:54.292653+00:00 app[web.1]:     self.endheaders(body)
2015-05-19T21:37:54.292654+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/httplib.py", line 997, in endheaders
2015-05-19T21:37:54.292655+00:00 app[web.1]:     self._send_output(message_body)
2015-05-19T21:37:54.292657+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/httplib.py", line 850, in _send_output
2015-05-19T21:37:54.292658+00:00 app[web.1]:     self.send(msg)
2015-05-19T21:37:54.292659+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/httplib.py", line 812, in send
2015-05-19T21:37:54.292660+00:00 app[web.1]:     self.connect()
2015-05-19T21:37:54.292662+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/httplib.py", line 1212, in connect
2015-05-19T21:37:54.292663+00:00 app[web.1]:     server_hostname=server_hostname)
2015-05-19T21:37:54.292664+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/ssl.py", line 350, in wrap_socket
2015-05-19T21:37:54.292665+00:00 app[web.1]:     _context=self)
2015-05-19T21:37:54.292667+00:00 app[web.1]: TypeError: __init__() got an unexpected keyword argument '_context'

Error processing 'after'

Running Sentry 7.1.4 with 0.1.0 sentry-slack. The "Test Configuration" button works OK and creates a notification on Slack but actual logged exception does not, this is from the sentry log on the server:

[ERROR] Error processing 'after' on 'NotifyEventServiceAction': u'slack'
Traceback (most recent call last):
  File "/www/sentry/local/lib/python2.7/site-packages/sentry/utils/safe.py", line 26, in safe_execute
    result = func(*args, **kwargs)
  File "/www/sentry/local/lib/python2.7/site-packages/sentry/rules/actions/notify_event_service.py", line 44, in after
    plugin = plugins.get(service)
  File "/www/sentry/local/lib/python2.7/site-packages/sentry/plugins/base/manager.py", line 49, in get
    raise KeyError(slug)
KeyError: u'slack'

Test Results Report Error After Testing

Test Results
'NoneType' object has no attribute 'group'

Is this something wrong with upgrades along the way or something wrong with the plugin? I currently have one projects which this works with, but I can't seem to get others to work.

Please let me know what would help debug or where to look. Be glad to provide.

No Output in Slack

I'm having issues getting Sentry to send any messages to Slack.

My configuration is almost default, I supplied the Webhook URL and channel, I didn't make any changes around tags. And have not checked 'Include Tags' or 'Include Rules'. When pressing 'Test Configuration' I see the test message in the channel.

Inside my project settings under 'Rules' I have added the following -

image

We do get a lot of events in Sentry so I don't think the issue is related to not receiving any events, we are getting emailed new events as well, we're just not getting any output in slack.

I was wondering if anyone had any ideas or could suggest other things to try.

Cheers

Sentry-slack raises exception when testing with tags

Sentry version: 7.7.4
Sentry-slack version: 0.5.0

Can consistently reproduce the error by clicking the "Include tags" checkbox and listing a few comma-delimited tags in the "Included tag keys" field, then clicking "Test Configuration". The resulting stack trace is:

[ERROR] Plugin(slack) raised an error during test
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/sentry/web/helpers.py", line 170, in plugin_config
    test_results = plugin.test_configuration(project)
  File "/usr/local/lib/python2.7/dist-packages/sentry/plugins/bases/notify.py", line 115, in test_configuration
    return self.notify(notification)
  File "/usr/local/lib/python2.7/dist-packages/sentry/../sentry_slack/plugin.py", line 196, in notify
    std_key = TagKey.get_standardized_key(key)
AttributeError: type object 'TagKey' has no attribute 'get_standardized_key'

I believe this is not just limited to running "Test Configuration", since it also seems to block actual live records from being sent to slack.

Errors are not being sent to Slack

Hello guys,

I got the Slack integration setup in a Docker container. Test configuration works and posts to a Slack channel, but when I sent errors using the raven-go and the raven-js clients, these error, while they arrive to Sentry without problems, they don't get posted to Slack.

I tried to make the cURL from the docker container to see if could be a certificates issue, but it's working correctly. Also, I have the default notification rules in Sentry, but I don't know if this can be related to the problem.

Any suggestions?.

Thanks!

Not working on Sentry 7.7.4

Just updated my Sentry install and the Slack plugin now fails with There was an internal error with the Plugin.

Not sure where to find logs but if you point me to the right location I'll grab them for you.

AttributeError in self.get_option('username', project).strip() [Sentry 8.0.1]

After upgrading to Sentry 8.0.1 and sentry-slack 0.4.0 I get the following error while testing the Slack integration:

[ERROR] Plugin(slack) raised an error during test                                                  
Traceback (most recent call last):                                                                 
  File "/home/beta/sentry_env/local/lib/python2.7/site-packages/sentry/plugins/base/configuration.py", line 41, in default_plugin_config                                                              
    test_results = plugin.test_configuration(project)                                              
  File "/home/beta/sentry_env/local/lib/python2.7/site-packages/sentry/plugins/bases/notify.py", line 156, in test_configuration                                                                      
    return self.notify(notification)                                                               
  File "/home/beta/sentry_env/local/lib/python2.7/site-packages/sentry/../sentry_slack/plugin.py",  line 129, in notify                                                                                
    username = self.get_option('username', project).strip()                                        
AttributeError: 'NoneType' object has no attribute 'strip'                                         

Looks like it's related to #29, patching username and channel (same error) worked as a temporary fix.

Plugin not loading

I added 'sentry-slack' to my requirements.txt file, and it is installed by my server.
The 'Packages' page in the admin section shows sentry-slack in the modules section.

When I go in to a project, click the 'Settings' tab, and then 'Manage Integrations', slack does not show up in the list. I tried this under Sentry 6.4.4 and under 7.0-DEV.

I also tried adding 'sentry_slack' and 'sentry.plugins.slack' to the INSTALLED_APPS with no success. I am launching sentry using 'python manage.py runserver'.

0.4.0 broken with Sentry 7.1.x

FYI, I recently rebuilt my sentry docker image and found that version 0.4.0 of this plugin does not work properly with the 7.1 branch of Sentry. You may want to update the setup.py to reflect this. Not sure which version it starts to work with exactly. To fix I downgraded to 0.2.0.

Not visible under integrations with Sentry 8.6 and sentry-slack 0.5.0

Sentry slack plugin isn't visible under integrations on any projects using Sentry 8.6 with sentry-slack 0.5.0. It shows as installed under the Extensions and Modules heading on this page /manage/status/packages/. Tried restarting the sentry-web supervisor process to no avail. Not seeing anything related in the logs. Any suggestions on what to look at? Thanks!

Slack notification within docker.

Hello!
First of all thank you for the great app!
It is not actually the issue, but as far as I saw questions about it some times, may be it will be worth to know for you also.
The common part is I can send test notification for slack, but it does not work for the real, triggered issues.
As I mention early, I use docker, and obviously, I installed sentry-slack only inside of container with webfront app, and this is why I can send it with test button. And, obviously, this is why other container with sentry worker could not sent any messages, it is just does not have any installed sentry-slack plugin. Maybe it will be helpful to stress this info somewhere.

Slack integration error

I got an exception adding the slack integration. Our account is owned by me @brendon9x. Hopefully you can see the exception there. Time 10h13+02h00

sentry-slack sentry 8.2.2

Hi im trying to install sentry slack for sentry 8.2.2 but i cant see that sentry slack pops up in the Integrations list.

Latest version does not work on Sentry v8.0.5

On my self-hosted sentry:

When my projects do fail, the Slack notification does not work on my channel. However, when I added the webhook and pressed "Test Configuration" I get the notifications as seen here:

https://i.imgur.com/9b8kTP2.png

I've ensured that the notification settings for Slack and email for the project is enabled, and that it is set to "when an event is seen" and not "when an event is first seen"

Any ideas why as to why it works on testing the configuration but not when a project fails?

Django, Sentry, Slack: How to capture request and response and post in slack?

My Logging config:-

LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'root': {
'level': 'WARNING',
'handlers': ['sentry'],
},
'formatters': {
'verbose': {
'format': ('%(levelname)s %(asctime)s %(module)s %(process)d '
'%(thread)d %(message)s')
},
},
'handlers': {
'sentry': {
'level': 'ERROR',
'class': ('raven.contrib.django.raven_compat.handlers.'
'SentryHandler'),
},
},
'loggers': {
'sentry_errors': {
'level': 'ERROR',
'handlers': ['sentry'],
'propagate': False
},

    }

}

Code raising sentry alerts:-
logger = logging.getLogger('sentry_errors') logger.error("Handled exception occurred", exc_info=True, extra={ "request": renderer_context['request'].data, "response": renderer_context['response'].data })

I am only receiving Culprit and Project information on slack. Is it possible to capture request and response ?

Feature request: let user choose tags to show in Slack notification

I'd love to be able to see if a particular Slack notification was related to production or staging. The Sentry plugin would need to be configurable to allow the user to select which tags to send to Sentry, so I could specify the "environment" tag.

Is this a feature you'd consider accepting? If so, I can take a shot at implementing it.

'Group' object has no attribute 'message_short'

I'm getting the following error in my logs which I'm assuming is why I'm not getting slack notifications -

Traceback (most recent call last):
Error processing 'post_process' on 'SlackPlugin': 'Group' object has no attribute 'message_short'
self.notify_users(group, event)
result = func(_args, *_kwargs)
File "/app/.heroku/python/lib/python2.7/site-packages/sentry/plugins/bases/notify.py", line 110, in post_process
File "/app/.heroku/python/lib/python2.7/site-packages/sentry/utils/safe.py", line 21, in safe_execute
File "/app/.heroku/python/lib/python2.7/site-packages/sentry_slack/plugin.py", line 75, in notify_users
message = group.message_short.encode('utf-8')
AttributeError: 'Group' object has no attribute 'message_short'

Running version 6.4.2

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.