Repository navigation
feat(gcp): Google Cloud dashboard template and docs page - #1335
Conversation
…feat/gcp-dashboard-template
…ervices up, tighten docs claims
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 Walkthrough
Merge Risk: 🟡 Moderate · up to
|
Maple review🟢 Confidence 10/10 · safe to merge Adds the prebuilt Google Cloud dashboard template and its docs page, with a test that checks every chart against what the Cloud Monitoring poller stores. No backend behaviour change; safe to merge.
What was checked
|
Maple review🟢 Confidence 10/10 · safe to merge The only change since the last review is copy in the Google Cloud docs page (Google price figures dropped from the costs section). The page's factual claims still line up with the code, so it is safe to merge. What was checked
|
…exts, where the secret shows From an end-to-end run against a real project: metrics need billing on the host project, a project's first sink can drop entries for about ten minutes, the push endpoint is readable in the subscription and the audit log, and the dashboard template's project field sits under Parameters.
Maple review🟢 Confidence 8/10 · likely safe to merge Adds the
What was checked
|
Maple review🟢 Confidence 9/10 · safe to merge Adds the
What was checked
|
Maple review🟢 Confidence 8/10 · likely safe to merge Adds a Google Cloud dashboard template (24 metric widgets over the Cloud Monitoring poller's curated metrics), registers it, and links the new
What was checked
|
Maple review🟢 Confidence 9/10 · safe to merge Adds the
What was checked
|
Maple review🟢 Confidence 9/10 · safe to merge Adds the
What was checked
|
Maple review🟢 Confidence 9/10 · safe to merge Adds the prebuilt "Google Cloud" dashboard template, its
What was checked
|
Maple review🟢 Confidence 10/10 · safe to merge Adds the Google Cloud dashboard template, its docs page and the catalog/card links to it. The two links added to the integration card point at anchors that exist in the new docs page; safe to merge.
What was checked
|
Maple review🟢 Confidence 8/10 · likely safe to merge Adds the
What was checked
|
Maple review🟢 Confidence 9/10 · safe to merge Adds the "Google Cloud" dashboard template (24 charts over the GCP metrics the poller stores), registers it, and links the new /docs/integrations/gcp page from the catalogue, the template picker and the integration card. Safe to merge.
What was checked
|
…b's fixture widgets
Maple review🟢 Confidence 8/10 · likely safe to merge The head reworks only two reviewed surfaces:
Still open from earlier reviews
What was checked
Observability coverage: 1 of 1 changes observable
|
Maple review🟢 Confidence 9/10 · safe to merge The change since the last review only clears stale merge-conflict markers out of the web bundle-budget script and reflows its comment; the 699.5 KB budget constant is unchanged. Safe to merge, with the earlier information-level finding — the
Still open from earlier reviews
What was checked
|
Maple review🟢 Confidence 7/10 · likely safe to merge Adds the Google Cloud dashboard template, its docs pages, the Google Cloud service-map platform and metric-backed dashboard variables. Nothing new to fix in the hunks this pull request authors, but F1 — the untested Still open from earlier reviews
What was checked
|
Maple review🟢 Confidence 7/10 · likely safe to merge Adds the Google Cloud dashboard template (38 charts, seven service tabs), a metric-scoped dashboard variable source,
Still open from earlier reviews
What was checked
Observability coverage: 1 of 1 changes observable
Files not reviewed (1)The review ended before it read these diffs, so nothing above vouches for them.
|
Maple review🟡 Confidence 6/10 · needs attention Adds the Google Cloud dashboard template (38 charts, project/region/workload filters), a metrics-only source for query variables, the Google Cloud mark in the picker and service map, and the GCP docs. Safe to merge once the new
Findings🟠 Warning · F2 ·
|
| : mapleSdkType === "client" | ||
| ? "web" | ||
| : "unknown" | ||
| : cloudProvider === "gcp" |
There was a problem hiding this comment.
Warning
cloudProvider === "gcp" is checked before the Kubernetes rule, so GKE workloads report gcp
F2 · Warning · correctness
Google Cloud's resource detector sets cloud.provider = gcp on GKE as well as on Cloud Run (cloud.platform = gcp_kubernetes_engine), and the comment only justifies beating the Lambda rule. Every GKE service that reported kubernetes now reports gcp, while an EKS service still reports kubernetes — the map's Kubernetes badge and colour disappear for GCP clusters. Gate the new branch on the FaaS signal the comment describes (faasName !== "" or cloudPlatform === "gcp_cloud_run" | "gcp_cloud_functions"), or move it below isKubernetes; apps/local-ui/src/hooks/use-local-service-map.ts:112 repeats the same order and must change with it.
Reorder so `isKubernetes` is tested before the `cloudProvider === "gcp"` branch, or narrow the branch to the Cloud Run/Cloud Functions platform values, and apply the same order in `classifyPlatform` in `apps/local-ui/src/hooks/use-local-service-map.ts`.
🤖 Prompt to fix with an AI agent
In `apps/api/src/routes/internal/query-engine.http.ts:261-262`: `cloudProvider === "gcp"` is checked before the Kubernetes rule, so GKE workloads report `gcp`.
Google Cloud's resource detector sets `cloud.provider = gcp` on GKE as well as on Cloud Run (`cloud.platform = gcp_kubernetes_engine`), and the comment only justifies beating the Lambda rule. Every GKE service that reported `kubernetes` now reports `gcp`, while an EKS service still reports `kubernetes` — the map's Kubernetes badge and colour disappear for GCP clusters. Gate the new branch on the FaaS signal the comment describes (`faasName !== ""` or `cloudPlatform === "gcp_cloud_run" | "gcp_cloud_functions"`), or move it below `isKubernetes`; `apps/local-ui/src/hooks/use-local-service-map.ts:112` repeats the same order and must change with it.
Suggested fix: Reorder so `isKubernetes` is tested before the `cloudProvider === "gcp"` branch, or narrow the branch to the Cloud Run/Cloud Functions platform values, and apply the same order in `classifyPlatform` in `apps/local-ui/src/hooks/use-local-service-map.ts`.
Verify the problem exists at that location before changing it, and keep the fix to those lines.
There was a problem hiding this comment.
Not changing: classifying GKE as gcp is intentional and pinned by use-local-service-map.test.ts; the service map's Infrastructure tab still lists the Kubernetes workloads.
🤖 Addressed by Claude Code
There was a problem hiding this comment.
won't fix — classifying GKE as gcp is intentional and pinned by use-local-service-map.test.ts.
🤖 Addressed by Claude Code
Maple review🔴 Confidence 4/10 · risky as written Adds a 38-chart Google Cloud dashboard template with project/region/workload variables, a metrics-only query-variable source, the GCP platform in the service map, and the integration docs. Safe to merge once the dialog stops allowing more metric names than the variable schema and the query accept.
Before merge
Findings🟠 Warning · F3 · Dialog accepts more than 20 metric names, which every reader of the field caps at 20correctness ·
🤖 Prompt to fix this finding with an AI agentStill open from earlier reviews
What was checked
Observability coverage: 1 of 1 changes observable
|
Maple review🟢 Confidence 7/10 · likely safe to merge The delta since the last review is the metric-variable name cap in the variables dialog, which now matches the schema's 20-name limit and blocks Save. Nothing new is wrong in it; the Google Cloud template and docs were reviewed earlier.
Still open from earlier reviews
Fixed since the last review
What was checked
|
Maple review🟢 Confidence 7/10 · likely safe to merge Since the last review this PR only adds a test for the metric-variable option query, which closes the "metric branch is untested" finding. The open warning about GKE services classifying as
Still open from earlier reviews
Fixed since the last review
What was checked
|
…rom it Instantiating a template (v2 API and the MCP create_dashboard tool) copied only the name, tags, time range and widgets of the built document, so the Google Cloud template came out as one flat page with no filters and widgets still referencing $project. Both paths now keep the whole build. The picker's live preview starts each variable on its default, else All, so a filtered widget no longer queries a literal $project and draws nothing.
Maple review🟢 Confidence 9/10 · safe to merge Fixes template instantiation so a template's sections and variables reach the created dashboard (HTTP route and MCP tool), and seeds the picker preview with each variable's default or All. Contained, correct and safe to merge.
What was checked
|
Maple review🟢 Confidence 8/10 · likely safe to merge Adds the Google Cloud dashboard template, a metric-sourced dashboard variable, the GCP docs pages and the service-map GCP platform, plus a lab page. Contained and safe to merge; it does not touch the open
Production impactOpen errors in the changed files
After this merges, Maple checks whether they stop. What was checked
Observability coverage: 1 of 1 changes observable
|
Maple: after this shipped✅ Shipped clean. Nothing this change touches got worse in the hour after it deployed. Deployed to Errors in the changed files:
Maple looks once, an hour after the first deploy that carries the merge. |
Stacked on the Google Cloud integration card PR. Merge order: bottom up.
What
PR E of the Google Cloud integration: the prebuilt dashboard template and the customer docs pages. No backend behaviour change, no database change.
packages/backend/src/dashboard-templates/infrastructure/gcp.ts: templategcp("Google Cloud"), registered indashboard-templates/index.ts.packages/backend/src/dashboard-templates/infrastructure/gcp.test.ts: guard that the template charts only what the poller stores.apps/landing/src/content/docs/integrations/gcp.md: the docs page (/docs/integrations/gcp).apps/landing/src/content/docs/integrations/gcp-opentelemetry.md: "Google Cloud with OpenTelemetry" (/docs/integrations/gcp-opentelemetry), listed after Google Cloud under Integrations.apps/web/src/lib/docs.ts,integration-catalog.tsxandgcp-integration-card.tsx: the catalog entry and the configuration dialog'sRoles if you aren't an Owner,TroubleshootingandWrite a filter of your ownlinks point at the Google Cloud page. The log filter acknowledgement and the filter's lines link to the new page (docs.test.tsresolves both against the landing content).template-icons.ts: the Google Cloud mark in the template picker.getting-started/introduction.mdanddashboards/build-dashboards.md: one mention each, where the other integrations and templates are listed.Dashboard template
38 charts in one
Servicessection, one tab per service, two charts per row within a tab. Filters in the toolbar: Project (cloud.account.id), Region (cloud.region), Workload (service.name), each with All. The optionalproject_idparameter sets the Project filter's starting value.Each widget takes its metric type, aggregation, chart preset and display unit from
GCP_METRIC_GROUPS: asummetric is charted as a delta sum, everything else as an averaged gauge, and the unit mapss,Byand1toduration_s,bytesandpercent.A chart filters on a variable only where its series carry the attribute. Region skips Pub/Sub and load balancers (global resources). Workload applies only to charts grouped by workload. A variable on All drops its clause.
The test runs one series per curated metric through
mapGcpTimeSeriesand fails when a widget names a metric that is not in the table, a metric type that differs from the rows the mapping produces, anattr.*orresource.*key that is not on those rows, a quantile value the mapping does not emit, a distribution charted without a quantile filter,sumon a gauge, or an attribute group-by on a metric whoseservice.namevaries. A second test fails when a filter lists values from a metric that is not a stored gauge carrying its attribute, or a widget filters on a variable its own series don't carry.Metric query variables
Query variables could only list values from traces and logs. A metrics-only integration never writes those.
{ kind: "metric", metricType, metricNames, scope: "metric" | "resource", attributeKey }: a data-point or resource attribute's values on the named metrics.attributeValuestakesmetricNames. Metric-scoped discovery readsResourceAttributesfor theresourcescope. It reads the raw metric table, like the query-builder autocomplete.options.ts, used by the board and the share path), the web provider,getMetricAttributeValues, the variables dialog ("Metric attribute…" / "Metric resource attribute…") and the v2 API schema.layout.yis relative to its tab. The layout test checks rows per tab./lab/gcp-dashboard: the built template on the read-only canvas, with fixture series that follow the filters, and the variables dialog.gcp-dashboard-fixture.jsonisgcpTemplate.build({})(web can't import@maple/backend); the regenerate command is in the lab file.Docs page outline
Intro (what a connection collects), Prerequisites (roles per scope, where to find the IDs), Connect (the steps of the Connect dialog and its apply stage, the terminal output of a first run, how long first data takes, what the wrapper lines of the pasted text do, the secret), Change what a connection collects (Configure, a table of when each change takes effect in Maple and in Google Cloud, the confirmation, the band that waits for the script), Log filter (the recommended filter, including GKE container logs after a confirmation, keeping a sink's filter, and a custom filter), Verify (the numbers at the top of the page, one table of statuses per capability, the bands and their buttons, the connection labels), Permissions (every API and role the script uses, and the predefined roles that cover the script without Owner), Collected data (logs: the recommended filter as a table of what it excludes and why, GKE container logs among them, with the filter text below it, the reserved
maple-setuplog,service.namerule, attributes, severity; metrics: all 46 names per service, value conventions, attributes; resources), Google Cloud costs, Limits, Troubleshooting (In Cloud Shell, Log forwarding, Metrics and resources, each keyed on the sentence the script or the card shows; Domain restricted sharing, the anchor the script links to), Disconnect (cleanup first), Next steps.Google Cloud with OpenTelemetry
For customers whose workloads also send telemetry over OTLP. The Google Cloud page points to it near its top.
LOG_FILTERby hand, and the clause that also leaves out Cloud Run container output.The Cloud Run section comes from a Node.js service that was instrumented and measured against a connected Google Cloud project: the server span of every measured request had the trace ID of Google's request log for it. The general Node.js guide is not changed here.
The terminal transcript in Connect is the output of the script as this stack renders it, run against a stubbed
gcloud. Status labels and failure sentences are quoted from the card and the services.The Infrastructure page is not described; its PR adds that section.
After the final live run the page was corrected against what the stack ships: the script's four closing lines, a wrong ID fixed by removing the connection and connecting the right one, the 10-minute rule for reads that fail, both sign-in messages, messages by scope,
Setup running, where to read a kept log filter, and one to two minutes for a run that removes the sink.The reworked integration page
The page no longer has switches or a
Show setup scriptbutton (see the integration card PR below). Both docs pages follow it:Connect Google CloudorAdd connectionopens the dialog;Create and continueleads intoApply in Google Cloudwith its three steps.Configure, thenSave and continue. A table says when each change takes effect: off acts in Maple at once and in Google Cloud when the script runs; on starts once the script has run; back on resumes at once when the resources still exist.Continue to the scriptis how the script is reached again.Not set upfor a capability,Setup pendingfor a connection); a table lists the three bands and their buttons.Decisions
service.name. A chart grouped by an attribute keeps one service's value per group in the query engine, so attribute group-bys are used only whereservice.nameis the constantgcp/<resource type>(Cloud SQL, Pub/Sub, load balancers, GKE nodes). Cloud Run errors are therefore "5xx responses by service" with a class filter, and Cloud Functions executions are by function, not by status. This can be relaxed once the query engine adds services up under an attribute group-by (tracked as a separate follow-up).avg:sumon a per-minute gauge adds up every minute of a bucket. A workload running in several regions or projects under one name reads as the average of them.0.95) and group by workload.state=active(Cloud Run instance count),memory_type=non-evictable(GKE),response_code_class=5xx(Cloud Run SLI examples use1xx,2xx,4xx).default.log_id("run.googleapis.com/stdout")andlog_id("run.googleapis.com/stderr"), the log IDs Google's documentation lists for Cloud Run next torun.googleapis.com/requests. It was not run against a sink.Google Cloud + OpenTelemetry: the full title is cut off in the sidebar.Not verified
#google-cloud-costs,#troubleshooting,#domain-restricted-sharing, and#gke-container-logson the new page). Both pages were rendered again for the log filter round. The template picker was rendered with the new mark.us-central1/europe-west1and the Cloud Run, GKE and VM workloads. The lab was checked with Playwright: tabs, Region narrowing GKE but not Pub/Sub, the dialog's metric source.Review notes
stored?.kindingcp.ts: a misspelled metric name still builds, so the test reports it by name instead of aTypeErrorfrombuild.Integrations → Google Cloudkeeps the arrow the other integration pages use for menu paths.Summary by CodeRabbit
Service map: Google Cloud as a platform
The
gcpDetectorsetup ingcp-opentelemetry.mdsetsfaas.nameon Cloud Run and Cloud Functions, so the service map drew those services as AWS Lambda (and GKE as plain Kubernetes).cloud.provider = gcpclassifies as a newgcpplatform, checked before the Lambda and Kubernetes rules (query-engine.http.tsand the local-ui copy).capitalize).GoogleCloudIconmoved fromapps/webinto@maple/uiicons, re-exported from@/components/icons./lab/bench/service-map(colour by Platform).