axiom-apl
作者: axiomhq
APL 查詢語言參考,適用於 Axiom。提供運算子、函式、模式及 CLI 使用方式。由專門的 Axiom 技能在撰寫或…時自動呼叫。
npx skills add https://github.com/axiomhq/cli --skill axiom-aplAxiom Processing Language (APL)
APL is Axiom's query language for analyzing observability data. This skill provides comprehensive guidance for writing, debugging, and optimizing APL queries.
Quick Reference
Documentation: https://axiom.co/docs/apl/introduction
CLI usage: See references/cli.md
Core Workflow
1. List Available Datasets
axiom dataset list -f json
2. Discover Schema (CRITICAL - Always Do First)
['<dataset>'] | getschema
Never guess field names. The schema shows all fields with their types.
3. Sample Data
['<dataset>'] | limit 10
4. Write Query
See references for operators, functions, and patterns.
APL Syntax Essentials
Dataset Reference
['dataset-name'] // Bracket notation (required for names with dots/dashes)
dataset_name // Plain identifier (only for simple names)
Field Reference
field_name // Plain field
['field.with.dots'] // Bracket notation for dotted fields
['service.name'] // OTel data (see references/otel.md for field mappings)
Basic Query Structure
['dataset']
| where <condition>
| extend <new_field> = <expression>
| summarize <aggregation> by <grouping>
| project <fields>
| sort by <field> desc
| limit 100
Time Handling
Always filter by time first - it's the most selective filter.
// Relative time
| where _time >= ago(1h)
| where _time >= ago(24h) and _time < ago(1h)
// Absolute time
| where _time >= datetime(2024-01-15T10:00:00Z)
| where _time between (datetime(2024-01-15) .. datetime(2024-01-16))
Time functions:
ago(timespan)- Relative past timenow()- Current timedatetime(string)- Parse datetimebin(_time, 5m)- Time bucketingbin_auto(_time)- Automatic bucketing
When NOT to Use
- Simple field lookup: Use
getschemadirectly instead of invoking the full skill - Known query patterns: If you already have a working query, don't re-invoke for syntax help
- Real-time alerting: Use Axiom Monitors for continuous alerting, not ad-hoc queries
References
- CLI Usage - Command flags and execution
- Operators - Tabular and scalar operators
- Functions - String, datetime, aggregation functions
- Patterns - Query patterns by use case
- Common Gotchas - Mistakes and fixes
- OpenTelemetry - OTel field mappings and trace patterns
來自 axiomhq 的更多技能
detect-anomalies
axiomhq
使用統計分析檢測 Axiom 資料集中的異常。適用於尋找不尋常的模式、流量高峰、離群值或新的錯誤類型等情況。
official
explore-dataset
axiomhq
探索 Axiom 資料集以了解其結構、欄位、資料量及模式。適用於發現新資料集、調查資料結構或…
official
find-traces
axiomhq
分析來自 Axiom 的 OpenTelemetry 分散式追蹤。用於調查追蹤 ID、依條件(錯誤、延遲、服務)尋找追蹤,或進行除錯…
official
gilfoyle
axiomhq
SRE代理,完成你做不到的事。查詢你的可觀測性堆疊。找出根本原因。不驚慌。不猜測。不在乎你的感受。使用…
official
axiom-sre
axiomhq
專精於事件調查與除錯的SRE專家。採用假設驅動方法論與系統化分類。可在可用時查詢Axiom可觀測性資料。…
official
building-dashboards
axiomhq
透過API設計與建置Axiom儀表板,涵蓋圖表類型、APL與指標/MPL查詢模式、SmartFilters、版面配置及設定選項。適用於…
official
controlling-costs
axiomhq
分析 Axiom 查詢模式以找出未使用的資料,然後建立儀表板和監控以進行成本最佳化。當被要求降低 Axiom 成本、找出未使用的資料時使用。
official
query-metrics
axiomhq
透過腳本對 Axiom MetricsDB 執行指標查詢。可探索可用的指標、標籤及標籤值。當被要求查詢指標、探索指標時使用…
official