feat: add gcp managed prometheus query component#5233
Conversation
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>
|
👋 Commands for maintainers:
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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.
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>
|
❌ 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: Add approved exceptions in your repository's |
1756af4 to
5da896e
Compare
|
❌ 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: Add approved exceptions in your repository's |
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>
5da896e to
b636ceb
Compare
|
❌ 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: Add approved exceptions in your repository's |

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