Skip to content

jonprindiville/dump-sentry-issue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

dump-sentry-issue

CLI tool to dump some data from a Sentry issue to CSV

Requirements

Usage

usage: dump_sentry_issue.py [-h] -b token_hash -i id [-m n]
                            field_name [field_name ...]

Dump some data to CSV from a Sentry issue

positional arguments:
  field_name            The field names you wish to capture

optional arguments:
  -h, --help            show this help message and exit
  -b token_hash, --bearer-token token_hash
                        Your Sentry bearer token (a hexadecimal string, see
                        https://sentry.io/api/)
  -i id, --issue id     The Sentry issue id
  -m n, --max-events n  Maximum number of events to retrieve

Output format

By default you're going to get something CSV-like on stdout (you could redirect it to a file if you like) and some logger output on stderr.

For example:

$ python dump_sentry_issue.py -b YOUR_BEARER_TOKEN -i YOUR_EVENT_ID id_param gapi_departure_id
2016-12-15 09:56:14,213 - __main__ - INFO - processing https://sentry.io/api/0/issues/YOUR_EVENT_ID/events/
2016-12-15 09:56:16,361 - __main__ - INFO - 1 urls processed...
2016-12-15 09:56:16,361 - __main__ - INFO - generating csv...

,id_param,gapi_departure_id
,1484285,605831
,1700248,639472
,1497602,542842
,1380424,600239
,1571296,646942
,1452581,532488
...

Thing this tool does not do

  • non-CSV output (or CSV output without empty leading row/column)
  • any fancy handling of the data the Sentry gives back (Sentry returns most values as repr-strings, for instance if you sent Sentry the string u'foo' it would come back through their API as u"u'foo'". We eval the values to get back a Python value -- if your value is a list, probably the things inside your list will still be repr-strings, and also the commas in the list's representation will mess up your CSV... we could be nicer and more extensible about post-processing the received data, but we're not... maybe later)

About

CLI tool to dump some data from a Sentry issue to CSV

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages