Skip to content

Docs: Google Cloud Monitoring metrics installation - #20032

Merged
DanielVisca merged 3 commits into
masterfrom
posthog/metrics-gcp-docs
Sep 17, 2026
Merged

DanielVisca merged 3 commits into
masterfrom
posthog/metrics-gcp-docs

Conversation

@DanielVisca

Copy link
Copy Markdown
Contributor

Changes

Adds a Google Cloud page under Metrics → Install metrics, covering the Cloud Monitoring pull source added to the metrics agent in PostHog/posthog#97528.

  • New page contents/docs/metrics/installation/google-cloud.mdx in the standard Steps format: prerequisites (GCP service account with roles/monitoring.viewer), picking metric types vs descriptor filters, Docker and GKE Workload Identity setups, verification, configuration reference, and notes/limits (no sharding, API quota, data freshness, alpha upstream receiver).
  • Links the page from the metrics installation overview and the docs nav.

Why: users on GCP currently have no documented path for managed-service metrics (Cloud SQL, GKE, load balancers) into PostHog Metrics. This documents the agent-based path.

Marked draft because the agent feature PR is still open – merge order: PostHog/posthog#97528 first (chart 0.3.0 published), then this.

Note: the new page's docker run example requires the agent image published from the feature PR (chart/appVersion 0.3.0).

Checklist

  • I've read the docs and/or content style guides.
  • Words are spelled using American English
  • Use relative URLs for internal links
  • I've checked the pages added or changed in the Vercel preview build
  • If I moved a page, I added a redirect in vercel.json

Created with PostHog Desktop

New installation page for pulling Google Cloud Monitoring metrics with the PostHog metrics agent (PostHog/posthog#97528): prerequisites and IAM, metric types vs descriptor filters, Docker and GKE Workload Identity setups, verification, config reference, and notes on sharding/quota/freshness/alpha. Also adds the page to the metrics install nav and the installation overview table.

Generated-By: PostHog Desktop
Task-Id: 025ef99f-893f-4131-b6f3-56c0c30a9c05
@DanielVisca DanielVisca self-assigned this Sep 9, 2026
@github-actions github-actions Bot added the docs Improvements or additions to product documentation, "Docs" label Sep 9, 2026
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Deploy preview

Status Details Updated (UTC)
🟢 Ready View preview Sep 17, 2026 05:41PM

Changed pages

Page Source
Install metrics contents/docs/metrics/installation/index.mdx
Google Cloud Monitoring metrics installation contents/docs/metrics/installation/google-cloud.mdx

@DanielVisca
DanielVisca marked this pull request as ready for review September 9, 2026 14:21
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Vale prose linter → found 0 errors, 7 warnings, 0 suggestions in your markdown

Full report → Copy the linter results into an LLM to batch-fix issues.

Linter being weird? Update the rules!

contents/docs/metrics/installation/google-cloud.mdx — 0 errors, 3 warnings, 0 suggestions
Line Severity Message Rule
3:15 warning 'googleCloud' is a possible misspelling. PostHogBase.Spelling
62:79 warning 'uid' is a possible misspelling. PostHogBase.Spelling
62:149 warning 'uid' is a possible misspelling. PostHogBase.Spelling
contents/docs/metrics/installation/index.mdx — 0 errors, 4 warnings, 0 suggestions
Line Severity Message Rule
11:76 warning Capitalize 'Endpoints' for PostHog's product. Use 'endpoints' for the general industry concept. PostHogBase.ProductNames
19:89 warning Use 'PostHog' instead of 'posthog'. Vale.Terms
20:89 warning Use 'PostHog' instead of 'posthog'. Vale.Terms
21:89 warning Use 'PostHog' instead of 'posthog'. Vale.Terms

Replaces the bare en dash in a numeric range (1–3 minutes) with words per the PostHog docs style: en dashes take spaces.

Generated-By: PostHog Desktop
Task-Id: 025ef99f-893f-4131-b6f3-56c0c30a9c05
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Bundle report

Total JS (gzip)

8.66 MiB (+0.0 KiB / +0.0%)

Eager graph (modules shipped in each entrypoint's initial chunks)

Entrypoint Eager size Budget Modules
app 18.57 MiB (+0.1 KiB / +0.0%) report-only 2067
Largest modules in the app closure
Module Size
./src/data/mcp-tools.json 1156.0 KiB
css ./node_modules/.pnpm/css-loader@5.2.7_webpack@5.101.3/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[8].oneOf[1].use[1]!./node_modules/.pnpm/postcss-loader@4.3.0_postcss@8.5.6_webpack@5.101.3/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[8].oneOf[1].use[2]!./src/styles/global.css 773.1 KiB
./src/components/Stickers/Stickers.tsx 696.4 KiB
./node_modules/.pnpm/@radix-ui+react-icons@1.3.2_react@18.3.1/node_modules/@radix-ui/react-icons/dist/react-icons.esm.js 481.4 KiB
./node_modules/.pnpm/@posthog+brand@0.8.0_react@18.3.1/node_modules/@posthog/brand/dist/generated/hoggies/svg/x-ray.mjs 480.8 KiB
./node_modules/.pnpm/rehype-raw@7.0.0/node_modules/rehype-raw/lib/index.js + 29 modules 395.1 KiB
./node_modules/.pnpm/@posthog+brand@0.8.0_react@18.3.1/node_modules/@posthog/brand/dist/generated/hoggies/svg/im-the-driver.mjs 385.7 KiB
./src/hooks/useCustomers.tsx + 55 modules 372.5 KiB
./node_modules/.pnpm/@posthog+icons@0.36.6_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@posthog/icons/dist/posthog-icons.es.js 354.8 KiB
./node_modules/.pnpm/react-markdown@8.0.7_@types+react@16.14.66_react@18.3.1/node_modules/react-markdown/lib/react-markdown.js + 88 modules 351.4 KiB
./src/components/ProductComparisonTable/index.tsx + 126 modules 305.8 KiB
./node_modules/.pnpm/cloudinary-core@2.14.0_lodash@4.17.21/node_modules/cloudinary-core/cloudinary-core.js 281.9 KiB
./node_modules/.pnpm/@posthog+brand@0.8.0_react@18.3.1/node_modules/@posthog/brand/dist/generated/hoggies/svg/doll-house.mjs 281.7 KiB
./node_modules/.pnpm/@posthog+brand@0.8.0_react@18.3.1/node_modules/@posthog/brand/dist/generated/hoggies/svg/director.mjs 275.6 KiB
./src/components/SearchUI/index.tsx + 87 modules 273.7 KiB

Eager-graph budgets are report-only until a baseline is established. Sizes are gzip of public/**/*.js; eager size is webpack module source bytes for the modules actually shipped in the entrypoint's initial chunks (post-tree-shake).

The agent runs as uid 10001, so the safest key handoff is a dedicated copy owned by that uid with mode 0600 (the approach the agent README recommends), mounted into the container. `chmod 644` on the original service-account key would make the private key readable by every local user.

Validated end-to-end against the real agent image: 0600 uid-owned and 644 root-owned both start and deliver metrics; 0600 root-owned is rejected by the agent's own entrypoint check.

Generated-By: PostHog Desktop
Task-Id: 6fb9271a-f921-4eac-a852-21d8691518c4

Copy link
Copy Markdown
Contributor Author

Validated this page end-to-end against the real agent image before landing the key-permission fix.

Setup: fake Cloud Monitoring (gRPC MetricService + OAuth token endpoint, TLS with a test CA, serving a canned compute.googleapis.com/instance/cpu/utilization series) + the repo's own OTLP sink standing in for PostHog ingest. The agent image was run exactly as the page instructs.

Observed:

  • Everything is ready. Begin running and processing data. (the line the page tells users to look for) appears.
  • Monitoring client successfully created. / Successfully retrieved all metric descriptors. appear.
  • The sink receives the metric with service.name = google-cloud-monitoring, resource gce_instance, value 0.42 — so the pull pipeline and the service-name default are correct.
  • GCP_METRIC_FILTERS='metric.type = starts_with("compute.googleapis.com/")' resolves and delivers the same series (semicolon-separation claim confirmed).
  • GCP_SERVICE_NAME=gcp-production lands as service.name = gcp-production on the delivered metric.
  • Key permissions: a 0600 file owned by uid 10001 works; the page's old chmod 644 on a root-owned file also works but leaks the private key to every local user; a 0600 root-owned file is rejected by the agent's own entrypoint check (GOOGLE_APPLICATION_CREDENTIALS ... not readable by uid 10001). The page now tells users to install -m 0600 -o 10001 sa.json /run/posthog-gcp/sa.json and mount that, matching the agent README.
  • Helm: helm template with the page's values.yaml produces the service-account annotation and the correct rendered googlecloudmonitoring receiver config; the gcp.credentialsSecret path mounts the secret and sets GOOGLE_APPLICATION_CREDENTIALS as the page says.

Everything else on the page (env-var names, defaults, sharding refusal, combined scrape+pull) was checked against products/metrics/agent/ in PostHog/posthog and matches.

@DanielVisca
DanielVisca enabled auto-merge (squash) September 17, 2026 17:37
@DanielVisca
DanielVisca merged commit 637303f into master Sep 17, 2026
20 of 21 checks passed
@DanielVisca
DanielVisca deleted the posthog/metrics-gcp-docs branch September 17, 2026 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to product documentation, "Docs"

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant