Solutions

Cloud & cost

Count what is running, and price it.

#cloud-costprivate channel3 tool calls

How many machines are running, in which environment, and what they cost. Read from Cloud Monitoring through a read-only service account, grouped by what the machines are for, and priced from their types — with the surprise explained: the “app VMs” were Cloud Run instances.

cloud-cost

Mei8:40 AM

@attest_tag how many VMs are running in testing and staging right now, and what do they cost a month?

attest_tagApp8:41 AM

  • gcp_query_metrics · compute uptime · testing · last 30m · 10 instances
  • gcp_query_metrics · compute uptime · staging · last 30m · 12 instances
  • run_js · price by machine type · 2 projects

22 VMs — 10 in testing, 12 in staging — all running and incurring cost.

  • Testing: 6 cluster nodes, 2 app instances, 1 NFS server, 1 static webhook host
  • Staging: 6 cluster nodes, 5 webhook handlers in an instance group, 1 NFS server
  • Rough compute cost across both: about $1,420 a month (testing ≈ $430, staging ≈ $990); the always-on services are most of it

The two “app VMs” in testing are Cloud Run service instances, not machines — billed for the CPU and memory they use, and at a much lower rate while idle.

google/gemini-flash15.7k in720 out$0.0081Configure

Names, figures, repositories and customers are changed; token counts and cost are illustrative. The ask, and the shape of the answer, are as they were.

How the turn went

Two projects, two queries, priced in the sandbox, with the surprise explained.

  1. 01

    Two projects, two queries

    Uptime over the last half hour, per project the connection may read. A project it may not read answers 403, and it says so rather than inventing a number for it.

  2. 02

    Grouping and pricing in the sandbox

    Instances go into run_js with their machine types; groups and a monthly figure come out. The figure is labelled rough because it is compute only.

  3. 03

    The surprise, explained

    Names that look like VMs and are not. It checked the logs for the resource type before answering, and the answer says what they are and how they bill.

What it needs

The setup, in the console.

Connection
The GCP monitoring preset, read-only, one connection per project, attached to the channel that asks about cost. Test connection makes the preset's check call before you save.
Credential
A service account key with the Viewer role for logs or monitoring on the project. Sealed with AES-256-GCM in the database; the proxy signs each request, and the key is never in a prompt.
Scope
A private cost channel is the usual home; the finance person asking is a member, so the reads run.

What it will not do

Enforced outside the model.

  • It cannot stop, resize or delete anything: the presets carry no write. The saving it recommends is a person's to make.

  • A project the key cannot read stays unread; it will not try another credential.

Try it

Say it in a channel it is in.

The sentence as it was typed. It works in any channel the bot has been invited to that carries the connection above — no command syntax, no form, and follow-ups in the thread need no mention.

@attest_tag how many VMs are running in testing and staging right now, and what do they cost a month?

  • Google Cloud
  • Datadog
  • Grafana
  • gcp_query_metrics
  • gcp_query_logs
  • run_js

Bring the channel this would live in.

Sign up, connect the service above in one channel, and type this sentence yourself — or run the same binary on your own infrastructure.

All solutions