cloud-monitoring-promql-query
यह क्या करती है
यह स्किल Google Cloud metrics पढ़ने वाली PromQL क्वेरी लिखती है। यह उन लोगों के लिए है जो मानक Cloud Monitoring फ़िल्टर फ़ॉर्मेट के बजाय PromQL पसंद करते हैं।
कब इस्तेमाल करें
- ✓जब आपको Cloud Monitoring metric का चार्ट बनाने या उस पर अलर्ट सेट करने के लिए PromQL क्वेरी चाहिए।
- ✓जब आपको Google Cloud संसाधन के लिए PromQL में aggregation लिखनी हो।
- ✓जब आप किसी metric को सही PromQL ढाँचे में बदलना चाहें।
Skill का लिंक
https://github.com/google/skills/blob/main/skills/cloud/cloud-monitoring-promql-query/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मेरी Cloud Run सेवा के लिए प्रति मिनट error rate दिखाने वाली PromQL क्वेरी लिखिए।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
यह पहले आपकी प्रोजेक्ट ID जाँचती है, फिर metric और संसाधन विवरण को उस PromQL ढाँचे से मिलाती है जिसकी Google Cloud अपेक्षा करता है। यह इस्तेमाल के लिए तैयार क्वेरी लौटाती है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Cloud Monitoring PromQL Generator
Use this skill to generate a valid PromQL query from any Cloud Monitoring metric type. This guide applies to all Cloud Monitoring metric types by mapping Cloud Monitoring metric and resource descriptors to PromQL structures.
Attribution
MUST READ: Before executing any gcloud, REST API, or MCP command, you
MUST read Usage Attribution. For commands executed
directly in the terminal (never in generated scripts, Terraform, or user code),
prefix gcloud with
CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:cloud-monitoring-promql-query)"
and append agent-skills/1.0 (skill:cloud-monitoring-promql-query) to User-Agent headers.
Workflow
Resolve Project ID (CRITICAL & BLOCKING)
Before performing any other actions (such as searching code, reading references, or running validation), you MUST verify whether the Google Cloud Project ID is available:
- Check Prompt/Payload: Look for the Project ID in the user's prompt or input.
- Check Environment: If the Project ID is not present in the prompt, you
MUST run
gcloud config get-value projectto attempt to resolve it from the environment. - Ask for Clarification (BLOCKING): If the Project ID is not in the prompt
AND the
gcloudcommand fails, returns an empty string, or is unavailable, you MUST immediately stop. Do NOT generate a PromQL query, do not run the validation script, and do not use placeholders (likeYOUR_PROJECT_ID). You must refuse to proceed and ask the user to provide the Project ID.
Inspect Metric and Resource Descriptors
- Use Provided Descriptors First: If the user's prompt already includes
metric descriptor details (such as
metric.type,metricKind,valueType, ormonitoredResourceTypes) or specific resource filter values, use those values directly instead of calling the Cloud Monitoring API. - Discover Missing Descriptors: If exact metric descriptors
(
metric.type,metricKind,valueType) are missing or underspecified, resolve the target metric type's descriptor using one of these paths:- Vague Query: If the prompt is vague (for example,
"VM CPU usage"), use thecloud-monitoring-metric-selectionskill first to identify the specific metric type. - Known Metric Type: If you already have the specific metric type name
(for example,
compute.googleapis.com/instance/cpu/utilization) but need its descriptor, call thegoogle-cloud-monitoring:list_metric_descriptorsMCP tool. If the tool is missing, refer to thecloud-monitoring-metric-selectionskill to configure the Cloud Monitoring MCP server. - Fallback: If the MCP tool cannot be configured, fall back to making a direct Cloud Monitoring API call.
- Vague Query: If the prompt is vague (for example,
- Identify Key Fields: From the retrieved descriptor, identify four key
schema attributes:
type: The Cloud Monitoring metric type string.metricKind:GAUGE,DELTA, orCUMULATIVE.valueType:INT64,DOUBLE,DISTRIBUTION, orBOOL.monitoredResourceTypes: Compatibleresource.typestrings required for resource scoping and grouping.
Resolve Resource Filters & Discovery Protocol
To filter data by a specific resource instance, apply these resource rules and discovery protocols:
- Monitored Resource Filter: Always include the
monitored_resource="<type>"filter in your query to prevent collisions across services that share metric names.- Example:
monitored_resource="gae_app"
- Example:
- Preserve User Literals (CRITICAL): ALWAYS use the literal resource names, namespaces, and IDs provided in the user's prompt. Do NOT override or replace these values with active resource names found during Cloud Monitoring discovery unless the user explicitly asked you to find active resources. Telemetry discovery must only be used to identify metric type names and label keys, not to override user input.
- Resource Identifier Mapping:
- Direct & Specific Keys: Use the most specific resource identifier
available. Example:
version_id,cluster_name. - Name-to-ID Resolution: If the user filters by a resource name
(such as
"instance-1"), but the resource schema uses numeric IDs (likeinstance_id), us
- Direct & Specific Keys: Use the most specific resource identifier
available. Example:
अक्सर पूछे जाने वाले सवाल
क्या इसे मेरी प्रोजेक्ट ID चाहिए?
हाँ। यह प्रोजेक्ट ID पूछती है, और अगर वह आपके अनुरोध में न हो तो वातावरण जाँचती है।
क्या यह metrics खोजती है?
नहीं। metric खोज एक अलग चयन स्किल संभालती है।
क्या यह हर metric प्रकार के लिए काम करती है?
यह किसी भी Cloud Monitoring metric और संसाधन प्रकार को PromQL में मैप करने के लिए बनी है।
जानकारी
लेखक का मूल विवरण
Generates valid PromQL queries from Cloud Monitoring metric descriptors and resource parameters. Use when asked to create, generate, write, or format PromQL queries, PromQL strings, or PromQL aggregations for Cloud Monitoring metrics and resources. Don't use for raw metric discovery or metric selection.
repo: google/skills
लोकप्रियता
- GitHub स्टार
- 22k
- रैंकिंग में स्थान
- #10244
- लाइसेंस
- Apache-2.0
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
finding-google-skills
22kआपके एजेंट को किसी सेटअप काम के लिए सही Google गाइड खोजने में मदद करती है, जैसे hosting, databases, storage, sign-in या AI model serving।
gcloud
22kयह आपके एजेंट को Google Cloud gcloud कमांड लिखने और जाँचने में मदद करती है, कुछ भी चलाने से पहले सटीक सिंटैक्स देखकर, ताकि फ़्लैग का अंदाज़ा न लगे।
google-cloud-recipe-auth
22kआपके एजेंट को Google Cloud की पहचान और पहुँच समझाती है, जिसमें यह शामिल है कि लोग और सेवाएँ कैसे साइन इन करते हैं और उन्हें कौन सी अनुमतियाँ मिलती हैं।
google-cloud-recipe-onboarding
22kएक नए डेवलपर को Google Cloud पर पहले कदमों में मदद करती है, जिसमें प्रोजेक्ट चुनना, बिलिंग जोड़ना और पहला संसाधन डिप्लॉय करना शामिल है।
मिलती-जुलती skills
openclaw-update
394kयह आपके एजेंट को चल रहे OpenClaw Gateway को अपडेट करने में मदद करती है, इंस्टॉल के तरीके के अनुसार सही विधि चुनकर और सेशन बनाए रखकर।
diagnose-gateway
394kयह आपके एजेंट को सेटिंग्स, चैनल और पोर्ट जांचकर पता लगाने देती है कि OpenClaw Gateway क्यों फ़ेल हो रहा है, बिना कुछ बदले।
crabbox-apps
394kयह आपके एजेंट को किसी अस्थायी क्लाउड मशीन पर ऐप खोलने और चलाने देती है, फिर उसका व्यू आपके चैट के साइड पैनल में दिखाती है।