Lab 30.4: Enterprise Telemetry Governance & FinOps Cost Control (support-ops-agent)
Goalβ
In this challenge lab, you will harden support-ops-agent (the canonical Part 6 agent built across Modules 30.1β30.3) for enterprise cloud launch by configuring zero-RPC, offline-safe BigQuery Agent Analytics, ADK 2.0 FinOps guardrails (ContextCacheConfig, EventsCompactionConfig, and thinking-aware max_output_tokens), an automated FinOps & Privacy Audit Gate (scripts/finops_telemetry_audit.py), and a partition-pruned BigQuery Daily FinOps SQL Rollup (sql/daily_finops_summary.sql) over support_ops_agent_telemetry.
Prerequisites & Workspace Setupβ
Environment setup:
- 1-Click Launch (Browser): Open in GitHub CodespacesOpen in Google Cloud Shell
- Local machine: If you're continuing the course in sequence,
cdinto theadk-trainingproject you created in Module 2 and skip the block below -- your environment and dependencies already carry forward. If you're starting fresh at this module, create that project first:uv init adk-training --python 3.10 && cd adk-training
uv add "google-adk>=2.1.0" python-dotenv- DevContainer / Codespaces (Alternative): If you opened this repository in a DevContainer or GitHub Codespaces, Python 3.11,
uv,gcloud, and all core ADK dependencies are pre-installed in your container environment.
If you already have your support-ops-agent directory from Modules 30.1β30.3, cd into it and create the scripts/ and sql/ folders. Otherwise, run the canonical agents-cli create fast-bootstrap from your parent workspace folder (never mkdir support-ops-agent beforehand):
cd /path/to/your/adk-training
agents-cli create support-ops-agent \
--agent adk \
--prototype \
--agent-guidance-filename GEMINI.md \
--skip-checks -y
cd support-ops-agent
mkdir -p scripts sql
agents-cli info
Step 1: Instrument & Cost-Tune Canonical app/agent.pyβ
Open support-ops-agent/app/agent.py and replace it with the starter skeleton below, keeping the canonical TCK-1042 / TCK-2088 stateful triage tools (initialize_support_state, lookup_ticket, check_sla_policy, escalate_ticket) from Module 30.1 intact while completing # TODO 1 through # TODO 3:
- Zero-RPC, Offline-Safe
build_telemetry_plugins()(# TODO 1):- Read
GOOGLE_CLOUD_PROJECTfromos.environ. If it is unset or empty, immediately return[]so local offline runs and unit tests work with zero cloud credentials. - Inside a
try ... except Exception as exc:block, lazily importBigQueryAgentAnalyticsPluginandBigQueryLoggerConfigfromgoogle.adk.plugins.bigquery_agent_analytics_plugin. - Read
BQ_ANALYTICS_DATASET_ID(default"support_ops_agent_telemetry") andGOOGLE_CLOUD_LOCATION(default"us-central1"). Do not execute synchronousbigquery.Client().create_dataset(...)network calls during container startup (Terraformtelemetry.tfprovisionssupport_ops_agent_telemetryahead of time at0 mscold-start cost!). - Return
[BigQueryAgentAnalyticsPlugin(...)]configured withBigQueryLoggerConfig(gcs_bucket_name=os.environ.get("BQ_ANALYTICS_GCS_BUCKET"), connection_id=os.environ.get("BQ_ANALYTICS_CONNECTION_ID")). On anyImportErroror credential error, log a warning and return[].
- Read
root_agentOutput & Thinking Guardrail + Cache-Friendly Prefix (# TODO 2):- Set
name="support_ops_agent"(matchingcreate_params.root_agent_nameinagents-cli-manifest.yaml),model=MODEL("gemini-3.8-flash"), andbefore_agent_callback=initialize_support_state. - Pass
STATIC_SLA_SOPdirectly asinstructionwithout interpolatingdatetime.now()or random UUIDs at the top of the prompt so prefix context caching stays deterministic (in production, enterprise runbooks + MCP tool schemas exceed the4,096-token caching floor). - Attach
tools=[lookup_ticket, check_sla_policy, escalate_ticket]. - Set
generate_content_config=types.GenerateContentConfig(max_output_tokens=2048)to bound runaway output tokens while leaving ample headroom forgemini-3.8-flashthinking tokens.
- Set
AppFinOps Controls (ContextCacheConfig&EventsCompactionConfigβ# TODO 3):- Instantiate
app = App(...)withname="app",root_agent=root_agent, andplugins=build_telemetry_plugins(). - Configure
context_cache_config=ContextCacheConfig(min_tokens=4096, ttl_seconds=1800, cache_intervals=10). - Configure
events_compaction_config=EventsCompactionConfig(compaction_interval=8, overlap_size=2).
- Instantiate
# support-ops-agent/app/agent.py (Starter Skeleton)
"""
Enterprise Support Operations Agent β FinOps & Telemetry Hardened (`agents-cli`).
Preserves canonical Part 6 stateful tools (`TCK-1042`, `TCK-2088`) while adding
zero-RPC BigQueryAgentAnalyticsPlugin, ContextCacheConfig, and EventsCompactionConfig.
"""
import logging
import os
from typing import Any
from google.adk.agents import Agent
from google.adk.agents.callback_context import CallbackContext
from google.adk.agents.context_cache_config import ContextCacheConfig
from google.adk.apps import App
from google.adk.apps.app import EventsCompactionConfig
from google.adk.tools.tool_context import ToolContext
from google.genai import types
MODEL = "gemini-3.8-flash"
# Keep static SOPs, SLA matrices, and formatting rules deterministic at the top
# of the prompt so ContextCacheConfig achieves maximum prefix cache hits.
# (Abbreviated for readability; production SOPs + tool schemas exceed 4,096 tokens.)
STATIC_SLA_SOP = """You are the Enterprise Support Operations Triage Agent.
Standard Operating Procedures (SLA & Escalation Matrix):
- Enterprise Tier: P1 = 15 minutes (24/7 P1 SRE Oncall), P2 = 1 hour, P3 = 4 hours.
- Standard Tier: P1 = 2 hours (Tier-2 Engineering Queue), P2 = 8 hours, P3 = 24 business hours.
Mandatory Operational Workflow:
1. When given a ticket ID, ALWAYS call `lookup_ticket` first.
2. If `lookup_ticket` returns `not_found`, state clearly that the ticket was not found and list `available_sample_tickets`.
3. Call `check_sla_policy` for the ticket's customer tier so your answer cites exact SLA response times.
4. If a ticket has P1 severity OR the user requests escalation, call `escalate_ticket` with a concise technical reason.
5. Never fabricate ticket records, customer PII, or refund commitments.
"""
TICKET_DB: dict[str, dict[str, Any]] = {
"TCK-1042": {
"customer": "Acme Cloud Robotics",
"tier": "enterprise",
"severity": "P1",
"ticket_status": "open",
"summary": "Production payment webhook returning HTTP 503 timeouts in eu-west1.",
},
"TCK-2088": {
"customer": "Northwind Retail",
"tier": "standard",
"severity": "P3",
"ticket_status": "investigating",
"summary": "CSV invoice export omits localized tax column.",
},
}
SLA_POLICIES: dict[str, dict[str, str]] = {
"enterprise": {
"P1_response": "15 minutes",
"P2_response": "1 hour",
"P3_response": "4 hours",
"dedicated_oncall": "Yes (24/7 SRE pager)",
},
"standard": {
"P1_response": "2 hours",
"P2_response": "8 hours",
"P3_response": "24 business hours",
"dedicated_oncall": "No (business-hours queue)",
},
}
def initialize_support_state(callback_context: CallbackContext) -> None:
"""Initializes default session and user state keys before the first turn."""
if "user:customer_tier" not in callback_context.state:
callback_context.state["user:customer_tier"] = "standard"
if "escalated_tickets" not in callback_context.state:
callback_context.state["escalated_tickets"] = []
def lookup_ticket(ticket_id: str, tool_context: ToolContext) -> dict[str, Any]:
"""Looks up an enterprise support ticket by ID and syncs customer tier into state."""
norm_id = ticket_id.strip().upper()
record = TICKET_DB.get(norm_id)
if not record:
return {
"status": "not_found",
"ticket_id": norm_id,
"available_sample_tickets": sorted(TICKET_DB.keys()),
"message": f"Ticket '{norm_id}' was not found.",
}
tool_context.state["user:customer_tier"] = record["tier"]
tool_context.state["active_ticket_id"] = norm_id
return {"status": "found", "ticket_id": norm_id, **record}
def check_sla_policy(tier: str) -> dict[str, Any]:
"""Returns response-time SLA targets for a customer tier ('enterprise' or 'standard')."""
norm_tier = tier.strip().lower()
policy = SLA_POLICIES.get(norm_tier)
if not policy:
return {
"status": "error",
"message": f"Unknown tier '{tier}'. Valid tiers: enterprise, standard.",
}
return {"status": "success", "tier": norm_tier, "sla_targets": policy}
def escalate_ticket(
ticket_id: str,
reason: str,
tool_context: ToolContext,
) -> dict[str, Any]:
"""Escalates a high-severity support ticket to the incident engineering queue."""
norm_id = ticket_id.strip().upper()
if norm_id not in TICKET_DB:
return {
"status": "error",
"message": f"Cannot escalate unknown ticket '{norm_id}'.",
}
escalated = list(tool_context.state.get("escalated_tickets", []))
if norm_id not in escalated:
escalated.append(norm_id)
tool_context.state["escalated_tickets"] = escalated
tier = tool_context.state.get("user:customer_tier", TICKET_DB[norm_id]["tier"])
queue = "24/7 P1 SRE Oncall" if tier == "enterprise" else "Tier-2 Engineering Queue"
return {
"status": "escalated",
"ticket_id": norm_id,
"assigned_queue": queue,
"reason": reason.strip(),
"session_escalated_tickets": escalated,
}
def build_telemetry_plugins() -> list[Any]:
"""Initializes BigQueryAgentAnalyticsPlugin lazily with zero startup RPCs."""
# TODO 1: Read GOOGLE_CLOUD_PROJECT from os.environ.
# - If unset/empty, return [].
# - Otherwise, inside `try ... except Exception as exc:`, lazily import
# `BigQueryAgentAnalyticsPlugin` and `BigQueryLoggerConfig` from
# `google.adk.plugins.bigquery_agent_analytics_plugin`.
# - Read BQ_ANALYTICS_DATASET_ID (default "support_ops_agent_telemetry") and
# GOOGLE_CLOUD_LOCATION (default "us-central1").
# - Return `[BigQueryAgentAnalyticsPlugin(...)]` wired with `BigQueryLoggerConfig`
# (`BQ_ANALYTICS_GCS_BUCKET` and `BQ_ANALYTICS_CONNECTION_ID`) β NO `create_dataset` RPC!
# - Log a warning and return `[]` if optional packages or credentials are missing.
return []
# TODO 2: Define `root_agent = Agent(...)` with:
# - name="support_ops_agent" (must match create_params.root_agent_name in manifest)
# - model=MODEL ("gemini-3.8-flash")
# - before_agent_callback=initialize_support_state
# - instruction=STATIC_SLA_SOP (keep deterministicβno volatile timestamps!)
# - tools=[lookup_ticket, check_sla_policy, escalate_ticket]
# - generate_content_config=types.GenerateContentConfig(max_output_tokens=2048)
root_agent = None
# TODO 3: Define `app = App(...)` with:
# - name="app"
# - root_agent=root_agent
# - plugins=build_telemetry_plugins()
# - context_cache_config=ContextCacheConfig(min_tokens=4096, ttl_seconds=1800, cache_intervals=10)
# - events_compaction_config=EventsCompactionConfig(compaction_interval=8, overlap_size=2)
app = None
Step 2: Implement scripts/finops_telemetry_audit.pyβ
Before deploying support-ops-agent in CI/CD, your platform team runs an automated FinOps & Privacy pre-flight audit script. Create scripts/finops_telemetry_audit.py from the skeleton below using explicit if ...: raise RuntimeError(...) checks (never Python assert, which python -O strips in optimized container images!) and complete # TODO 1 through # TODO 3:
audit_app_finops_config(target_app)(# TODO 1):- Verify
target_app.name == "app",target_app.root_agent.name == "support_ops_agent", andtarget_app.root_agent.model == "gemini-3.8-flash". - Verify
target_app.root_agent.generate_content_configis set andmax_output_tokens == 2048(leaving Gemini 3.8 thinking-token headroom). - Verify
target_app.context_cache_confighasmin_tokens == 4096,ttl_seconds == 1800, andcache_intervals == 10. - Verify
target_app.events_compaction_confighascompaction_interval == 8andoverlap_size == 2.
- Verify
audit_privacy_env(project_name="support-ops-agent", env=None)(# TODO 2):- Overlay
{**DEFAULT_TERRAFORM_PRIVACY_ENV, **os.environ, **(env or {})}so live container environment leaks are caught automatically. - Raise
RuntimeErrorunlessOTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT == "NO_CONTENT"andADK_CAPTURE_MESSAGE_CONTENT_IN_SPANS.lower() == "false". - Compute and return the hyphen-normalized BigQuery telemetry dataset ID (
f"{project_name.replace('-', '_')}_telemetry"->"support_ops_agent_telemetry").
- Overlay
simulate_p1_incident_tokens(...)(# TODO 3):- Model a 24-turn P1 war-room incident (
turns=24,static_prefix_tokens=5000,tokens_per_turn=600,summary_tokens=400,min_tokens=4096,cache_intervals=10,compaction_interval=8,overlap_size=2,cached_token_weight=0.25):- Unoptimized baseline (for each turn
tfrom1toturnsinclusive): pays fullstatic_prefix_tokens + (t * tokens_per_turn)on every turn. - Optimized with
ContextCacheConfig+EventsCompactionConfig:- Static prefix: Cache populates/refreshes on Turn
1and whenever(turn - 1) % cache_intervals == 0(paying fullstatic_prefix_tokens); all other turns hit the prefix cache whenstatic_prefix_tokens >= min_tokensand payint(static_prefix_tokens * cached_token_weight). - History compaction state machine: start with
active_turns = 0andcompacted_summaries = 0. On each turnt(1..turns):- Increment
active_turns += 1. - Add
effective_static + compacted_summaries * summary_tokens + active_turns * tokens_per_turntooptimized_tokens. - If
t % compaction_interval == 0, account for the compactor summarization call overhead (optimized_tokens += (active_turns * tokens_per_turn) + summary_tokens), incrementcompacted_summaries += 1, and resetactive_turns = overlap_size.
- Increment
- Static prefix: Cache populates/refreshes on Turn
- Return
{"unoptimized_tokens": ..., "optimized_tokens": ..., "tokens_saved": ..., "savings_pct": ...}(rounded to 2 decimals).
- Unoptimized baseline (for each turn
- Model a 24-turn P1 war-room incident (
# support-ops-agent/scripts/finops_telemetry_audit.py (Starter Skeleton)
"""Pre-flight FinOps & Privacy-Preserving Telemetry Audit for support-ops-agent."""
import os
from pathlib import Path
from typing import Any, Optional
from app.agent import app
DEFAULT_TERRAFORM_PRIVACY_ENV = {
"OTEL_SEMCONV_STABILITY_OPT_IN": "gen_ai_latest_experimental",
"OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT": "NO_CONTENT",
"ADK_CAPTURE_MESSAGE_CONTENT_IN_SPANS": "false",
"OTEL_INSTRUMENTATION_GENAI_COMPLETION_HOOK": "upload",
"OTEL_INSTRUMENTATION_GENAI_UPLOAD_FORMAT": "jsonl",
}
def _require(condition: bool, message: str) -> None:
"""Fail-closed check immune to `python -O` assertion stripping."""
if not condition:
raise RuntimeError(message)
def audit_app_finops_config(target_app: Any) -> dict[str, Any]:
"""Verifies App, Agent, ContextCacheConfig, and EventsCompactionConfig invariants."""
# TODO 1: Validate all required ADK 2.0 FinOps invariants using `_require(...)`:
# - target_app.name == "app"
# - target_app.root_agent.name == "support_ops_agent"
# - target_app.root_agent.model == "gemini-3.8-flash"
# - target_app.root_agent.generate_content_config.max_output_tokens == 2048
# - target_app.context_cache_config: min_tokens == 4096, ttl_seconds == 1800, cache_intervals == 10
# - target_app.events_compaction_config: compaction_interval == 8, overlap_size == 2
# Return a summary dict of the verified settings.
raise NotImplementedError("TODO 1: Audit App FinOps configuration")
def audit_privacy_env(
project_name: str = "support-ops-agent",
env: Optional[dict[str, str]] = None,
) -> dict[str, str]:
"""Validates Tier 1 NO_CONTENT span isolation and Tier 2 BQ dataset naming."""
effective_env = {**DEFAULT_TERRAFORM_PRIVACY_ENV, **os.environ, **(env or {})}
# TODO 2: Validate privacy-preserving OpenTelemetry env posture using `_require(...)`:
# - effective_env["OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT"] == "NO_CONTENT"
# - effective_env["ADK_CAPTURE_MESSAGE_CONTENT_IN_SPANS"].lower() == "false"
# - Compute `telemetry_dataset = f"{project_name.replace('-', '_')}_telemetry"`
# and verify `"-" not in telemetry_dataset`.
# Return {"capture_mode": ..., "adk_span_content": ..., "telemetry_dataset": telemetry_dataset}.
raise NotImplementedError("TODO 2: Audit Tier 1/Tier 2 privacy posture")
def simulate_p1_incident_tokens(
turns: int = 24,
static_prefix_tokens: int = 5000,
tokens_per_turn: int = 600,
summary_tokens: int = 400,
min_tokens: int = 4096,
cache_intervals: int = 10,
compaction_interval: int = 8,
overlap_size: int = 2,
cached_token_weight: float = 0.25,
) -> dict[str, Any]:
"""Calculates cumulative billable-equivalent input tokens across a 24-turn P1 incident."""
# TODO 3: Compute `unoptimized_tokens` vs `optimized_tokens` across `1..turns`,
# modeling `cache_intervals` cache refreshes and compactor summarization call overhead
# (`(active_turns * tokens_per_turn) + summary_tokens`) on every `compaction_interval`.
raise NotImplementedError("TODO 3: Simulate 24-turn P1 incident FinOps savings")
def audit_sql_file(sql_path: Path) -> None:
"""Verifies Step 3's BigQuery SQL file uses hyphen-safe naming and partition pruning."""
if not sql_path.exists():
return
sql_text = sql_path.read_text(encoding="utf-8")
_require(
"support_ops_agent_telemetry." in sql_text,
"SQL must query hyphen-normalized dataset `support_ops_agent_telemetry`.",
)
_require(
"support-ops-agent_telemetry" not in sql_text,
"BigQuery dataset names cannot contain hyphens!",
)
_require(
"TIMESTAMP_SUB" in sql_text,
"SQL must include a `timestamp >= TIMESTAMP_SUB(...)` partition-pruning filter!",
)
if __name__ == "__main__":
finops_summary = audit_app_finops_config(app)
privacy_summary = audit_privacy_env()
sim = simulate_p1_incident_tokens(
min_tokens=app.context_cache_config.min_tokens,
cache_intervals=app.context_cache_config.cache_intervals,
compaction_interval=app.events_compaction_config.compaction_interval,
overlap_size=app.events_compaction_config.overlap_size,
)
audit_sql_file(Path("sql/daily_finops_summary.sql"))
print("β
App FinOps Config Verified:", finops_summary)
print("β
Tier-1/Tier-2 Privacy Verified:", privacy_summary)
print(
f"β
24-Turn P1 Incident Simulation: "
f"{sim['unoptimized_tokens']:,} -> {sim['optimized_tokens']:,} billable tokens "
f"(saved {sim['tokens_saved']:,} tokens / {sim['savings_pct']}%)"
)
Step 3: Write Partition-Pruned sql/daily_finops_summary.sqlβ
Keep three critical BigQuery FinOps engineering rules in mind:
- Hyphen-to-Underscore Dataset ID:
support-ops-agentmaps to datasetsupport_ops_agent_telemetry. - Zero-GCS-Scan Partition Pruning for Daily Token Rollups: While
completions_viewjoins GCS NDJSON files for full message-part inspection, pure token/truncation FinOps rollups should query the day-partitioned Cloud Logging sink tablegen_ai_client_inference_operation_detailsdirectly with aWHERE timestamp >= TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 30 DAY)partition filter so BigQuery scans zero GCS external objects! (For per-calllatency_mspercentiles, queryv_llm_responsecreated byBigQueryAgentAnalyticsPlugin.) - Deduplicating Spans & Midnight-Crossings: Deduplicate per
(trace, span_id)usingMAX(SAFE_CAST(... AS INT64))and assign eachtracetoMIN(DATE(timestamp))(session_date) so conversations crossing UTC midnight are never double-counted across two days.
Complete sql/daily_finops_summary.sql below:
-- support-ops-agent/sql/daily_finops_summary.sql (Starter Skeleton)
-- Zero-GCS-Scan Daily FinOps Rollup over Partitioned Cloud Logging Sink Table
-- (Note: For per-call LLM latency percentiles, query `v_llm_response` from BigQueryAgentAnalyticsPlugin;
-- for full prompt/tool NDJSON payload auditing, query `support_ops_agent_telemetry.completions_view`.)
WITH span_calls AS (
-- TODO 1: Query `my-gcp-project.support_ops_agent_telemetry.gen_ai_client_inference_operation_details`
-- with `WHERE timestamp >= TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 30 DAY) AND trace IS NOT NULL`.
-- Group by trace, span_id, and agent_name (`labels.gen_ai_agent_name`):
-- - MIN(timestamp) AS span_ts
-- - MAX(SAFE_CAST(labels.gen_ai_usage_input_tokens AS INT64)) AS prompt_tokens
-- - MAX(SAFE_CAST(labels.gen_ai_usage_output_tokens AS INT64)) AS completion_tokens
-- - LOGICAL_OR(TO_JSON_STRING(jsonPayload) LIKE '%MAX_TOKENS%') AS hit_max_tokens
SELECT
trace,
span_id,
labels.gen_ai_agent_name AS agent_name
-- Complete span-level aggregations here
FROM `my-gcp-project.support_ops_agent_telemetry.gen_ai_client_inference_operation_details`
WHERE timestamp >= TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 30 DAY)
AND trace IS NOT NULL
GROUP BY trace, span_id, agent_name
),
invocation_rollups AS (
-- TODO 2: Roll up spans to one row per (trace, agent_name), anchoring `report_date`
-- to `MIN(DATE(span_ts))` so midnight-spanning traces are counted once:
-- - MIN(DATE(span_ts)) AS report_date
-- - COUNT(DISTINCT span_id) AS llm_calls_in_trace
-- - SUM(IFNULL(prompt_tokens, 0)) AS invocation_prompt_tokens
-- - SUM(IFNULL(completion_tokens, 0)) AS invocation_completion_tokens
-- - LOGICAL_OR(hit_max_tokens) AS truncated_by_max_tokens
SELECT
trace,
agent_name
FROM span_calls
GROUP BY trace, agent_name
)
-- TODO 3: Produce the final daily FinOps summary grouped by report_date, agent_name:
-- - COUNT(DISTINCT trace) AS daily_invocations
-- - SUM(llm_calls_in_trace) AS total_llm_spans
-- - SUM(invocation_prompt_tokens) AS total_prompt_tokens
-- - SUM(invocation_completion_tokens) AS total_completion_tokens
-- - COUNTIF(truncated_by_max_tokens) AS max_token_truncations
SELECT
report_date,
agent_name
FROM invocation_rollups
GROUP BY report_date, agent_name
ORDER BY report_date DESC;
Step 4: Run and Verify Locallyβ
Run your FinOps & Privacy audit gate from inside support-ops-agent/:
PYTHONPATH=. uv run python scripts/finops_telemetry_audit.py
Verify that:
app.agentimports cleanly offline with zero startup RPCs and preserves canonicalTCK-1042/TCK-2088stateful tools.- All
ContextCacheConfig,EventsCompactionConfig, andmax_output_tokens=2048checks pass via_require(...). - The 24-turn P1 incident simulation (including
cache_intervals=10refreshes and compactor summarization call overhead) confirms deterministic savings from300,000down to152,850billable-equivalent input tokens (147,150tokens saved /49.05%net reduction). sql/daily_finops_summary.sqlpasses the hyphen-normalizedsupport_ops_agent_telemetryandTIMESTAMP_SUBpartition-pruning checks.
Self-Reflection Questionsβ
- Why do daily token/truncation FinOps rollups query day-partitioned
gen_ai_client_inference_operation_detailswith aTIMESTAMP_SUBfilter instead of running an unfiltered scan acrosscompletions_view? - Suppose an engineer adds
f"Current UTC time: {datetime.now().isoformat()}\n"to line 1 ofSTATIC_SLA_SOP. How does that affectContextCacheConfighit rates in production? - Why should
build_telemetry_plugins()avoid callingbigquery.Client().create_dataset()synchronously on every container cold start?
π Reference Solution Vaultβ
Official Solution Vault β Module 30.4
Locked Challenge β Active Pedagogical Socratic Gate