https://github.com/fnkr/sentry-rsync-import
Import serialized Sentry reports to Sentry.
https://github.com/fnkr/sentry-rsync-import
sentry
Last synced: 10 months ago
JSON representation
Import serialized Sentry reports to Sentry.
- Host: GitHub
- URL: https://github.com/fnkr/sentry-rsync-import
- Owner: fnkr
- License: mit
- Created: 2017-12-25T17:52:10.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2020-10-06T08:25:47.000Z (over 5 years ago)
- Last Synced: 2023-02-26T12:02:48.693Z (almost 3 years ago)
- Topics: sentry
- Language: Go
- Homepage:
- Size: 23.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# [sentry-rsync-import](https://github.com/fnkr/sentry-rsync-import)
Sometimes Sentry client and server cannot communicate directly with each other.
It is still possible to forward reports to Sentry using custom transports.
This is a tool to download serialized reports from a server using rsync and submit them to Sentry.
Is is being used in production with ~600 events per minute.
## Configure custom transport
### Python
```python
import logging
import uuid
import zlib
from raven import Client as Sentry
from raven.transport.base import Transport as SentryTransport
class SentrySaveFileTransport(SentryTransport):
def send(self, url, data, headers):
with open('/var/log/sentry/{}.sentry_report'.format(str(uuid.uuid4())), 'w') as report:
report.write(zlib.decompress(data).decode('utf8'))
logging.basicConfig(format="%(asctime)s %(levelname)s %(message)s")
sentry = Sentry(dsn, transport=SentrySaveFileTransport)
```
### PHP
```php
$sentryClient = new \Raven_Client($dsn);
$sentryClient->setTransport(function ($client, $data) {
file_put_contents('/var/log/sentry/' . uniqid() . '.sentry_report', json_encode($data));
});
```