Agent skill · data analytics · jeremylongshore
oraclecloud-query-transform
Query OCI metrics with MQL and create monitoring alarms via the Python
Why this skill is useful
Provides specific MQL queries and Python SDK usage patterns for querying OCI metrics that are not widely documented.
What it needs
Requires oci installed locally. Requires oraclecloud account access. About 4k tokens when loaded. Last updated 2026-08-07. 2,604 stars on the source repository.
What this skill does
OCI Monitoring — MQL Queries & Alarms Overview Query OCI metrics using MQL (Monitoring Query Language) and create alarms via the Python SDK. MQL is underdocumented and the console query builder is buggy — it often generates invalid syntax or silently returns empty results. This skill provides working MQL queries for the metrics you actually need (CPU, memory, network, disk) via the SDK, bypassing console issues entirely. Purpose: Retrieve infrastructure metrics programmatically and set up alerting without relying on the OCI Console query builder. Prerequisites OCI Python SDK — pip install oci Config file at ~/.oci/config with fields: user, fingerprint, tenancy, region, keyfile IAM policies: Allow group Developers to read metrics in compartment <name> Allow group Developers to manage alarms in compartment <name> Allow group Developers to manage ons-topics in compartment <name> (for alarm notifications) Python 3.8+ Running compute instances or other resources emitting metrics Instructions Step 1: Understand MQL Syntax MQL queries follow this pattern: Key components: MetricName — e.g., CpuUtilization, MemoryUtilization, NetworkBytesIn Interval — data granularity: 1m, 5m, 1h (minimum depends on metric) Dimensions — filters in curly braces: {resourceId = "ocid1.instance..."} Grouping — .groupBy(dimension) to split results Statistic — .mean(), .max(), .min(), .sum(), .count(), .percentile(0.95) Step 2: Query CPU Utilization Step 3: Query Memory, Network, and Disk Metrics Step 4: Filter by Specific Instance Step 5: List Available Metrics When you are unsure what metrics exist, list them first. Common namespaces: ocicomputeagent (compute), ocivcn (networking), ociobjectstorage (storage), ociblockstore (block volumes), ociautonomousdatabase (ADB). …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills jeremylongshore/oraclecloud-query-transform--a7c467