AI 에이전트의 지연, 오류, 토큰 사용량, 안전성, 보안, 응답 품질을 감시하는 Terraform 알림 파일을 만듭니다. 원격 측정 데이터와 기존 정책을 먼저 확인하고 설정을 검증하며, 품질 알림에는 Vertex AI가 필요합니다.
- 에이전트 지연과 오류율 모니터링
- 토큰 사용량 급증 알림
- 안전성 신호와 권한 거부 추적
Google Cloud 프로젝트의 Cloud Logging 비용을 청구 내보내기 데이터와 사용량 지표로 대조해 분석합니다. 차트, 비용 요인, 절감 후보, 복사 가능한 제외 필터를 담은 HTML 보고서를 만들고 실제 청구액과 추정치를 구분합니다.
Audits Cloud Logging costs for a Google Cloud project: the charges for log entries written to log buckets, the services, log streams and severities that drive them, and the log sinks that route them. Reconciles Cloud Billing export costs with Cloud Monitoring volume metrics, and generates a FinOps report with charts and copy-paste exclusion filters. Use when auditing Cloud Logging spend, finding logging waste, identifying top logging contributors, generating log cost reduction reports, or creating log sink exclusion filters. Don't use for querying log entries (use cloud-logging-query-generation), configuring Cloud Monitoring alerts, or querying metrics/traces.
실행 점수 미검증
설치 방법 보기Google Cloud의 Cloud Logging 비용을 분석하고 비용 내역과 절감 후보를 차트가 포함된 HTML 보고서로 정리합니다. Cloud Billing 청구 내보내기 데이터와 Cloud Monitoring 사용량 지표를 대조해 서비스, 로그 유형, 심각도, 로그 전달 대상별 비용 요인을 살펴봅니다. 복사해 사용할 수 있는 제외 필터와 수치 계산 근거도 제공합니다.
로그 비용이 증가한 이유를 조사하거나 운영팀이 절감 방안을 검토할 때 사용할 수 있습니다. 청구 데이터를 얻을 수 없는 경우에는 정가 기준 추정치라고 표시해 실제 청구액과 구분합니다. 보고서 수치의 근거와 재검증 결과를 확인할 때도 활용할 수 있습니다.
gcloud, 인증 정보, 활성 결제 계정과 읽기 권한이 필요합니다. 실제 청구액을 가져오려면 BigQuery 내보내기 데이터와 접근 권한도 필요합니다. 로그 버킷을 Observability Analytics로 업그레이드하면 되돌릴 수 없으며 별도 승인이 필요합니다. Data Access 감사 로그 제외는 규정 확인이 필요하므로 절감액에 포함하지 않습니다.
이 소개문은 공개된 SKILL.md를 바탕으로 AI(OpenAI Codex)가 작성했습니다. 정확한 사양은 아래 원문을 확인하세요.
AI가 SKILL.md의 내용에서 주의가 필요한 작업과 도입 전제를 확인했습니다. 점수는 실제로 실행한 결과(실행 검증)만으로 매깁니다.
점수에는 넣지 않았습니다. 2026년 10월 28일 기준으로 AI(OpenAI Codex)가 판정했습니다. 참고용이므로 설치 전에 원문도 확인해 주세요.
설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.
Non-interactive runs. When no user can answer (e.g. a scheduled or
automated run), ask nothing: audit the project named in the request, or the
active gcloud project; use --billing-mode=search; cover all five report topics
(Step 2.5); and never enable an API or upgrade a log bucket. Put anything that
needed a user (a disabled API, a missing role, the upgrade advisory) in the
report instead.
MUST READ: Before executing any gcloud, REST API, or MCP command, you
MUST read and follow the instructions in
Usage Attribution.
The audit covers one Google Cloud project, {project_id}: the project the user
names or, if they don't name one, the active gcloud project (gcloud config get project), confirmed with the user.
Discover everything else (log buckets, Observability Analytics, sinks, exclusions, metrics) yourself; never ask the user about those. The billing export is the exception: finding it unaided can mean scanning every project on the billing account, so ask once, before running anything, and don't start a search until the user has chosen answer 3 (single-select, using the host's question tool if it has one):
Do you know where the Cloud Billing export for
{project_id}is?
- Yes — here it is (the BigQuery table ID
project.dataset.table, or just the project and dataset)- There's no billing export for this project
- No / not sure — search for it (seconds on a small project; on a large billing account it can take a long time)
| Answer | Flags | Cost figures |
|---|---|---|
| 1 | --billing-mode=explicit plus --billing-table (or --billing-project/--billing-dataset) | invoiced |
| 2 | --billing-mode=none | list-price estimates |
| 3 | --billing-mode=search (default) | invoiced if found, else estimates |
Answer 3's search has no time limit: it checks {project_id} first (usually
under 10 s, 1–2 min with many tables), then every project on its billing account
(can take many minutes; progress prints every 30 s). Tell the user this before
launching. If the wait is unacceptable, offer to switch to answer 1 (they look up
the table) or answer 2 (skip the export and use list-price estimates). Don't
suggest setting up an export to make the search faster.
If the search found an export, tell the user: "Next time, pass
--billing-table=<table> and discovery drops to about two seconds."
Check these prerequisites before Step 2; fix only what is missing:
gcloud is not installed, follow
https://docs.cloud.google.com/sdk/docs/install-sdk.md.txt.gcloud config get project; if it isn't {project_id}
(from Step 0), run gcloud config set project {project_id}.gcloud auth application-default login, or set
GOOGLE_APPLICATION_CREDENTIALS to a service account key.SERVICE_DISABLED, "has not been used in
project"), name it, ask the user, and on approval run gcloud services enable {api} --project={project_id} (tagged as described below):
logging, monitoring: required; without them there is nothing to
audit.bigquery: invoiced costs from the billing export.observability: resolves the project's default log scope, so log
samples match what Logs Explorer shows.cloudasset, cloudbilling: only answer 3's search across the billing
account.IAM roles for the identity running the audit. The skill never grants roles: the scripts run with the user's own credentials and read only what those credentials can. When a step fails on permissions, its advisory names the step; tell the user which role below it needs:
| Role | Needed for |
|---|---|
roles/logging.viewer, roles/monitoring.viewer | Every audit: log buckets, sinks, log samples, volume metrics |
roles/bigquery.jobUser, roles/bigquery.dataViewer (on the export dataset) | Invoiced costs from the billing export |
roles/logging.viewAccessor on log views in other projects | Reading samples through a default log scope that includes them |
roles/cloudasset.viewer, roles/billing.viewer (billing account) | --billing-mode=search across the billing account |
roles/logging.configWriter | Only the optional Observability Analytics upgrade (Step 3B) |
[ -f /tmp/finops_venv/bin/python ] || (uv venv /tmp/finops_venv && uv pip install -r scripts/requirements.txt --python /tmp/finops_venv/bin/python)
The bundled scripts tag their Google Cloud API requests. For commands you run yourself, follow Usage Attribution.
Start the collector below as a background process (it takes from seconds to many minutes), then go to Step 2.5 while it runs:
/tmp/finops_venv/bin/python scripts/collect_logging_data.py \
--project-id {project_id} --billing-mode={none|explicit|search}
Optional: --billing-project, --billing-dataset, --billing-table (e.g.
billing-proj.ds.gcp_billing_export_v1_XXXX or a curated FinOps view).
Outputs: logging_usage_summary.json, monthly_details/, service_details/,
and [FINOPS ADVISORY] lines (see Step 3). The collector's output ends with a
[COLLECTION PROFILE] table of per-stage timings; if the run took longer than
the times in Step 0, or the user asks why the audit took so long, read that
table before guessing.
Always ask this while the collector runs (multi-select). If the user skips it, cover all five topics:
What should this report answer?
- Where is the money going — attribution by service and stream
- Is spend growing — trends and projection
- What can I safely turn off — concrete savings actions
- What are these logs actually saying — noisiest patterns and samples
- Severity and audit-log posture
The user's choices decide which outputs you read in depth and what your summary leads with; they never change what the collector gathers:
| Interest | Read deeply |
|---|---|
| Attribution | service_details/*.json, daily_services |
| Growth | monthly_details/*.json, mom_patterns, cost_projection |
| Savings actions | reduction_actions, extraneous_spend |
| What logs say | severity_summary.samples_by_service, granular_analytics.top_signatures (Observability Analytics only) |
| Severity / audit | severity_summary, withheld-rule reasons |
Your narrative goes in insights/executive_summary.html (see
Executive Summary Authoring).
You don't write the savings actions: the generated report's Cost Optimizer tab
lists them from reduction_actions.
[!CAUTION] Never edit
assets/report_template.html.
[!IMPORTANT] Unless figures are invoiced (
billing_metadata.invoiced), tell the user in plain language where you looked, what you found, and what the numbers are based on. Keep internals (stage numbers, mode names, HTTP codes, "quota project", "Cloud Asset Inventory") in the log andbilling_metadata.fallback_chain.
explicit_table or
explicit_scope step not found): the collector never searches beyond what
the user named. Tell them what was wrong, from the step's detail (no rows
for this project, no export table there, or the query failed), that costs
are list-price estimates, and offer to rerun with a corrected location or
with answer 3.user_declared_no_export): "I didn't search — you told me
there's no billing export — so costs are list-price estimates, not invoiced
amounts." Never call a skipped search exhausted.billing_account status not_found): "I
searched this project and your billing account and found no billing export.
Costs are list-price estimates (quote each SKU's price and free tier from
pricing.skus) over a trailing 30 days." Only this case supports
recommending export setup. Cite the official pricing page
(https://cloud.google.com/products/observability/pricing) as the source of
list prices.inconclusive): tell the user the lookup couldn't complete, so costs are
estimates. Never tell them no billing export exists; the search didn't
finish.local_project status
no_project_records): "This project has a billing export, but it holds no
records for this project, so I searched the rest of the billing account."
Then report the outcome of that wider search as above.actual_bq_billing or
usage_estimated; state the exact date boundary in the executive summary.When on list pricing, recommend export for accuracy: future audits would use the actual invoice, including discounts, over multiple months.
Observability Analytics was formerly called Log Analytics; the scripts' advisories and field names still use the old name.
_Default log bucket to Observability Analytics?
This can't be undone." Telling the user how to run it themselves is not
asking. Only after they approve upgrading that log bucket, run /tmp/finops_venv/bin/python scripts/enable_log_analytics.py --project-id {project_id}. The audit
proceeds on Cloud Monitoring either way.[!CAUTION] Never run
enable_log_analytics.pyorgcloud logging buckets update --enable-analyticsin the same turn you raise the advisory, or on general permission like "do whatever you need".
Representative logs unavailable advisory: samples are missing because
your environment can't read log entries (needs roles/logging.viewer), not
because streams are empty. Relay the error and role; per-stream detail is in
severity_summary.sample_errors.analytics_metadata.log_read_scope). If its source is project and it
has a note, the scope couldn't be resolved, so logs held outside this
project's log buckets weren't read. Say that and relay the note; never say the
stream has no logs.[!CAUTION] Never quote cost or volume derived from Observability Analytics payload byte sums; they overstate billed volume about 2x.
| Question | Source |
|---|---|
| Cost, GiB ingested | Billing export (billing.query_logging_billing_costs, daily_gib, monthly_costs) |
| Service mix | logging.googleapis.com/billing/bytes_ingested (resource_type) |
| Log stream / severity volume | logging.googleapis.com/byte_count (log, severity) |
| Severity mix, entry content | Observability Analytics SQL (constants.PAYLOAD_BYTES_SQL) |
byte_count (received) and billing/bytes_ingested (billed) differ by
~1.5x or more; never divide one by the other.telemetry_integrity.status is degraded, say dips on the listed days
look like a metric defect that won't self-correct, and repeat the limits in
telemetry_integrity.note. Never claim with certainty that nothing changed.is_partial: true is month-to-date. Label it so, and never
call it a complete month or "last month".extraneous_spend.headline is a conservative floor: the sum of the
reduction_actions.actions with counted: true (duplicate bucket routing,
flow-log sampling, DEBUG logs, stale exclusions), each priced on exactly what
its remedy removes. Everything else is surfaced, never counted: over-retention
(not quantified), sampled exclusion rules (estimates), and Data Access audit
logs (in withheld).
≥ X%), never a point estimate or "up to".status is insufficient_data, give no figure — not a guess, a
benchmark, or $0.flag verbatim; it is written for the reader.uncounted_total_pct may be mentioned as upside,
never added to the headline.headline.exceeds_sanity_ceiling, say the headline isn't reliable, name
the largest counted action, and flag it for manual review. Offer no number.inventory_unavailable is non-empty, say log sink, exclusion and
flow-log actions weren't checked; never say none exist.withheld entry, or the user
names them), say they are left out of the number because they need a
compliance decision: disabling or excluding them is frequently prohibited
by compliance or security policy, so the owner must confirm before acting.sample_coverage.shown_pct.monthly_gib, monthly_usd), never a
rule's sample-window GiB (granular_analytics.exclusion_candidates).rule_scope: stream drops every log entry of that severity in the stream; say so.refused_claims is non-empty, name the streams the safety gate removed.Never offered as actions: CRITICAL/ALERT/EMERGENCY (incident signal), free
_Required streams ($0, audit retention), Data Access audit logs (often
compliance-mandated; report, never count), and streams with no measured volume.
[!CAUTION] Hand-written exclusion filters must: include a severity predicate (
severity = "DEFAULT"for DEFAULT — omitting it matches everything); use the URL-encoded log ID (compute.googleapis.com%2Ffirewall); never embed unescaped log text or rotating tokens (UUIDs, IPs, long integers, times) in a regex; and respect the list above.
/tmp/finops_venv/bin/python scripts/build_report.py --summary logging_usage_summary.json --insights-dir insights/ --output log_usage_report.html
build_report.py writes an executive summary unless you provide
insights/executive_summary.html.
Give the user one link that, when clicked, opens the fully rendered report — not raw HTML, not a missing file — from wherever the user actually is. Confirm that will happen before you post it.
Then list what they can explore (charts, service drilldowns, ranked actions with copyable filters, ✓ Prove It drawers) and suggest 3–4 follow-up questions drawn from this project's data, phrased to ask as-is.
If the user asked something specific, answer it directly with both GiB and USD,
from monthly_aggregations (latest_complete_month names the newest whole
month; each month's top_service is its Top Cost Driver), mom_patterns,
cost_projection, trailing_30d_summary (its top_driver is the report's Top
Cost Driver without an invoice), granular_analytics (present only when
Observability Analytics ran), or the per-service/month detail files.
Phase 1 (default): answer from the JSON on disk in a few sentences or a small table, name what the data can't settle, then stop and offer 3–4 ways to go deeper. Don't re-run collection or re-query sources.
| Question about | Read |
|---|---|
| A severity | severity_summary, granular_analytics.top_signatures for that severity |
| A service | service_details/{service}.json, top_signatures and top_log_names for it |
| An optimization action | its entry in reduction_actions.actions (claims, refused_claims, flag, counted) |
Phase 2 (only after the user picks a direction): go as deep as it needs. Run
Observability Analytics SQL against analytics_metadata.table_name, the _AllLogs view
the collector measured. Step 3 still applies.
provenance.claims[<id>] records each headline figure's formula, sources
(exact query, Google Cloud console link, steps; only the 10 largest streams per action),
known differences from the console, and runnable checks (covering every
stream). Ids include latest_complete_spend, mtd_run_rate,
trailing_30d_volume, estimated_run_rate, top_cost_driver,
extraneous_spend, severity_costs, service_mix, action::<action id>. A
claim built from others lists them in see_also (extraneous_spend → its
counted actions); prove those too, and verify_claim.py re-checks them with it.
When asked to prove a figure:
differences./tmp/finops_venv/bin/python scripts/verify_claim.py --summary <summary> --claim "<id>"; don't wait.differences; give ✗ causes
in one line each.[!CAUTION] Prove It is the only request that may re-query sources, and only via
verify_claim.py. Don't re-run collection or alter the recorded queries.
Disclose when relevant: whether the claim was priced (pricing.mode) per_sku
(each SKU's price and free tier in pricing.skus) or blended (reason in
pricing.notes); that service and severity figures exclude credits; and, if
cross_project_billing, that reproducing it needs roles/bigquery.dataViewer
on the billing export dataset and roles/bigquery.jobUser.
아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.
로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.
아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.
AI 에이전트의 지연, 오류, 토큰 사용량, 안전성, 보안, 응답 품질을 감시하는 Terraform 알림 파일을 만듭니다. 원격 측정 데이터와 기존 정책을 먼저 확인하고 설정을 검증하며, 품질 알림에는 Vertex AI가 필요합니다.
Model Garden 모델을 Agent Platform 엔드포인트에 배포하도록 돕습니다. 지원 하드웨어와 시간당 예상 비용을 확인하고, 배포 진행 상황과 추론 테스트를 살핀 뒤 사용을 마치면 모델과 엔드포인트를 정리할 수 있습니다.
Agent Platform에서 온라인 모델 예측 요청을 받는 엔드포인트를 관리합니다. 목록과 설정을 확인하고 생성·수정·삭제하며, 권한 오류와 할당량 초과, 리소스 처리 중 오류도 조사합니다.
Google Cloud에서 AI 모델과 에이전트를 평가하고 테스트 데이터를 구성하며 채점 지표를 선택합니다. 모의 사용자 시나리오 생성, 실패 분석, 수정 전후 결과 비교로 프롬프트와 코드를 개선할 근거를 마련합니다.
Call Gemini and OpenMaaS models such as Llama, DeepSeek, and Qwen through Google Cloud Agent Platform. Prepare authentication and SDK code, run prompts, configure connection endpoints, and troubleshoot common request errors.
한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.
Google AI Studio의 Gemini API를 Google Cloud의 Gemini Enterprise Agent Platform으로 옮기는 절차를 안내합니다. 결제, 권한, 인증 설정과 SDK 및 지원되는 에이전트 도구의 연결 변경을 다룹니다.