aliyun-arms-query
Use when querying distributed traces or application metrics in Alibaba Cloud ARMS (Application Real-Time Monitoring Service). Use for trace search by service/duration/tags, trace detail and method stack retrieval, application listing, and performance metrics queries.
What this skill does
Category: service
# ARMS Trace & Metrics Query
Query distributed traces and application performance metrics via ARMS Python SDK.
## Prerequisites
- Install SDK (virtual environment recommended):
```bash
python3 -m venv .venv
. .venv/bin/activate
python -m pip install -U alibabacloud_arms20190808 alibabacloud_tea_openapi
```
- Configure environment variables:
- `ALIBABACLOUD_ACCESS_KEY_ID`
- `ALIBABACLOUD_ACCESS_KEY_SECRET`
- `ARMS_REGION_ID` (e.g. `cn-hangzhou`)
## Core Concepts
- **Trace query**: Search traces by service name, span name, duration, tags, error status. Time range in epoch milliseconds. Supports PID and exclusion filters.
- **Trace detail**: Retrieve full span tree for a single TraceID. Supports pagination for large traces.
- **Method stack**: Retrieve the method-level call stack for a specific span (requires TraceID, RpcID, and PID).
- **Metrics query**: Query predefined metric tables (e.g. `appstat.incall`) with dimensions, measures, and filters. Requires application PID. Supports ordering.
- **Application PID**: Unique app identifier in format `xxx@regionId`, obtained via `ListTraceApps`.
## Quickstart — Search Traces (Python SDK)
```python
import os, time
from alibabacloud_arms20190808.client import Client
from alibabacloud_arms20190808 import models
from alibabacloud_tea_openapi.models import Config
config = Config(
access_key_id=os.environ["ALIBABACLOUD_ACCESS_KEY_ID"],
access_key_secret=os.environ["ALIBABACLOUD_ACCESS_KEY_SECRET"],
region_id=os.environ.get("ARMS_REGION_ID", "cn-hangzhou"),
)
config.endpoint = f'arms.{config.region_id}.aliyuncs.com'
client = Client(config)
end_ms = int(time.time() * 1000)
start_ms = end_ms - 15 * 60 * 1000
request = models.SearchTracesByPageRequest(
region_id=config.region_id,
start_time=start_ms,
end_time=end_ms,
service_name="my-app",
min_duration=500,
page_number=1,
page_size=20,
)
response = client.search_traces_by_page(request)
for trace in response.body.page_bean.trace_infos:
print(f"{trace.trace_id} {trace.duration}ms {trace.service_name}")
```
## Quickstart — Query Metrics (Python SDK)
```python
request = models.QueryMetricByPageRequest(
region_id=config.region_id,
metric="appstat.incall",
start_time=start_ms,
end_time=end_ms,
interval_in_sec=60000,
measures=["rt", "count", "error"],
dimensions=["rpc"],
filters=[models.QueryMetricByPageRequestFilters(key="pid", value="xxx@cn-hangzhou")],
current_page=1,
page_size=10,
)
response = client.query_metric_by_page(request)
for item in response.body.data.items:
print(item)
```
## Script Catalog
### Search traces
```bash
python skills/observability/arms/aliyun-arms-query/scripts/search_traces.py \
--service-name my-app \
--last-minutes 15
```
Optional args: `--region`, `--operation-name`, `--min-duration`, `--service-ip`, `--pid`, `--error-only`, `--tag KEY=VALUE` (repeatable), `--exclusion-filter KEY=VALUE` (repeatable), `--page`, `--page-size`, `--reverse`.
### Get trace detail
```bash
python skills/observability/arms/aliyun-arms-query/scripts/get_trace_detail.py \
--trace-id 1c34ffee16xxxxxxxx
```
Optional args: `--region`, `--start`, `--end`, `--page`, `--page-size`.
### Query metrics
```bash
python skills/observability/arms/aliyun-arms-query/scripts/query_metrics.py \
--metric appstat.incall \
--pid "xxx@cn-hangzhou" \
--last-minutes 30
```
Optional args: `--region`, `--measures` (comma-separated), `--dimensions` (comma-separated), `--interval`, `--page`, `--page-size`, `--order-by`, `--order ASC|DESC`.
### List traced applications
```bash
python skills/observability/arms/aliyun-arms-query/scripts/list_trace_apps.py
```
Optional args: `--region`, `--app-type TRACE|EBPF`, `--resource-group-id`.
### Get span method stack
```bash
python skills/observability/arms/aliyun-arms-query/scripts/get_stack.py \
--trace-id 1c34ffee16xxxxxxxx \
--rpc-id 0.1 \
--pid "xxx@cn-hangzhou"
```
Optional args: `--region`, `--span-id`, `--start`, `--end`.
## Common Metric Names
| Metric | Description |
|--------|-------------|
| `appstat.incall` | Inbound call stats (RT, count, error) per endpoint |
| `appstat.outcall` | Outbound call stats (HTTP, RPC, DB) |
| `appstat.sql` | SQL execution stats |
| `appstat.exception` | Exception stats |
| `appstat.host` | Host-level metrics (CPU, memory, load) |
Common measures: `rt` (response time), `count` (request count), `error` (error count).
Common dimensions: `rpc` (endpoint), `type` (call type), `exceptionClass`.
## Workflow
1. List traced apps with `list_trace_apps.py` to obtain PID.
2. Search traces with time range, service name, and optional filters via `search_traces.py`.
3. Get detail for a specific trace using its TraceID via `get_trace_detail.py`.
4. Inspect method stack for a slow or errored span via `get_stack.py` (requires TraceID, RpcID, PID).
5. Query aggregated metrics using PID, metric name, and desired measures/dimensions via `query_metrics.py`.
## AccessKey Priority
1. Environment variables: `ALIBABACLOUD_ACCESS_KEY_ID` / `ALIBABACLOUD_ACCESS_KEY_SECRET`
2. Shared credentials file: `~/.alibabacloud/credentials` (profile `default`)
## API Discovery
- Product code: `ARMS`
- API version: `2019-08-08`
- Metadata: `https://api.aliyun.com/meta/v1/products/ARMS/versions/2019-08-08/api-docs.json`
## Validation
```bash
mkdir -p output/aliyun-arms-query
for f in skills/observability/arms/aliyun-arms-query/scripts/*.py; do
python3 -m py_compile "$f"
done
echo "py_compile_ok" > output/aliyun-arms-query/validate.txt
```
Pass criteria: command exits 0 and `output/aliyun-arms-query/validate.txt` is generated.
## Output And Evidence
- Save artifacts, command outputs, and API response summaries under `output/aliyun-arms-query/`.
- Include key parameters (region, PID, TraceID, time range) in evidence files for reproducibility.
## References
- API reference: `references/api-reference.md`
- Source list: `references/sources.md`
Related in Cloud & DevOps
appbuilder-action-scaffolder
IncludedCreate, implement, deploy, and debug Adobe Runtime actions with consistent layout, validation, and error handling. Use this skill whenever the user needs to add actions to an App Builder project, understand action structure (params, response format, web/raw actions), configure actions in the manifest, use App Builder SDKs (State, Files, Events, database), deploy and invoke actions via CLI, debug action issues, or implement patterns such as webhook receivers, custom event providers, journaling consumers, large payload redirects, action sequence pipelines, and Asset Compute workers. Also trigger when users mention serverless functions in Adobe context, action logging, IMS authentication for actions, or cron-style scheduled actions.
orchestrating-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. Use this skill when the user needs a multi-step Data Cloud pipeline, cross-phase troubleshooting, or data space and data kit management. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase sf data360 workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching phase-specific skill), the task is STDM/session tracing/parquet telemetry (use observing-agentforce), standard CRM SOQL (use querying-soql), or Apex implementation (use generating-apex).
github-project-automation
IncludedAutomate GitHub repository setup with CI/CD workflows, issue templates, Dependabot, and CodeQL security scanning. Includes 12 production-tested workflows and prevents 18 errors: YAML syntax, action pinning, and configuration. Use when: setting up GitHub Actions CI/CD, creating issue/PR templates, enabling Dependabot or CodeQL scanning, deploying to Cloudflare Workers, implementing matrix testing, or troubleshooting YAML indentation, action version pinning, secrets syntax, runner versions, or CodeQL configuration. Keywords: github actions, github workflow, ci/cd, issue templates, pull request templates, dependabot, codeql, security scanning, yaml syntax, github automation, repository setup, workflow templates, github actions matrix, secrets management, branch protection, codeowners, github projects, continuous integration, continuous deployment, workflow syntax error, action version pinning, runner version, github context, yaml indentation error
sf-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase `sf data360` workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching sf-datacloud-* skill), the task is STDM/session tracing/parquet telemetry (use sf-ai-agentforce-observability), standard CRM SOQL (use sf-soql), or Apex implementation (use sf-apex).
fabric-cli
IncludedUse this skill for Fabric.so CLI workflows with the `fabric` terminal command: diagnose/install/login, search or browse a Fabric library, save notes/links/files, create folders, ask the Fabric AI assistant, manage tasks/workspaces, generate shell completion, check subscription usage, produce JSON output, and use Fabric as persistent agent memory. Do not use for Microsoft Fabric/Azure/Power BI `fab`, Daniel Miessler's Fabric framework, Python Fabric SSH, Fabric.js, or textile/fashion fabric.
lark
IncludedLark/Feishu CLI skills: lark-cli operations for docs, markdown, sheets, base, calendar, im, mail, task, okr, drive, wiki, slides, whiteboard, apps, approval, attendance, contact, vc, minutes, event. Use when the user needs to operate Lark/Feishu resources via lark-cli, send messages, manage documents, spreadsheets, calendars, tasks, OKRs, deploy web pages, or any Feishu/Lark workspace operations.