All skills
google avatar

/google-cloud-filestore-autoscale

@becc4b8
by googlegoogle/skills21k stars
1,698

Inspects Google Cloud Filestore capacity and utilization, evaluates storage scaling rules, and performs capacity autoscaling (scale UP for low free space or scale DOWN for cost optimization). Use when monitoring Filestore instance headroom, resizing instance shares, configuring automated growth/shrink thresholds (custom thresholds apply globally across projects in session memory), or preventing out-of-space outages. Don't use for Cloud Storage (GCS) buckets, Persistent Disk block storage, or NetApp Volumes.

Use this Skill: https://skilld.dev/gh/google/skills/google-cloud-filestore-autoscale

This session only. Nothing lands on disk.

referencesmonitoring-metrics.md

≈852 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Filestore Monitoring Metrics

Essential Filestore Storage Metrics

When determining if a Filestore instance needs scaling, query the Cloud Monitoring API for utilization.

Used Capacity Metric

  • Metric Type: file.googleapis.com/nfs/server/used_bytes
  • Description: The amount of storage space currently utilized on the file share.
  • Aggregation: It is recommended to use a 5-minute rolling average to smooth out transient spikes.

Provisioned Capacity

  • DO NOT fetch provisioned capacity or total_bytes from Cloud Monitoring.
  • Description: The total provisioned storage capacity is identical to the instance capacity. You must read the capacityGb property directly from the instances returned by the list_instances MCP tool or the GCP API.

Fetching Metrics Across Agent Runtimes

You must retrieve the used_bytes metric from the Cloud Monitoring API. Select the method that matches your active runtime tools:

Option 1: GCP REST API Tool (e.g., call_gcp_api in Gemini Enterprise File Agent)

If your runtime provides a native GCP API execution tool, invoke it with:

  • service: "monitoring"
  • version: "v3"
  • resource_path: "projects/{project_id}/timeSeries"
  • query_params: {"filter": "metric.type=\"file.googleapis.com/nfs/server/used_bytes\""}

(Note: Do NOT include interval.startTime or interval.endTime or aggregation parameters; the tool calculates and attaches the latest 15-minute window automatically).

Option 2: gcloud CLI (Recommended for Terminal / Command-Line Agents)

If your agent environment has terminal/command execution enabled:

gcloud monitoring time-series list \
    --filter='metric.type="file.googleapis.com/nfs/server/used_bytes"' \
    --project="{project_id}" \
    --format="json"
Option 3: Direct HTTP REST (curl)
curl -s -H "Authorization: Bearer $(gcloud auth print-access-token)" \
    "https://monitoring.googleapis.com/v3/projects/{project_id}/timeSeries?filter=metric.type%3D%22file.googleapis.com%2Fnfs%2Fserver%2Fused_bytes%22"
Option 4: Cloud Monitoring MCP

If an MCP server for Google Cloud Monitoring is mounted, use list_time_series with:

  • filter: metric.type="file.googleapis.com/nfs/server/used_bytes"

Critical Metric Query Rules (Applies to All Methods)

  1. NO LOCATION FILTERS REQUIRED: Do NOT attempt to filter by zone, region, or location (e.g., us-central1-a). Filestore metric labels differ between zonal and regional tiers; querying at the project level avoids empty results.
  2. ONE BULK QUERY PER PROJECT: Always fetch metrics for the entire project in a single call to avoid per-instance agent looping and timeouts.
  3. DO NOT FETCH total_bytes: Read capacityGb directly from list_instances. Do not make secondary queries for provisioned capacity.
  4. INSTANCE FILTER (IF SCOPED): When filtering to a single instance, use resource.labels.instance_name="{instance_name}" (NOT instance_id).

Calculation Formulas

  • Free Bytes: total_bytes - used_bytes
  • Free Space Percentage: ((total_bytes - used_bytes) / total_bytes) * 100

Use these formulas when evaluating instances against the max_threshold and min_threshold safety factors.

Source: SKILL.md on GitHub

No alerts10d3 checks · Risk SAFE
  • Gen Agent Trust Hub10d

    This skill provides functionality for autoscaling Google Cloud Filestore instances based on storage utilization. It includes robust safety measures, such as mandatory user confirmation prompts before performing any capacity modifications, and follows best practices for querying Google Cloud APIs. No security issues were detected.

  • Socket10d

    No alerts

  • Snyk10d

    Risk: LOW · No issues

Signed by skilld at becc4b8. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 2 weeks ago
metadata
{
  "version": "1.0.0",
  "category": "Storage"
}

README badge

README badge for google/skills/google-cloud-filestore-autoscale