# Cloud Function

> Cloud Functions bill per invocation plus compute time and memory, across both 1st and 2nd generation runtimes. ZopNight inventories every function via Cloud Asset Inventory and correlates invocation metrics over a 42-day Cloud Monitoring lookback, surfacing unused functions, runaway triggers, and minimum-instance settings that bill while no events arrive.

Source: https://zop.dev/integrations/gcp/cloud-function
Updated: 2026-08-19

---

Cloud Functions run event-driven code without servers, billed per invocation, compute time, and memory. Cost is usually modest, but minimum-instance settings and runaway triggers can turn functions into steady spenders.

## Three small meters that usually stay small

Each invocation charges a per-call fee plus compute time metered against the function's memory and CPU allocation for the duration of the call. For most event-driven code this rounds to pocket change. The meters only grow teeth in two situations: when invocation volume explodes, or when a minimum-instances setting keeps allocated capacity warm between events, billing steadily for readiness rather than work. Second-generation functions run on Cloud Run infrastructure, which brings the same warm-capacity economics with them.

## One inventory across both generations

ZopDev inventories functions via Cloud Asset Inventory, covering both 1st and 2nd gen, and correlates invocation metrics over the 42-day Cloud Monitoring lookback. Functions that have not fired in the whole window get surfaced as unused, and misconfigured ones, such as an idle function holding warm instances, stand out because their cost curve is flat while their invocation curve is zero.

## When a function stops being cheap

Runaway triggers are the classic incident: a function writing to the bucket or topic that triggers it, invoking itself in a loop that bills per cycle. Retry storms come next: event retries on a persistently failing function pay for every futile attempt until someone notices the error rate. Quieter but steadier is the abandoned integration, an event source that keeps firing a function whose downstream was decommissioned, doing perfectly billed work nobody consumes.

## Inspecting a function in the console

Google Cloud console → Cloud Functions lists every function with its generation, trigger, and region. A function's Metrics tab plots invocations and execution time (the same signals ZopNight reads), and its details show the minimum-instances value, the setting most worth checking on anything non-production.
