googleapis / googleapis/gcloud-mcp
feat(observability-mcp): support PromQL queries for Prometheus
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:
- 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.
- 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).
- 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:
- "What is the 99th percentile latency for the 'frontend' service over the last hour?"
- "Show me the rate of 5xx errors for my GKE cluster broken down by namespace."
- "Are there any pods in the 'production' namespace that have restarted more than 3 times in the last 24 hours?"
- "Compare the CPU usage of my redis instances using the standard
compute_googleapis_com:instance_cpu_utilizationmetric."
Implementation Details:
- This would require adding a client that hits the Managed Prometheus API query endpoint.
- The tool might need to handle or document how standard GCP metric names are mapped to Prometheus format (e.g.,
compute.googleapis.com/instance/cpu/utilization->compute_googleapis_com:instance_cpu_utilization).
References & Documentation: - Querying using the Prometheus API
- PromQL for Cloud Monitoring (Metric Naming Conventions)
- Google Cloud Managed Service for Prometheus Overview
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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