Skip to content

feat: add observability-metrics-gcp-cloudmonitoring module#277

Draft
JanakaSandaruwan wants to merge 5 commits into
openchoreo:mainfrom
JanakaSandaruwan:feat/metrics-gcp-cloudmonitoring
Draft

feat: add observability-metrics-gcp-cloudmonitoring module#277
JanakaSandaruwan wants to merge 5 commits into
openchoreo:mainfrom
JanakaSandaruwan:feat/metrics-gcp-cloudmonitoring

Conversation

@JanakaSandaruwan

Copy link
Copy Markdown
Contributor

Purpose

Adds a new OpenChoreo observability metrics adapter backed by GCP Cloud
Monitoring
. It serves per-component CPU/memory time series from the GKE
system metrics Google's built-in agent publishes for every GKE cluster, and
manages alert rules as Cloud Monitoring alert policies — no data-plane
collector required.

Approach

  • Resource metrics query (POST /api/v1/metrics/query): six parallel
    ListTimeSeries calls against k8s_container, scoped by the OpenChoreo
    component/project/environment-uid metadata labels (UID-only, matching the
    Prometheus and Azure Monitor siblings). HTTP RED metrics return an empty
    series; runtime topology returns 501.
  • Alert rule management (POST/GET/PUT/DELETE /api/v1alpha1/alerts/rules):
    maps each rule to a Cloud Monitoring AlertPolicy as a usage÷limit ratio
    MetricThreshold (threshold is a percentage of the pod's limit), using GCP's
    native denominator filter. Dedup/lookup via policy user_labels. All six
    operators supported natively.
  • Webhook forwarding (POST /api/v1alpha1/alerts/webhook): parses the
    Cloud Monitoring incident payload and forwards firing alerts to the
    Observer's internal endpoint. The public webhook path is guarded by a
    shared-secret check (Basic-auth password / header / query token).
  • Helm chart (helm/): Deployment + Service + ServiceAccount + ConfigMap,
    plus optional webhook Secret, Gateway HTTPRoute, and NetworkPolicy. Alerting
    is enabled only when a notification channel is configured; metrics-only
    installs need just roles/monitoring.viewer.
  • README aligned with the sibling observability modules (Architecture,
    Prerequisites, IAM roles, Helm install, alerting, troubleshooting,
    configuration reference).
  • Authentication via Application Default Credentials / GKE Workload Identity.
    Boot-time fail-fast ping of Cloud Monitoring (and notification-channel verify
    when alerting is on).

Related Issues

N/A

Checklist

  • Tests added or updated (unit, integration, etc.)
  • Samples updated (if applicable)

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b583c52c-c6da-4c81-ac49-5443e8ddcbd4

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Signed-off-by: Janaka Sandaruwan <janakasandaruwan1996@gmail.com>
Signed-off-by: Janaka Sandaruwan <janakasandaruwan1996@gmail.com>
Signed-off-by: Janaka Sandaruwan <janakasandaruwan1996@gmail.com>
Signed-off-by: Janaka Sandaruwan <janakasandaruwan1996@gmail.com>
@JanakaSandaruwan JanakaSandaruwan force-pushed the feat/metrics-gcp-cloudmonitoring branch from 5435bbf to 0bc16ab Compare July 10, 2026 11:30
Signed-off-by: Janaka Sandaruwan <janakasandaruwan1996@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants