find-traces

द्वारा axiomhq

Axiom से OpenTelemetry वितरित ट्रेस का विश्लेषण करें। ट्रेस आईडी की जांच करते समय, मानदंडों (त्रुटियाँ, विलंबता, सेवा) के आधार पर ट्रेस ढूंढते समय, या डीबगिंग करते समय उपयोग करें…

npx skills add https://github.com/axiomhq/cli --skill find-traces

Trace Analysis

Analyze OpenTelemetry distributed traces to identify errors, latency issues, and root causes.

Arguments

When invoked with a trace ID (e.g., /find-traces abc123...), it's available as $ARGUMENTS.

Trace Dataset Discovery

First, find trace datasets:

axiom dataset list -f json

Look for datasets containing trace data (often named *traces*, *spans*, or otel-*).

Schema Discovery

Always verify field names first:

axiom query "['<trace-dataset>'] | getschema" --start-time -1h

Common Operations

Get Trace by ID

axiom query "['<dataset>']
| where trace_id == '<TRACE_ID>'
| sort by _time asc
| limit 100" --start-time -1h -f json

Find Error Traces

axiom query "['<dataset>']
| where _time >= ago(1h)
| where error == true
| extend error = coalesce(ensure_field(\"error\", typeof(bool)), false)
| summarize
    start_time = min(_time),
    total_duration = max(duration),
    span_count = count(),
    error_count = countif(error),
    services = make_set(['service.name']),
    root_operation = arg_min(_time, name)
  by trace_id
| sort by start_time desc
| limit 20" --start-time -1h -f json

Find Slow Traces

axiom query "['<dataset>']
| where _time >= ago(1h)
| where duration >= 1000000000
| summarize
    start_time = min(_time),
    total_duration = max(duration),
    span_count = count(),
    services = make_set(['service.name'])
  by trace_id
| sort by total_duration desc
| limit 20" --start-time -1h -f json

Find Traces by Service

axiom query "['<dataset>']
| where _time >= ago(1h)
| where ['service.name'] == '<SERVICE>'
| summarize
    start_time = min(_time),
    total_duration = max(duration),
    span_count = count(),
    error_count = countif(error == true)
  by trace_id
| sort by start_time desc
| limit 20" --start-time -1h -f json

Error Spans in Trace

axiom query "['<dataset>']
| where trace_id == '<TRACE_ID>'
| where error == true
| project _time, ['service.name'], name, duration, ['status.message']" --start-time -1h -f json

Critical Path Analysis

axiom query "['<dataset>']
| where trace_id == '<TRACE_ID>'
| project span_id, parent_span_id, ['service.name'], name, duration, error
| sort by duration desc" --start-time -1h -f json

OTel Field Reference

FieldBracket?Description
trace_idNo32-char trace identifier
span_idNo16-char span identifier
parent_span_idNoParent span (empty for root)
nameNoOperation name
durationNoDuration in nanoseconds
kindNoCLIENT, SERVER, INTERNAL, PRODUCER, CONSUMER
errorNoBoolean error flag
['service.name']YesService identifier
['status.code']YesOK, ERROR, or nil
['status.message']YesError description
['scope.name']YesInstrumentation library

Duration Conversion

OTel durations are in nanoseconds:

HumanNanosecondsFilter
1 ms1,000,000duration >= 1000000
100 ms100,000,000duration >= 100000000
1 s1,000,000,000duration >= 1000000000

Convert for display:

| extend duration_ms = duration / 1000000.0

Custom Attributes

Non-standard span attributes are stored in attributes.custom map:

// Filter by custom attribute
| where ['attributes.custom']['user_id'] == "123"

// Aggregation requires explicit cast
| summarize count() by tostring(['attributes.custom']['tenant'])

Without tostring(), aggregations fail with "grouping by field of type unknown".

Codebase Correlation

When working in a repository that matches the traced service, correlate trace data with source code to identify root causes.

Mapping Trace Data to Code

  1. Extract package/module path from ['scope.name']

    • Contains the instrumentation library or package path
    • Strip the module prefix to get the local path
    • Example: github.com/org/repo/pkg/authpkg/auth
  2. Find code from operation name

    • The name field often contains function names or HTTP routes
    • Search the codebase for matching handlers, functions, or endpoints
  3. Trace the call chain

    • Follow parent-child span relationships
    • Map each span to its corresponding code location
    • Identify where errors originate and propagate

Note: Codebase correlation is optional. Proceed with trace-only analysis if code is unavailable or doesn't match the traced services.

Output Format

When analyzing a trace, provide:

## Trace Summary
- **Trace ID:** <id>
- **Duration:** <human-readable>
- **Services:** <list>
- **Outcome:** success/failure

## Sequence of Events
1. <Service> - <operation> (<duration>)
2. <Service> - <operation> (<duration>) ⚠️ ERROR
...

## Error Analysis
<What failed, when, why>

## Root Cause
<Deepest error and explanation>

## Codebase Locations (if applicable)
- **Service:** <service.name>
- **Package:** <scope.name>
- **Files:** <specific files to investigate>

## Recommended Actions
1. <Specific action>
2. <What to investigate next>

When NOT to Use

  • Metrics analysis: Traces are for request flow; use logs/metrics skills for aggregated performance data
  • Non-OTel data: This skill assumes OpenTelemetry field conventions (trace_id, span_id, etc.)
  • Known trace structure: If you already have the query, run it directly without invoking this skill
  • Alerting on trace patterns: Use Axiom Monitors for continuous alerting

APL Reference

For query syntax, invoke the axiom-apl skill which provides trace analysis patterns and duration unit guidance.

axiomhq की और Skills

axiom-apl
axiomhq
APL क्वेरी भाषा संदर्भ Axiom के लिए। ऑपरेटर, फ़ंक्शन, पैटर्न और CLI उपयोग प्रदान करता है। विशेष Axiom कौशल द्वारा लिखते समय या... स्वचालित रूप से आहूत किया जाता है।
official
detect-anomalies
axiomhq
Axiom डेटासेट में सांख्यिकीय विश्लेषण का उपयोग करके विसंगतियों का पता लगाएं। असामान्य पैटर्न, वॉल्यूम स्पाइक्स, आउटलायर्स या नए त्रुटि प्रकारों की खोज करते समय उपयोग करें…
official
explore-dataset
axiomhq
एक्सिओम डेटासेट का अन्वेषण करें ताकि इसकी स्कीमा, फ़ील्ड, वॉल्यूम और पैटर्न को समझ सकें। नए डेटासेट की खोज करते समय, डेटा संरचना की जांच करते समय, या…
official
gilfoyle
axiomhq
वह SRE एजेंट जो वह करता है जो आप नहीं कर सकते। आपके ऑब्ज़र्वेबिलिटी स्टैक को क्वेरी करता है। मूल कारण ढूंढता है। घबराता नहीं है। अनुमान नहीं लगाता। आपकी भावनाओं की परवाह नहीं करता। उपयोग करें…
official
axiom-sre
axiomhq
इंसिडेंट और डीबगिंग के लिए विशेषज्ञ SRE अन्वेषक। परिकल्पना-संचालित पद्धति और व्यवस्थित ट्राइएज का उपयोग करता है। उपलब्ध होने पर Axiom ऑब्ज़र्वेबिलिटी को क्वेरी कर सकता है।…
official
building-dashboards
axiomhq
एक्सिओम डैशबोर्ड को API के माध्यम से डिज़ाइन और बनाता है। इसमें चार्ट प्रकार, APL और मेट्रिक्स/MPL क्वेरी पैटर्न, स्मार्टफ़िल्टर, लेआउट और कॉन्फ़िगरेशन विकल्प शामिल हैं। इसका उपयोग तब करें जब...
official
controlling-costs
axiomhq
Axiom क्वेरी पैटर्न का विश्लेषण करके अप्रयुक्त डेटा ढूंढता है, फिर लागत अनुकूलन के लिए डैशबोर्ड और मॉनिटर बनाता है। जब Axiom लागत कम करने, अप्रयुक्त डेटा खोजने के लिए कहा जाए तो इसका उपयोग करें…
official
query-metrics
axiomhq
Axiom MetricsDB के विरुद्ध स्क्रिप्ट के माध्यम से मेट्रिक्स क्वेरी चलाता है। उपलब्ध मेट्रिक्स, टैग और टैग मान खोजता है। जब मेट्रिक्स क्वेरी करने, मेट्रिक्स खोजने के लिए कहा जाए तो उपयोग करें…
official