getsentry / raven-python

Raven is the legacy Python client for Sentry (getsentry.com) — replaced by sentry-python
https://sentry.io
BSD 3-Clause "New" or "Revised" License
1.68k stars 657 forks source link

SaltStack errors not sent to Sentry #1147

Open chrispetsos opened 6 years ago

chrispetsos commented 6 years ago

I am using Raven as part of the Sentry returner for SaltStack. My problem is that during SaltStack highstates Sentry receives some of the successful states, but not the actual failed one. The actual SaltStack result is placed inside the extra parameter of the capture method by the Sentry returner. I have confirmed that the value of the extra param, being sent in this line contains the failed state,

...
'pkg_|-always-pass-without-changes_|-always-pass-without-changes_|-installed': {
      'comment': 'An exception occurred in this state: Traceback (most recent call last):\n  File "/usr/lib/python2.7/dist-packages/salt/state.py", line 1837, in call\n    **cdata[\'kwargs\'])\n  File "/usr/lib/python2.7/dist-packages/salt/loader.py", line 1794, in wrapper\n    return f(*args, **kwargs)\n  File "/usr/lib/python2.7/dist-packages/salt/states/pkg.py", line 1468, in installed\n    **kwargs)\n  File "/usr/lib/python2.7/dist-packages/salt/states/pkg.py", line 696, in _find_install_targets\n    cached_path = __salt__[\'cp.cache_file\'](val, saltenv=kwargs[\'saltenv\'])\n  File "/usr/lib/python2.7/dist-packages/salt/modules/cp.py", line 445, in cache_file\n    result = _client().cache_file(path, saltenv)\n  File "/usr/lib/python2.7/dist-packages/salt/fileclient.py", line 189, in cache_file\n    return self.get_url(path, \'\', True, saltenv, cachedir=cachedir)\n  File "/usr/lib/python2.7/dist-packages/salt/fileclient.py", line 684, in get_url\n    **get_kwargs\n  File "/usr/lib/python2.7/dist-packages/salt/utils/http.py", line 505, in query\n    **req_kwargs\n  File "/usr/lib/python2.7/dist-packages/tornado/httpclient.py", line 102, in fetch\n    self._async_client.fetch, request, **kwargs))\n  File "/usr/lib/python2.7/dist-packages/tornado/ioloop.py", line 445, in run_sync\n    return future_cell[0].result()\n  File "/usr/lib/python2.7/dist-packages/tornado/concurrent.py", line 215, in result\n    raise_exc_info(self._exc_info)\n  File "<string>", line 3, in raise_exc_info\nerror: [Errno 111] Connection refused\n',
      'name': 'always-pass-without-changes',
      'start_time': '21:28:17.202453',
      'result': False,
      'duration': 424.405,
      '__run_num__': 0,
      '__sls__': u'test.succeed_without_changes',
      'changes': {

      },
      '__id__': 'always-pass-without-changes'
    },
...

In my scenario there are 137 succeeded states and only one (the above) failed. So, imagine a big JSON message with 138 chunks like the above being fed to Raven. Would I hit any limitation there? Either of size or of message contents? The thing is that Sentry only displays a few of the successful states and not the failed one (side-note: Sentry displays exactly 50 successful states). I am trying to eliminate all possible areas where the problem might be happening. Since I've confirmed that Sentry returner hands the correct data to Raven, I thought I should continue here. If there is nothing wrong with Raven, I'll proceed to Sentry itself for problems...

Any ideas what might be going wrong?

Thanks!

chrispetsos commented 6 years ago

I've confirmed that all the data leave the wire correctly. Sniffed the outgoing request from sentry_returner using Wireshark. So, this means that the problem is either on the Sentry backend somewhere or in web UI where the data are rendered. I'm using a local deployment of Sentry with docker-compose. Any idea how could I debug those two layers?

Also, I observer that the number of displayed error in the UI is maximum 50. Is there any such limitation? I'm trying to send 139 errors... Could it be a DB field max length? Confirmed that with 45 returned states, I can see my failed state.