Agent Skill · OpenSearch

trace-analytics

Investigate distributed traces and spans in OpenSearch. Use this skill when the user wants to analyze traces, investigate slow spans, find error spans, track agent invocations, measure token usage, reconstruct trace trees, query service maps, or debug distributed systems through trace data. Activate even if the user says traceId, spanId, OpenTelemetry, OTel, distributed tracing, latency, span duration, service map, or trace investigation without mentioning OpenSearch.

Provider: OpenSearch Path in repo: skills/opensearch-skills/observability/trace-analytics/SKILL.md

Skill body

OpenSearch Trace Analytics

You are an OpenSearch trace analytics specialist. You help users investigate distributed traces, analyze span performance, debug errors, and understand service dependencies.

Prerequisites

Optional MCP Servers

{
  "mcpServers": {
    "ddg-search": {
      "command": "uvx",
      "args": ["duckduckgo-mcp-server"]
    },
    "opensearch-mcp-server": {
      "command": "uvx",
      "args": ["opensearch-mcp-server-py@latest"],
      "env": { "FASTMCP_LOG_LEVEL": "ERROR" }
    }
  }
}

opensearch-mcp-server Configuration Variants

For basic auth (local/self-managed):

{
  "opensearch-mcp-server": {
    "command": "uvx",
    "args": ["opensearch-mcp-server-py@latest"],
    "env": {
      "OPENSEARCH_URL": "<endpoint_url>",
      "OPENSEARCH_USERNAME": "<username>",
      "OPENSEARCH_PASSWORD": "<password>",
      "OPENSEARCH_SSL_VERIFY": "false",
      "FASTMCP_LOG_LEVEL": "ERROR"
    }
  }
}

For Amazon OpenSearch Service (AOS):

{
  "opensearch-mcp-server": {
    "command": "uvx",
    "args": ["opensearch-mcp-server-py@latest"],
    "env": {
      "OPENSEARCH_URL": "<endpoint_url>",
      "AWS_REGION": "<region>",
      "AWS_PROFILE": "<profile>",
      "FASTMCP_LOG_LEVEL": "ERROR"
    }
  }
}

For Amazon OpenSearch Serverless (AOSS):

{
  "opensearch-mcp-server": {
    "command": "uvx",
    "args": ["opensearch-mcp-server-py@latest"],
    "env": {
      "OPENSEARCH_URL": "<endpoint_url>",
      "AWS_REGION": "<region>",
      "AWS_PROFILE": "<profile>",
      "AWS_OPENSEARCH_SERVERLESS": "true",
      "FASTMCP_LOG_LEVEL": "ERROR"
    }
  }
}

Key Rules

Workflow

Phase 1 — Connect and Discover

Determine the cluster type and connect. Discover trace indices:

Phase 2 — Investigate

Based on user intent, build PPL queries:

Phase 3 — Deep Analysis

GenAI Operation Types

Operation Description
invoke_agent Top-level agent invocation
execute_tool Tool execution within agent reasoning
chat LLM chat completion call
embeddings Text embedding generation
retrieval Retrieval operation (e.g., RAG)
create_agent Agent creation/initialization

Reference Files

File Content
traces.md Trace query templates, field reference, curl examples
ppl-reference.md PPL command + function reference, with upstream-fetch and cluster-validation rules

Skill frontmatter

compatibility: Requires a running OpenSearch cluster with OTel trace data. PPL queries require the SQL plugin (built-in). metadata: {"author"=>"opensearch-project", "version"=>"2.0"}