Unfortunately not, it’s an internal project. But what we do is:
- We call the API endpoint
/api/0/projects/org_slug/project_slug/issues/?query=...&cursor=...
for the particular project until the next Link header says results="false"
- On each retrieved page we sum the count of the root array returned to get the total number of issues
- On each retrieved page we sum the event “count” of each issue to get the total number of events
- We produce the following output for prometheus which scrapes this data:
sentry_issues{organization="***", project="proj1", status="resolved", type="total"} 4461.0000
sentry_issues{organization="***", project="proj1", status="resolved", type="aggregated"} 14.0000
sentry_issues{organization="***", project="proj1", status="unresolved", type="total"} 154209.0000
sentry_issues{organization="***", project="proj1", status="unresolved", type="aggregated"} 10.0000
sentry_issues{organization="***", project="proj2", status="resolved", type="total"} 26852.0000
sentry_issues{organization="***", project="proj2", status="resolved", type="aggregated"} 52.0000
sentry_issues{organization="***", project="proj2", status="unresolved", type="total"} 297230.0000
sentry_issues{organization="***", project="proj2", status="unresolved", type="aggregated"} 280.0000
sentry_issues{organization="***", project="proj3", status="resolved", type="total"} 1402.0000
sentry_issues{organization="***", project="proj3", status="resolved", type="aggregated"} 76.0000
sentry_issues{organization="***", project="proj3", status="unresolved", type="total"} 946643.0000
sentry_issues{organization="***", project="proj3", status="unresolved", type="aggregated"} 2296.0000
… where “aggregated” means total count of issues and “total” means total count of events.
These numbers are scraped by prometheus in interval X to create a time series.
Prometheus then is the datasource for a grafana instance visualising these time series as graphs.
All that works fine, except the fact that creating these simple numbers takes a lot of time because we need to make so many calls to the Sentry API.
In a perfect world it should be one API call per project that gives me issueCount = x and eventCount = y.