Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/PLAN.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ Each row is a milestone 1 test, because a change in any of them changes the desi
| Fact | Consequence | Source |
|---|---|---|
| Requests use `Authorization: Bearer <token>`. Custom-scoped tokens exist; `droplet:read`, `load_balancer:read`, and `monitoring:read` cover inventory and metrics. Tokens can expire. | The plugin asks for a custom token with read scopes only, and treats 401 as expired or revoked and 403 as a missing scope. The metrics endpoints declare no 403 response, so that mapping is *live*. | [Scopes](https://docs.digitalocean.com/reference/api/scopes/), [tokens](https://docs.digitalocean.com/reference/api/create-personal-access-token/) |
| Droplet metrics are one `GET` per metric under `/v2/monitoring/metrics/droplet/` (`cpu`, `bandwidth`, `load_1`, `memory_*`, `filesystem_*`), with `host_id`, `start`, and `end`. `bandwidth` also needs `interface` and `direction`, and is in megabits per second. There is no disk I/O or packet metric in the API. | A Droplet's CPU and four bandwidth series cost five requests per collection, and are its only agent-free series. | [OpenAPI spec](https://docs.digitalocean.com/reference/api/reference/openapi.json) |
| Responses are Prometheus-style matrices with string values. No step parameter, sample interval, or retention is documented. | The real resolution, and whether `cpu` values are cumulative, are *live* and are measured before templates fix an RRD step. | OpenAPI spec |
| Memory, load, and filesystem metrics need the metrics agent on the Droplet. | Without it those series are empty; the plugin reports "agent not installed" rather than an error, and does not offer those graphs. | [Monitoring features](https://docs.digitalocean.com/products/monitoring/details/features/) |
| Rate limits are 5,000 requests per hour and 250 per minute per token, with `ratelimit-limit`, `ratelimit-remaining`, `ratelimit-reset`, and `retry-after` on 429. | Request budget, not cost, bounds DigitalOcean collection. Five requests per Droplet every five minutes is 60 per hour, so one token covers about 80 Droplets at that rate with nothing else using it. | OpenAPI spec, "Rate Limit" |
| Droplet metrics are one `GET` per metric under `/v2/monitoring/metrics/droplet/` (`cpu`, `bandwidth`, `load_1`, `memory_*`, `filesystem_*`), with `host_id`, `start`, and `end`. `bandwidth` also needs `interface` and `direction`, and is in megabits per second. There is no disk I/O or packet metric in the API. | A Droplet's four bandwidth series cost four requests per collection, and are its only agent-free series. | [OpenAPI spec](https://docs.digitalocean.com/reference/api/reference/openapi.json) |
| Responses are Prometheus-style matrices with string values. No step parameter, sample interval, or retention is documented. | Measured live (#16): samples are 120 s apart over a one-hour window, the newest under 10 s old, and `cpu` values are cumulative. Longer windows are downsampled. | OpenAPI spec |
| Memory, load, filesystem, and (found live, #16) CPU metrics need the metrics agent on the Droplet. | Without it those series are empty; the plugin reports "agent not installed" rather than an error, and does not offer those graphs. | [Monitoring features](https://docs.digitalocean.com/products/monitoring/details/features/) |
| Rate limits are 5,000 requests per hour and 250 per minute per token, with `ratelimit-limit`, `ratelimit-remaining`, `ratelimit-reset`, and `retry-after` on 429. | Request budget, not cost, bounds DigitalOcean collection. Four requests per Droplet every five minutes is 48 per hour, so one token covers about 104 Droplets at that rate with nothing else using it. | OpenAPI spec, "Rate Limit" |
| Lists page with `page` and `per_page`; `/v2/droplets` and `/v2/load_balancers` accept up to 200. | The plugin uses 200 (*live*: confirm the server accepts it) and follows `links.pages.next`. | OpenAPI spec |

**AWS**
Expand Down
2 changes: 1 addition & 1 deletion docs/research/cost-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Research for [#22](https://github.com/somethingwithproof/plugin_cloud/issues/22)

- Requests per hour: `S × 3600 / I`, plus discovery: `ceil(R / 200)` list requests per resource type per discovery run (hourly by default).
- Limits per token: 5,000 an hour and 250 a minute. The collector budgets `share × 5,000` an hour (default share 50 percent) and spreads requests so no minute exceeds 250.
- Capacity at the defaults: `0.5 × 5,000 / 12 = 208` series at 300 s, which is 41 Droplets with the five agent-free series. At 100 percent share it is 416 series, or 83 Droplets.
- Capacity at the defaults: `0.5 × 5,000 / 12 = 208` series at 300 s, which is 52 Droplets with the four agent-free series. At 100 percent share it is 416 series, or 104 Droplets.
- Cost: none found. No page states DigitalOcean API calls are free, so the plugin reports "no charge documented", not "free".

**AWS.** `GetMetricData` bills each metric requested, counting up to five statistics of one metric as one.
Expand Down
6 changes: 3 additions & 3 deletions docs/research/metric-catalogs.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Research for [#21](https://github.com/somethingwithproof/plugin_cloud/issues/21), run 2026-11-14. Question: for each phase 1 to 4 resource type, which metrics does the plugin collect by default, and with what statistic, period, unit, conversion, data source name, and RRD bounds?

**Result.** One table per resource type follows, built from each provider's metric reference. Agent-free defaults are five series for a DigitalOcean Droplet, 14 for an EC2 instance, 9 for a Compute Engine instance, and 8 for an Azure VM. DigitalOcean documents no period or delay for any metric, and AWS and Azure document no publication delay, so those values come from the [live checks](provider-facts.md#live-checks) before templates fix an RRD step. All 77 data source names meet Cacti's limit (below).
**Result.** One table per resource type follows, built from each provider's metric reference. Agent-free defaults are four series for a DigitalOcean Droplet, 14 for an EC2 instance, 9 for a Compute Engine instance, and 8 for an Azure VM. DigitalOcean documents no period or delay for any metric (the live check on #16 measured 120 s samples), and AWS and Azure document no publication delay, so those values come from the [live checks](provider-facts.md#live-checks) before templates fix an RRD step. All 77 data source names meet Cacti's limit (below).

## Conventions

Expand All @@ -23,7 +23,7 @@ Reference: OpenAPI spec, Monitoring section, `https://docs.digitalocean.com/refe

| Provider metric (path under `/v2/monitoring/metrics/droplet/`) | Dimensions / labels / filter | Stat or aligner | Native period | Delay | Provider unit | Conversion to Cacti value | DS name | RRD min / max |
|---|---|---|---|---|---|---|---|---|
| `cpu` | label `mode` (example shows idle, iowait, irq, nice, softirq, steal; the example is cut off, so the full mode list is unverified) | none (raw series, one per mode) | not documented | not documented | cumulative seconds per mode (inferred from the example, the spec does not state it) | `100 * (delta total - delta idle) / delta total` over the two newest samples, summed over modes. GAUGE percent. If live data shows values are not cumulative, change the conversion. | `do_cpu_pct` | 0 / 100 |
| `cpu` | label `mode`: idle, iowait, irq, nice, softirq, steal, system, user (live, #16). **AGENT**: no series without the metrics agent (live) | none (raw series, one per mode) | not documented | not documented | cumulative seconds per mode (confirmed live: no mode decreased over an hour) | `100 * (delta total - delta idle) / delta total` over the two newest samples, summed over modes. GAUGE percent. | `do_cpu_pct` | 0 / 100 |
| `bandwidth` | `interface=public`, `direction=inbound` | none | not documented | not documented | megabits per second (spec states Mbps) | value * 1,000,000 = bits per second, GAUGE | `do_bw_pub_in` | 0 / U |
| `bandwidth` | `interface=public`, `direction=outbound` | none | not documented | not documented | Mbps | same | `do_bw_pub_out` | 0 / U |
| `bandwidth` | `interface=private`, `direction=inbound` | none | not documented | not documented | Mbps | same | `do_bw_prv_in` | 0 / U |
Expand All @@ -38,7 +38,7 @@ Reference: OpenAPI spec, Monitoring section, `https://docs.digitalocean.com/refe
| `filesystem_free` **AGENT** | labels `device`, `fstype`, `mountpoint` | none | not documented | not documented | bytes (example value 25832407040) | absolute, GAUGE, one index per mountpoint | `do_fs_free` | 0 / U |
| `filesystem_size` **AGENT** | same | none | not documented | not documented | bytes | absolute, GAUGE | `do_fs_size` | 0 / U |

Default set (agent-free): `do_cpu_pct`, `do_bw_pub_in`, `do_bw_pub_out`, `do_bw_prv_in`, `do_bw_prv_out`. That is five requests per Droplet per collection, matching the plan. Packet counts and disk I/O are **not available through the API** (no endpoint exists), although the control panel shows disk I/O.
Default set (agent-free): `do_bw_pub_in`, `do_bw_pub_out`, `do_bw_prv_in`, `do_bw_prv_out`. That is four requests per Droplet per collection. `do_cpu_pct` was in this set until the live check on #16 found that `cpu` needs the agent; it stays in the catalog for Droplets that have one. Packet counts and disk I/O are **not available through the API** (no endpoint exists), although the control panel shows disk I/O.

### Load balancers (index: load balancer ID, passed as `lb_id` query parameter)

Expand Down
Loading
Loading