Skip to content

feat: add gcp managed prometheus query component#5233

Merged
forestileao merged 4 commits into
superplanehq:mainfrom
WashingtonKK:feat/gcp-managed-prometheus
Jun 11, 2026
Merged

feat: add gcp managed prometheus query component#5233
forestileao merged 4 commits into
superplanehq:mainfrom
WashingtonKK:feat/gcp-managed-prometheus

Conversation

@WashingtonKK

@WashingtonKK WashingtonKK commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Closes: #5271

Summary

Adds one read-only components to the GCP integration for Google Cloud Managed Service for Prometheus (GMP).

action : gcp.prometheus.query -> Runs the query with a lookback period.

Demo

Add two read-only components to the GCP integration for Google Cloud
Managed Service for Prometheus (GMP):
- gcp.prometheus.query: instant PromQL query
- gcp.prometheus.queryRange: PromQL range query over a relative lookback
  window (1h-14d), matching the lookback convention used by the metrics
  components

Both call GMP's Prometheus-compatible frontend at
monitoring.googleapis.com/v1/projects/<project>/location/global/prometheus/api/v1/
using the integration's GCP credentials, and emit the normalized result
(resultType, result, seriesCount; plus the resolved window for the range
query). Read-only; requires roles/monitoring.viewer.

Includes the gcp/prometheus package (client, components, examples, backend
tests), gcp.go registration, frontend mappers with spec tests, and
regenerated docs.

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
The component-sidebar logo resolver keys off the second segment of a
component name and falls back to the plain GCP logo when it is unmapped, so
several GCP components rendered the generic logo instead of their product
icon (e.g. createImage/getVMInstance showed GCP, not Compute).

Map every Compute component (createImage/updateImage/deleteImage,
getVMInstance) to the official Compute Engine icon, and add the official
Google Cloud Monitoring product icon (gcp.monitoring.svg, from the official
Google Cloud product-icon set) for the alerting (monitoring) and Managed
Service for Prometheus components.

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
@superplanehq-integration

Copy link
Copy Markdown

👋 Commands for maintainers:

  • /sp start - Start an ephemeral machine (takes ~30s)
  • /sp stop - Stop a running machine (auto-executed on pr close)

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 97acec0. Configure here.

Comment thread pkg/integrations/gcp/prometheus/common.go
runQuery counted any top-level result array as series, but a scalar (or
string) result is a single [timestamp, value] pair, so seriesCount was
reported as 2. Only treat vector/matrix results as lists of series; a
scalar/string result counts as one value.

Addresses a Cursor Bugbot review comment.

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
@superplane-gh-integration-9000

Copy link
Copy Markdown

OSS Guard found dependency licenses that are not permitted for this project.

Project license (from repository): Apache-2.0

Permitted dependency licenses: MIT,Apache-2.0,BSD-2-Clause,BSD-3-Clause,ISC,0BSD,Unlicense,CC0-1.0,CC-BY-4.0,Zlib,MPL-2.0,OpenSSL,BlueOak-1.0.0

Reason: One or more dependencies use licenses that are not compatible with the project license.

osv-scanner report:

argparse 2.0.1 (npm) - Python-2.0
csv 3.3.5 (RubyGems) - Ruby, BSD-2-Clause
elkjs 0.10.0 (npm) - EPL-2.0
khroma 2.1.0 (npm) - UNKNOWN
posthog-js 1.368.2 (npm) - non-standard
stdlib 1.26.2 (Go) - UNKNOWN

Add approved exceptions in your repository's osv-scanner.toml.

@WashingtonKK WashingtonKK changed the title feat: add gcp managed prometheus query components feat: add gcp managed prometheus query component Jun 10, 2026
@WashingtonKK WashingtonKK force-pushed the feat/gcp-managed-prometheus branch from 1756af4 to 5da896e Compare June 10, 2026 15:37
@superplane-gh-integration-9000

Copy link
Copy Markdown

OSS Guard found dependency licenses that are not permitted for this project.

Project license (from repository): Apache-2.0

Permitted dependency licenses: MIT,Apache-2.0,BSD-2-Clause,BSD-3-Clause,ISC,0BSD,Unlicense,CC0-1.0,CC-BY-4.0,Zlib,MPL-2.0,OpenSSL,BlueOak-1.0.0

Reason: One or more dependencies use licenses that are not compatible with the project license.

osv-scanner report:

@csstools/color-helpers 5.1.0 (npm) - MIT-0
argparse 2.0.1 (npm) - Python-2.0
csv 3.3.5 (RubyGems) - Ruby, BSD-2-Clause
elkjs 0.10.0 (npm) - EPL-2.0
khroma 2.1.0 (npm) - UNKNOWN
posthog-js 1.368.2 (npm) - non-standard
stdlib 1.26.2 (Go) - UNKNOWN

Add approved exceptions in your repository's osv-scanner.toml.

Keep the managed prometheus Query and Query Range as two separate
components (dropping the earlier consolidation into one). Query Range now
takes explicit start, end, and step fields, matching the self-hosted
prometheus Query Range component, instead of a relative lookback period:

- start/end accept RFC3339 or Unix timestamps; step is a duration (e.g. 60s).
- they are passed straight through to the GMP query_range frontend, and
  echoed in the emitted payload alongside resultType/result/seriesCount.

Updates the component config, validation, tests, the node mapper (shows the
step), the example output, and regenerated docs.

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
@WashingtonKK WashingtonKK force-pushed the feat/gcp-managed-prometheus branch from 5da896e to b636ceb Compare June 10, 2026 15:53
@superplane-gh-integration-9000

Copy link
Copy Markdown

OSS Guard found dependency licenses that are not permitted for this project.

Project license (from repository): Apache-2.0

Permitted dependency licenses: MIT,Apache-2.0,BSD-2-Clause,BSD-3-Clause,ISC,0BSD,Unlicense,CC0-1.0,CC-BY-4.0,Zlib,MPL-2.0,OpenSSL,BlueOak-1.0.0

Reason: One or more dependencies use licenses that are not compatible with the project license.

osv-scanner report:

@csstools/color-helpers 5.1.0 (npm) - MIT-0
argparse 2.0.1 (npm) - Python-2.0
csv 3.3.5 (RubyGems) - Ruby, BSD-2-Clause
elkjs 0.10.0 (npm) - EPL-2.0
khroma 2.1.0 (npm) - UNKNOWN
posthog-js 1.368.2 (npm) - non-standard
stdlib 1.26.2 (Go) - UNKNOWN

Add approved exceptions in your repository's osv-scanner.toml.

Comment thread web_src/src/assets/icons/integrations/gcp.monitoring.svg
@forestileao forestileao merged commit 348c202 into superplanehq:main Jun 11, 2026
6 of 7 checks passed
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.

[GCP] Add GCP managed prometheus components

2 participants