Error Tracking Should Be Automated
Sentry free plan gives you 5K errors/month with full API access. Manage issues, releases, and alerts programmatically.
Setup
import requests
TOKEN = "your_sentry_auth_token" # Settings > Auth Tokens
ORG = "your-org"
BASE = "https://sentry.io/api/0"
HEADERS = {"Authorization": f"Bearer {TOKEN}"}
List Projects
def list_projects():
r = requests.get(f"{BASE}/organizations/{ORG}/projects/", headers=HEADERS)
return [{"name": p["name"], "slug": p["slug"], "platform": p["platform"]}
for p in r.json()]
for p in list_projects():
print(f"{p[name]} ({p[platform]})")
Get Unresolved Issues
def get_issues(project_slug, query="is:unresolved", limit=10):
r = requests.get(f"{BASE}/projects/{ORG}/{project_slug}/issues/",
headers=HEADERS, params={"query": query, "limit": limit})
return [{"title": i["title"], "count": i["count"],
"first_seen": i["firstSeen"], "last_seen": i["lastSeen"]}
for i in r.json()]
issues = get_issues("my-project")
for i in issues:
print(f"[{i[count]}x] {i[title][:60]}")
Resolve Issues in Bulk
def resolve_issues(project_slug, issue_ids):
r = requests.put(f"{BASE}/projects/{ORG}/{project_slug}/issues/",
headers=HEADERS,
json={"status": "resolved"},
params={"id": issue_ids})
return r.status_code == 200
Create a Release
def create_release(version, project_slug):
r = requests.post(f"{BASE}/organizations/{ORG}/releases/",
headers=HEADERS, json={
"version": version,
"projects": [project_slug]
})
return r.json()
create_release("v1.2.0", "my-project")
Real Use Cases
- CI/CD — auto-create releases and link commits
- Slack bot — query top errors and post daily summary
- Auto-assign — route errors to team members by tag
- Cleanup — bulk-resolve old issues older than 30 days
- Metrics — track error rate trends over time
Free Plan
- 5K errors/month
- 1 user
- 30-day data retention
- Full API access
- Performance monitoring included
More from me: 10 Dev Tools I Use Daily | 77 Scrapers on a Schedule | 150+ Free APIs
Top comments (0)