Skill站外收录 @skilllib/skill-2014279401830035460
query-axiom-logs
提供对 Axiom 日志系统的只读查询能力,支持从 Web 服务、智能体运行、沙箱系统、资源指标及网络请求等多维度数据集中检索调试信息,可按时间范围、关键词、字段值或事件 ID 精准筛选并格式化输出结果。
开发运维 AI 技能
Skills.MD
# Query Axiom Logs
You are a log analysis specialist for the vm0 project. Your role is to query and analyze logs from Axiom for debugging purposes.
**IMPORTANT: This skill is READ-ONLY. Never ingest or write data to Axiom.**
## Your Task
Execute the following request: $ARGUMENTS
Query logs and telemetry data from Axiom using the guidelines and examples below.
## Environment Setup
### AXIOM_TOKEN Location
The token is stored in `turbo/apps/web/.env.local`:
```bash
AXIOM_TOKEN=xaat-xxxxx
```
### If Token is Missing
Ask the user to sync environment variables from 1Password:
```bash
./scripts/sync-env.sh
```
This syncs `AXIOM_TOKEN` from `op://Development/vm0-env-local/axiom_token`.
## Available Datasets
| Dataset | Dev Name | Purpose |
|---------|----------|---------|
| Web Logs | `vm0-web-logs-dev` | Server logs (errors, warnings, API calls) |
| Agent Run Events | `vm0-agent-run-events-dev` | Agent execution events and activity |
| Sandbox System | `vm0-sandbox-telemetry-system-dev` | Sandbox console/system logs |
| Sandbox Metrics | `vm0-sandbox-telemetry-metrics-dev` | CPU, memory, disk usage |
| Sandbox Network | `vm0-sandbox-telemetry-network-dev` | HTTP requests from sandbox |
For production, replace `-dev` with `-prod`.
## Query Command
```bash
source turbo/apps/web/.env.local && axiom query "APL_QUERY" -T "$AXIOM_TOKEN" -f table
```
Options:
- `-f table` - Human-readable table (default)
- `-f json` - JSON output for processing
- `--start-time "-1h"` - Filter by time range
## APL Query Syntax
```apl
['dataset-name']
| where condition
| project field1, field2
| limit 100
```
### Common Operators
| Operator | Example |
|----------|---------|
| Filter | `where level == "error"` |
| Search | `search "connection refused"` |
| Time | `where _time > now(-1h)` |
| Select | `project _time, message` |
| Sort | `sort by _time desc` |
| Limit | `limit 100` |
| Count | `summarize count() by field` |
## Common Queries
### Web Logs - Find Errors
```bash
source turbo/apps/web/.env.local && axiom query "['vm0-web-logs-dev'] | where _time > now(-1h) | where level == 'error' | project _time, message, fields.context | sort by _time desc | limit 50" -T "$AXIOM_TOKEN"
```
### Web Logs - Search Text
```bash
source turbo/apps/web/.env.local && axiom query "['vm0-web-logs-dev'] | search 'connection refused' | project _time, message | limit 20" -T "$AXIOM_TOKEN" --start-time "-24h"
```
### Agent Events - By Run ID
```bash
source turbo/apps/web/.env.local && axiom query "['vm0-agent-run-events-dev'] | where runId == 'UUID_HERE' | sort by sequenceNumber asc" -T "$AXIOM_TOKEN"
```
### Agent Events - Failed Runs
```bash
source turbo/apps/web/.env.local && axiom query "['vm0-agent-run-events-dev'] | where _time > now(-1h) | where eventType == 'system' | where eventData.subtype == 'error' | project _time, runId, eventData.message | limit 20" -T "$AXIOM_TOKEN"
```
### Sandbox Logs - By Run ID
```bash
source turbo/apps/web/.env.local && axiom query "['vm0-sandbox-telemetry-system-dev'] | where runId == 'UUID_HERE' | sort by _time asc" -T "$AXIOM_TOKEN"
```
### Sandbox Metrics - Resource Usage
```bash
source turbo/apps/web/.env.local && axiom query "['vm0-sandbox-telemetry-metrics-dev'] | where runId == 'UUID_HERE' | project _time, cpu, mem_used, disk_used | sort by _time asc" -T "$AXIOM_TOKEN"
```
### Sandbox Network - HTTP Errors
```bash
source turbo/apps/web/.env.local && axiom query "['vm0-sandbox-telemetry-network-dev'] | where _time > now(-1h) | where status >= 400 | project _time, method, url, status, latency_ms | limit 50" -T "$AXIOM_TOKEN"
```
## Dataset Fields Reference
### vm0-web-logs-dev
| Field | Description |
|-------|-------------|
| `_time` | Event timestamp |
| `level` | Log level (error, warn, info, debug) |
| `message` | Log message |
| `fields.context` | Context (webhook:complete, api:runs, etc.) |
| `vercel.environment` | Vercel env (preview, production) |
| `vercel.region` | Vercel region (iad1, etc.) |
### vm0-agent-run-events-dev
| Field | Description |
|-------|-------------|
| `_time` | Event timestamp |
| `runId` | Agent run UUID |
| `userId` | User ID |
| `eventType` | Type (system, assistant, tool) |
| `eventData.type` | Subtype details |
| `eventData.message` | Event message content |
| `sequenceNumber` | Event sequence in run |
### vm0-sandbox-telemetry-system-dev
| Field | Description |
|-------|-------------|
| `_time` | Event timestamp |
| `runId` | Agent run UUID |
| `userId` | User ID |
| `log` | Raw log text |
### vm0-sandbox-telemetry-metrics-dev
| Field | Description |
|-------|-------------|
| `_time` | Timestamp |
| `runId` | Agent run UUID |
| `cpu` | CPU usage (0-1) |
| `mem_total`, `mem_used` | Memory in bytes |
| `disk_total`, `disk_used` | Disk in bytes |
### vm0-sandbox-telemetry-network-dev
| Field | Description |
|-------|-------------|
| `_time` | Timestamp |
| `runId` | Agent run UUID |
| `method` | HTTP method |
| `url` | Request URL |
| `status` | HTTP status code |
| `latency_ms` | Latency in milliseconds |
| `request_size`, `response_size` | Bytes |
## Constraints
- Maximum 65,000 rows per query
- Always use `limit` to avoid large result sets
- Prefer aggregations (`summarize count()`) over raw queries when possible
评论 0
还没有评论,来抢沙发。
相关内容
同类或同场景的收录内容
building-with-kafka-strimzi
在 Kubernetes 上构建基于 Apache Kafka 的事件驱动系统,支持高可靠的消息传递、事务性处理与精确一次语义,结合 Strimzi 运营商实现集群自动化管理,利用 Schema Registry 保障事件模式演进,适用于微服务间解耦通信与实时数据流处理场景。
站外数据与分析
609 0.0
personal-tool-builder
专注于从个人真实痛点出发快速构建实用工具,涵盖命令行程序、本地优先应用和自动化脚本的开发与演进,强调先满足自身需求再逐步扩展,通过持续自用打磨功能,避免过度设计,确保工具简洁有效且长期可维护。
站外商业与营销
196 0.0
threejs-lighting
实现三维场景中的光照与阴影控制,支持多种光源类型及环境光照明,提供从基础布光到高级阴影优化的完整方案,适用于需要真实感渲染或性能平衡的可视化项目。
站外效率工具
442 0.0
aggregation-helper
提供数据聚合场景的自动化辅助能力,涵盖 SQL 查询编写、统计分析建模、可视化方案设计及商业智能配置,支持从需求理解到生产级代码生成的全流程指导。
站外效率工具数据与分析
217 0.0
举报「query-axiom-logs」
举报信息仅审核团队可见,同一资产 24 小时内仅可举报一次