ask-honeybadger 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 31ea5af8f66f68f3840ad16c3cf52b08d8ed504983142b9a1520e1093bbb0128
|
|
4
|
+
data.tar.gz: d185dbdb7f35436b5eea45256e5cca35ce3fa39c5454e62bcd9c8bdbd1e23bbf
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2168e98402669570ec743e2b33086cb4632d4677dd11e81f80bac9d3c56834ccd7641ae13c27e138e87d498649d3a35e36fe4c1ee209004a7597c5b5b03661d7
|
|
7
|
+
data.tar.gz: 612542d35fd50492d8aabc67133d9a1b38790157087e4db9238ca26e2aee8a896328be78ba8578581043f0de97abb42434d35c4c256529722ac1b6caf294cb56
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: honeybadger.use_honeybadger
|
|
3
|
+
description: How to navigate the Honeybadger Data API — fetch faults, projects, and error details
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Use this skill when you need to interact with Honeybadger — reviewing error
|
|
7
|
+
faults, checking project health, or debugging production issues.
|
|
8
|
+
|
|
9
|
+
## Step 1: Get the Client
|
|
10
|
+
|
|
11
|
+
```ruby
|
|
12
|
+
client = Ask::Honeybadger.client
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
This returns an authenticated `Faraday::Connection` pointed at
|
|
16
|
+
`https://app.honeybadger.io/v2`. It expects a valid Honeybadger API token
|
|
17
|
+
resolved via `Ask::Auth.resolve(:honeybadger_token)`.
|
|
18
|
+
|
|
19
|
+
## Step 2: Explore the Context
|
|
20
|
+
|
|
21
|
+
```ruby
|
|
22
|
+
Ask::Honeybadger::Context::DOCS_URL # Honeybadger API docs
|
|
23
|
+
Ask::Honeybadger::Context::QUICK_START # Copy-paste examples
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
The `QUICK_START` has examples for listing projects, faults, and fault details.
|
|
27
|
+
|
|
28
|
+
## Step 3: Use Convenience Helpers First
|
|
29
|
+
|
|
30
|
+
The gem ships with helpers for the most common operations:
|
|
31
|
+
|
|
32
|
+
```ruby
|
|
33
|
+
# List projects
|
|
34
|
+
projects = Ask::Honeybadger.projects
|
|
35
|
+
|
|
36
|
+
# Recent faults for a project
|
|
37
|
+
faults = Ask::Honeybadger.recent_faults(project_id: "PROJECT_ID", limit: 10)
|
|
38
|
+
|
|
39
|
+
# Fault summary (counts by environment, status)
|
|
40
|
+
summary = Ask::Honeybadger.fault_summary(project_id: "PROJECT_ID")
|
|
41
|
+
|
|
42
|
+
# Single fault details
|
|
43
|
+
fault = Ask::Honeybadger.fault(project_id: "PROJECT_ID", fault_id: "FAULT_ID")
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
The client returns parsed JSON hashes. Use `Code` to inspect the response
|
|
47
|
+
structure.
|
|
48
|
+
|
|
49
|
+
## Step 4: Raw API Calls for Custom Needs
|
|
50
|
+
|
|
51
|
+
For endpoints without convenience helpers, use the Faraday client directly:
|
|
52
|
+
|
|
53
|
+
```ruby
|
|
54
|
+
client = Ask::Honeybadger.client
|
|
55
|
+
|
|
56
|
+
# GET request
|
|
57
|
+
response = client.get("/v2/projects/PROJECT_ID/faults/FAULT_ID/notices")
|
|
58
|
+
response.body
|
|
59
|
+
|
|
60
|
+
# With query parameters
|
|
61
|
+
response = client.get("/v2/projects/PROJECT_ID/faults", { q: "search term", order: "count" })
|
|
62
|
+
response.body
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
The API is REST-based. All responses are automatically JSON-parsed (Faraday
|
|
66
|
+
middleware handles this).
|
|
67
|
+
|
|
68
|
+
## Step 5: Authentication & Common Errors
|
|
69
|
+
|
|
70
|
+
```ruby
|
|
71
|
+
Ask::Honeybadger::Errors.status_code_description(401)
|
|
72
|
+
Ask::Honeybadger::Errors.status_code_description(429)
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Common scenarios:
|
|
76
|
+
- **401**: Token invalid or revoked → generate new token at Honeybadger settings
|
|
77
|
+
- **404**: Wrong project ID → list projects first to get correct IDs
|
|
78
|
+
- **429**: Rate limited → wait and retry (Faraday auto-retries 3 times)
|
|
79
|
+
- **500/502/503**: Honeybadger server issue → Faraday auto-retries
|
|
80
|
+
|
|
81
|
+
## Step 6: Fallback Strategy
|
|
82
|
+
|
|
83
|
+
1. Reference `Ask::Honeybadger::Context::DOCS_URL` for the full API reference
|
|
84
|
+
2. The Honeybadger API is REST + JSON — you can use any standard HTTP method
|
|
85
|
+
3. List projects first to get correct IDs before querying faults
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ask-honeybadger
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kaka Ruto
|
|
@@ -150,6 +150,7 @@ files:
|
|
|
150
150
|
- lib/ask/honeybadger/context.rb
|
|
151
151
|
- lib/ask/honeybadger/error_guide.rb
|
|
152
152
|
- lib/ask/honeybadger/version.rb
|
|
153
|
+
- lib/ask/skills/honeybadger.use_honeybadger/SKILL.md
|
|
153
154
|
homepage: https://github.com/ask-rb/ask-honeybadger
|
|
154
155
|
licenses:
|
|
155
156
|
- MIT
|