{"id":13572213,"url":"https://github.com/operasoftware/sentrycli","last_synced_at":"2025-10-06T09:23:05.707Z","repository":{"id":57465612,"uuid":"56586520","full_name":"operasoftware/sentrycli","owner":"operasoftware","description":"CLI tools to query and analyze data gathered by Sentry","archived":false,"fork":false,"pushed_at":"2017-01-20T10:25:03.000Z","size":160,"stargazers_count":35,"open_issues_count":4,"forks_count":5,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-16T09:49:46.885Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/operasoftware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-04-19T10:11:47.000Z","updated_at":"2023-09-08T17:09:25.000Z","dependencies_parsed_at":"2022-09-13T13:51:09.765Z","dependency_job_id":null,"html_url":"https://github.com/operasoftware/sentrycli","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/operasoftware%2Fsentrycli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/operasoftware%2Fsentrycli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/operasoftware%2Fsentrycli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/operasoftware%2Fsentrycli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/operasoftware","download_url":"https://codeload.github.com/operasoftware/sentrycli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247153771,"owners_count":20892731,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T14:01:16.711Z","updated_at":"2025-10-06T09:23:00.676Z","avatar_url":"https://github.com/operasoftware.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# sentrycli\nCLI tools to query and analyze data gathered by [Sentry]. Introduction to `sentrycli` as guest post on [blog.getsentry.com](https://blog.getsentry.com/2016/06/21/sentry-at-opera.html).\n\n### Installation\nInstall [pip](https://pip.pypa.io/en/stable/installing/) and run:\n```\n\u003e pip install -U sentrycli\n```\nThe same command is used to upgrade to the latest version.\n\n### Usage\n\nFirst we need to get issue's identifier which is part of the URL:\n\n![Sentry issue's identifier](https://github.com/operasoftware/sentrycli/blob/master/issue_id.png)\n\n\nThen it's a two-step process. First issue's events need to be downloaded:\n```\n\u003e sentrycli query 78502 --api-key API_KEY --host http://errors.services.ams.osa\nINFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): errors.services.ams.osa\nINFO:sentrycli.query:API key is fine\nINFO:sentrycli.query:Getting events for issue 78502 (may take a while)\nINFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): errors.services.ams.osa\nINFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): errors.services.ams.osa\nINFO:sentrycli.query:200 events saved to /Users/mlowicki/projects/sentrycli_sandbox/78502.json\n```\n\nIf API key or host aren't specified then last used ones (saved in ~/.sentrycli) will be utilized.\n\n```\n\u003e sentrycli query 78502 --since 2016-04-19\nINFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): errors.services.ams.osa\nINFO:sentrycli.query:API key is fine\nINFO:sentrycli.query:Getting events for issue 78502 (may take a while)\nINFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): errors.services.ams.osa\nINFO:sentrycli.query:44 events saved to /Users/mlowicki/projects/sentrycli_sandbox/78502.json\n```\nBy default events are stored in JSON file in the current working directory.\n\nAPI keys are reachable through Sentry's UI - http://HOSTNAME/organizations/ORGANIZATION/api-keys/.\n\nWhen events are ready we can start analyzing (grouping) them:\n```\n\u003e sentrycli group 78502.json --tags server_name\n+----------------------+-------+------+\n| server_name          | count |    % |\n+----------------------+-------+------+\n| front2.sync.ams.osa  |    20 | 45.5 |\n| front6.sync.lati.osa |    19 | 43.2 |\n| front6.sync.ams.osa  |     4 |  9.1 |\n| front5.sync.lati.osa |     1 |  2.3 |\n+----------------------+-------+------+\nTotal: 44\n\n\u003e sentrycli group 78502.json --headers Content-Type\n+--------------------------+-------+-------+\n| Content-Type             | count |     % |\n+--------------------------+-------+-------+\n| application/octet-stream |    44 | 100.0 |\n+--------------------------+-------+-------+\nTotal: 44\n\n\u003e sentrycli group 78502.json --tags server_name release\n+---------+----------------------+-------+------+\n| release | server_name          | count |    % |\n+---------+----------------------+-------+------+\n| 5d74084 | front2.sync.ams.osa  |    20 | 45.5 |\n| 5d74084 | front6.sync.lati.osa |    19 | 43.2 |\n| 5d74084 | front6.sync.ams.osa  |     4 |  9.1 |\n| 5d74084 | front5.sync.lati.osa |     1 |  2.3 |\n+---------+----------------------+-------+------+\n\n\u003e sentrycli group 77268.json --header User-Agent Host --tag logger\n+------------+----------------+---------------------+-------+-------+\n| User-Agent | Host           | logger              | count |     % |\n+------------+----------------+---------------------+-------+-------+\n| Opera Mini | sync.opera.com | sync.api.middleware |   232 | 100.0 |\n+------------+----------------+---------------------+-------+-------+\n\n\u003e sentrycli group 77268.json --ctime daily\n+------------+-------+------+\n|    day     | count |    % |\n+------------+-------+------+\n| 2016-04-09 |    25 | 10.8 |\n| 2016-04-10 |    27 | 11.6 |\n| 2016-04-11 |    14 |  6.0 |\n| 2016-04-12 |     8 |  3.4 |\n| 2016-04-13 |    11 |  4.7 |\n| 2016-04-14 |    12 |  5.2 |\n| 2016-04-15 |    18 |  7.8 |\n| 2016-04-16 |    28 | 12.1 |\n| 2016-04-17 |    23 |  9.9 |\n| 2016-04-18 |     4 |  1.7 |\n| 2016-04-19 |    15 |  6.5 |\n| 2016-04-20 |    16 |  6.9 |\n| 2016-04-21 |    12 |  5.2 |\n| 2016-04-22 |    19 |  8.2 |\n+------------+-------+------+\n\n\u003e sentrycli group 41384.json --breadcrumbs \"requests.*sync.commit\" --tags server_name\n+----------------------+----------------------+-------+------+\n| server_name          | breadcrumbs in order | count |    % |\n+----------------------+----------------------+-------+------+\n| front1.sync.ams.osa  | False                |   143 | 13.3 |\n| front6.sync.ams.osa  | False                |   132 | 12.3 |\n| front6.sync.lati.osa | False                |   122 | 11.4 |\n| front5.sync.ams.osa  | False                |   109 | 10.2 |\n| front1.sync.lati.osa | False                |   101 |  9.4 |\n| front2.sync.ams.osa  | False                |   100 |  9.3 |\n| front3.sync.ams.osa  | False                |    90 |  8.4 |\n| front4.sync.ams.osa  | False                |    86 |  8.0 |\n| front3.sync.lati.osa | False                |    84 |  7.8 |\n| front4.sync.lati.osa | False                |    49 |  4.6 |\n| front2.sync.lati.osa | False                |    29 |  2.7 |\n| front5.sync.lati.osa | False                |    27 |  2.5 |\n| front1.sync.ams.osa  | True                 |     1 |  0.1 |\n+----------------------+----------------------+-------+------+\n\n\n\u003e sentrycli breadcrumbs 41384.json -a requests:data.status_code\n+----------------------------------+-------+------+\n| ('requests', 'data.status_code') | count |    % |\n+----------------------------------+-------+------+\n| \u003cNOT PRESENT\u003e                    |  1072 | 99.9 |\n| 200                              |     1 |  0.1 |\n+----------------------------------+-------+------+\n\n\u003e sentrycli breadcrumbs 41384.json -a requests:data.status_code sync.commit:data.mobile\n\n+----------------------------------+--------------------------------+-------+------+\n| ('requests', 'data.status_code') | ('sync.commit', 'data.mobile') | count |    % |\n+----------------------------------+--------------------------------+-------+------+\n| \u003cNOT PRESENT\u003e                    | \u003cNOT PRESENT\u003e                  |   930 | 86.7 |\n| \u003cNOT PRESENT\u003e                    | True                           |    76 |  7.1 |\n| \u003cNOT PRESENT\u003e                    | False                          |    66 |  6.2 |\n| 200                              | True                           |     1 |  0.1 |\n+----------------------------------+--------------------------------+-------+------+\n```\n\nTo get list of available grouping options \n(in `group` and `breadcrumbs` subcommands) use `--options` switch:\n```\n\u003e sentrycli group 76342.json --options\n+-------------------+-------------+--------+-------------------+-------------+\n| Headers           | Context     | Params | Vars              | Tags        |\n+-------------------+-------------+--------+-------------------+-------------+\n| Accept-Encoding   | filename    |        | args              | browser     |\n| Accept-Language   | lineno      |        | auth_header       | device      |\n| Authorization     | pathname    |        | bound_func        | level       |\n| Cache-Control     | process     |        | callback          | logger      |\n| Connection        | processName |        | callback_args     | os          |\n| Content-Length    | request     |        | callback_kwargs   | release     |\n| Content-Type      | sys.argv    |        | circuitbreaker    | server_name |\n...\n\n\u003e sentrycli breadcrumbs 41384.json -o\n\n+----------------------------------------------------+-------------------------+\n| Categories                                         | Attributes              |\n+----------------------------------------------------+-------------------------+\n...\n+----------------------------------------------------+-------------------------+\n| requests                                           | data.status_code        |\n|                                                    | level                   |\n|                                                    | event_id                |\n|                                                    | timestamp               |\n|                                                    | data.url                |\n|                                                    | data.reason             |\n|                                                    | message                 |\n|                                                    | type                    |\n|                                                    | data.method             |\n+----------------------------------------------------+-------------------------+\n| services_raven.clients.django.ServicesDjangoClient | level                   |\n|                                                    | event_id                |\n|                                                    | timestamp               |\n|                                                    | message                 |\n|                                                    | type                    |\n+----------------------------------------------------+-------------------------+\n\n```\n\n[sentry]: \u003chttps://github.com/getsentry/sentry\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foperasoftware%2Fsentrycli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foperasoftware%2Fsentrycli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foperasoftware%2Fsentrycli/lists"}