googleapis / googleapis/gcloud-mcp

feat(observability-mcp): support PromQL queries for Prometheus

Open
#350 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
909
Forks
82
PR merge metrics
No merged PRs in 30d

Description

What is the feature or problem you’d like to solve?

I would like to propose adding a new tool (e.g., query_prometheus or query_promql) to the observability-mcp package. This tool would allow the MCP server to execute PromQL queries directly against the Google Cloud Managed Service for Prometheus.

Currently, the server supports standard Cloud Monitoring API interactions (like listTimeSeries), but does not expose an interface for PromQL, which requires targeting the specific Prometheus compatibility endpoint (e.g., https://monitoring.googleapis.com/v1/projects/${PROJECT_ID}/location/global/prometheus/api/v1/query).

Why do you need this feature?

PromQL (Prometheus Query Language) is the de-facto industry standard for cloud-native observability. Adding support for it provides high value for several reasons:

  1. LLM Proficiency: LLMs are generally better at writing PromQL than Google's custom MQL (Monitoring Query Language) due to the vast amount of open-source training data. This reduces syntax errors and "hallucinations" when the agent tries to fetch metrics.
  2. Unified Querying: Users can use a single language to query both Google Cloud system metrics (e.g., Compute Engine) and custom application metrics (e.g., from GKE sidecars).
  3. User Familiarity: SREs and DevOps engineers often already have a library of PromQL queries mentally available, making natural language requests more precise (e.g., "Run this PromQL query...").
Example prompts, workflows, or additional information

Example Prompts:

  1. "What is the 99th percentile latency for the 'frontend' service over the last hour?"
  2. "Show me the rate of 5xx errors for my GKE cluster broken down by namespace."
  3. "Are there any pods in the 'production' namespace that have restarted more than 3 times in the last 24 hours?"
  4. "Compare the CPU usage of my redis instances using the standard compute_googleapis_com:instance_cpu_utilization metric."

Implementation Details:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing observability-mcp package and its Cloud Monitoring API interactions. Determine how a new PromQL tool would call the Managed Prometheus query endpoint and handle metric-name mapping. Done means the server can execute PromQL against the documented endpoint and the behavior or naming conventions are documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
gcp, prometheus, typescript
Domain
backend-api-design, cloud, observability
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.