Logo Observability Llm Obs

Observability Llm Obs

Tổ chức
elastic
observability-llm-obs

Answer questions about LLM and agentic-application behavior from data already ingested into Elastic: latency and error rate, token and cost utilization, response quality and guardrail events, and agentic call-chain orchestration. Use when the user asks about LLM monitoring, GenAI observability, token spend or AI cost, model latency, prompt or guardrail failures, or how an agent's tool-call chain executed.

Add to TypingMind

Tổng quan

Nhà phát hànhelastic
Kho mãagent-skills
Tên kỹ năngobservability-llm-obs
Sao
589
Bản fork
53
Tệp đi kèm
3
Giấy phépApache-2.0
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 3 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được elastic công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Observability Llm Obs trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/elastic/agent-skills/tree/main/plugins/observability/skills/llm-obs
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/elastic/agent-skills.git /tmp/agent-skills
mkdir -p .claude/skills
cp -r /tmp/agent-skills/plugins/observability/skills/llm-obs .claude/skills/observability-llm-obs
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Observability Llm Obs trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Observability Llm Obs ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Observability Llm Obs với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

LLM and Agentic Observability

Answer questions about monitoring LLMs and agentic components using data actually ingested into Elastic — nothing else. The four questions this skill answers are LLM performance, cost and token utilization, response quality, and call chaining or agentic workflow orchestration.

A given deployment typically uses one or more ingestion paths: APM/OTLP traces, and/or integration metrics and logs. Which one exists is a discovery result, not an assumption — never assume both are present. For ES|QL syntax, commands, and query patterns, use the elasticsearch-esql skill. For service-level latency and error triage that is not LLM-specific, use the observability-sre-triage skill.

Environment Configuration

This skill executes Elasticsearch operations through the elastic CLI. If the elastic CLI is not installed, tell the user what it is needed for. Do not guess credentials, call the HTTP API directly, or attempt other workarounds.

This skill references operations in HTTP-shorthand form (e.g., GET /, GET /_cat/indices, GET /{index}/_mapping, GET /{index}/_settings/index.mode, POST /_query). The Operations table at the end of this document maps each shorthand to the equivalent elastic CLI command — always use the CLI rather than calling the HTTP API directly.

Analysis without cluster access

The CLI check above gates querying the cluster — it does not gate analysis. When the user has already supplied the evidence in their question (metric values, counts, status reasons, log lines, alert payloads, configuration), reason from that evidence and deliver the conclusion.

When you genuinely do need data the user has not provided, still say what you would check and how — name the specific query, index, and field that would settle the question — and then ask for CLI setup. An answer that names the check is useful without a cluster; one that only asks for setup is not.

Jobs to be done

  • Discover which LLM ingestion path a deployment actually uses before querying anything
  • Discover the real LLM field names in this deployment, because GenAI attribute naming is not consistent
  • Report LLM latency, throughput, and error rate by model, service, or time
  • Report token utilization, and report cost only when a cost field genuinely exists
  • Investigate response quality: failures, timeouts, finish reasons, content filters, and guardrail events
  • Reconstruct agentic call chains and find the bottleneck span in a multi-step workflow
  • Correlate findings with SLOs and alerting rules defined on LLM-related data

Output discipline

Applies to every response produced under this skill.

  • Commit to the best-supported conclusion. When the evidence points one way, say so. Do not downgrade confidence to sound cautious — hedging on unambiguous evidence is a defect, not humility.
  • State confidence once, in the conclusion. Do not restate it per bullet.
  • Do not speculate past the evidence. If a cause was not observed, it does not go in the answer. Say what is unknown and stop.
  • Report absence as absence. Zero rows means the data is missing or not collected; it never means the underlying condition is healthy. In particular, if no cost field exists, say cost is not instrumented — do not multiply token counts by a guessed per-token price and present the product as a cost figure.
  • Report the numbers actually found. Quote the token counts, latencies, and error rates the query returned. Do not round them into vague characterizations, and do not carry forward a number from an example in this skill.
  • Do not pad. No restating the question, no narrating which queries were run unless the result mattered, no summarizing the summary.
  • End on the finding. No trailing offers such as "want me to dig deeper?". Actionable follow-ups belong in a recommendations list, phrased as recommendations, not as questions.

Where the data lives

Ingestion pathIndex patternsWhat it can answer
OTel / EDOT traces via OTLPtraces-*.otel-*, or the generic traces-*Per-request latency, tokens, models, finish reasons, and call chains
Elastic APM agent tracestraces-apm*, or the generic traces-*Per-request latency and outcome; GenAI attributes if the SDK adds them
APM/OTel metricsmetrics-apm*, metrics-*.otel-*Aggregated service-level rates and latencies
Elastic LLM integration metricsmetrics-<integration>.* (for example metrics-aws_bedrock_agentcore.*)Aggregate token counts, invocations, latency, sometimes cost
Elastic LLM integration logslogs-<integration>.*Prompt/response records, guardrail and content-filter events

Use the generic traces-* pattern to find trace data regardless of whether an Elastic APM agent or OpenTelemetry collected it. Instrumentation can come from EDOT, OpenLLMetry, OpenLIT, or Langtrace exporting to OTLP — all of them land LLM and agent spans in the trace data streams.

Only traces can reconstruct a call chain. trace.id, span.id, and parent.id are the only way to rebuild an agentic call chain. Integration metrics are pre-aggregated and cannot do it — if the question is about orchestration and only integration metrics exist, say the chain cannot be reconstructed from the available data.

Background reading: LLM and agentic AI observability, EDOT LLM use cases, Observability Labs — LLM Observability.

Process: determine what data is available

Run these in order. Do not skip to step 5.

  1. Verify the connection and detect the version. Call GET /. The decision this drives is which query language surface is available: build_flavor: "serverless" means all ES|QL features including TS, TRANGE, and TBUCKET are available. Otherwise use version.number: on Stack, TS is preview in 9.2 and GA in 9.4, and TRANGE is GA in 9.3.0, so treat Stack 9.4 as the floor for the whole time-series path and fall back to FROM with BUCKET(@timestamp, ...) below it. Getting this wrong produces a query that fails to parse.

  2. Determine which ingestion paths exist. The decision is whether this deployment has traces, integration data, or both — and it changes which questions are answerable at all. List data streams with GET /_data_stream/<name> (pass traces-*, metrics-*, logs-*) or resolve patterns with GET /_resolve/index/<pattern>. Look for trace data streams, metrics-apm*, and any metrics-* or logs-* matching a known LLM integration dataset. If neither path has LLM data, say so and stop — do not answer from general knowledge about the model provider.

  3. Discover the real LLM field names. The decision is which exact field paths to write into ES|QL, and it cannot be guessed. Naming differs across instrumentations: gen_ai.* versus llm.* versus integration-specific names, and the semantic conventions themselves have shifted (older instrumentation emits gen_ai.system, newer emits gen_ai.provider.name). Use GET /_field_caps with a field pattern such as *gen_ai*, *llm*, *token*, *cost*, or read GET /<index>/_mapping, then sample a document to confirm the values are populated. Attribute nesting differs by ingestion path — OTel-native trace data streams expose span attributes as attributes.<name> (and often as a bare passthrough <name>), not as span.attributes.<name>. Confirm which form resolves before writing a query. See references/genai-fields.md for the attribute catalog and the resolution rules.

  4. Decide whether a cost field exists. Cost is not part of the OpenTelemetry GenAI specification. Some instrumentations add a custom attribute such as llm.response.cost.usd_estimate, and some integrations expose a cost metric, but many deployments have neither. Look for it explicitly in step 3. If it is absent, the answer to a cost question is that cost is not instrumented — report token counts instead and name the gap.

  5. Choose ONE consistent source per question. When both APM traces and integration metrics exist, pick one and use it for the whole answer. Mixing them double-counts and produces two different numbers for the same quantity, because the integration polls the provider's own accounting while the traces record what the client observed. Route by question type: traces for per-request analysis, call chains, and anything needing a trace hierarchy; integration metrics for aggregate token and cost totals over long windows. State which source the answer came from.

  6. Check alerts and SLOs when relevance is plausible. The decision is whether a degradation is already known and tracked. Find rules with GET kbn:/api/alerting/rules/_find and SLOs with GET kbn:/api/observability/slos, then filter to those targeting LLM-related services or integration metrics — the field names from step 3 tell you which rules are related. Firing alerts, or SLOs in violated or degrading status, are evidence of degraded performance. Note that the SLO API's sli.kql.custom indicator takes KQL rather than ES|QL; that is an API contract, not a recommendation to use KQL elsewhere.

Use cases and query patterns

Write queries with POST /_query. Always bound the time range, add service.name when present, and LIMIT results. Use coarse buckets when only a trend is needed rather than scanning a wide window at fine granularity.

QuestionTraces pathIntegration path
Latency, throughput, error rateFilter on the GenAI operation or model attribute; COUNT(*) per bucket, AVG(span.duration.us), and failures via event.outcome == "failure"Request-rate, latency, and error metrics by model dimension
Tokens and costSUM the input and output token attributes by time, model, or service; add a cost attribute only if one existsToken and cost metrics aggregated by time and model
Response quality and safetyevent.outcome, error.type, and the finish-reason attribute; prompts and responses only if captured and not redactedGuardrail blocks, content-filter events, and policy violations
Call chaining and orchestrationTraces only — group by trace.id, walk parent.id to span.id, aggregate by span name or GenAI operationNot answerable — metrics are pre-aggregated

On the trace path, per-span latency comes from duration (nanoseconds, populated on every OTel-native span) or span.duration.us (microseconds, an APM-compatibility field that is null on many spans — sorting on it can silently drop the slowest step). Confirm which is populated before using it. The slowest child span is the bottleneck. Aggregating by span name or the GenAI operation attribute shows the distribution of step types across a workflow — retrieval, LLM call, tool use.

For integration-specific data streams and field names — OpenAI, Azure OpenAI, Azure AI Foundry, Amazon Bedrock, Bedrock AgentCore, GCP Vertex AI — see references/integrations.md. For longer worked queries including the trace-hierarchy walk and the time-series integration pattern, see references/esql-recipes.md.

Examples

The field paths below are illustrative. Confirm the real paths from step 3 before running anything — this skill's own method is to discover field names first, and the correct nesting depends on the ingestion path.

"How many tokens are we burning per model?" — confirm the token attributes exist and resolve, then sum them by model and time bucket. Report the totals returned:

esql
FROM traces-*
| WHERE @timestamp > NOW() - 24 hours AND attributes.gen_ai.request.model IS NOT NULL
| EVAL in_tok = TO_LONG(attributes.gen_ai.usage.input_tokens),
       out_tok = TO_LONG(attributes.gen_ai.usage.output_tokens)
| STATS input_tokens = SUM(in_tok), output_tokens = SUM(out_tok)
    BY hour = BUCKET(@timestamp, 1 hour), attributes.gen_ai.request.model
| SORT hour
| LIMIT 500

"What is our LLM spend?" — look for a cost field with GET /_field_caps on *cost* before querying. If none exists, report token utilization and state plainly that cost is not instrumented in this deployment; adding a cost attribute at the instrumentation layer, or enabling an integration that reports cost, is the fix. Do not multiply tokens by a price you assumed.

"Which model is slowest, and is it failing?" — latency and error rate in one pass, grouped by model:

esql
FROM traces-*
| WHERE @timestamp > NOW() - 24 hours AND attributes.gen_ai.request.model IS NOT NULL
| STATS request_count = COUNT(*),
        failures = COUNT(*) WHERE event.outcome == "failure",
        avg_duration_us = AVG(span.duration.us)
    BY attributes.gen_ai.request.model
| EVAL error_rate = failures::double / request_count
| SORT avg_duration_us DESC
| LIMIT 100

"Why is our agent slow?" — this needs the trace hierarchy, so it requires trace data. Find the traces containing more than one LLM or tool span, ranked by time spent in those spans, then walk into the worst trace by trace.id to find the bottleneck span. Because the WHERE restricts to LLM spans, the sum below is LLM time, not end-to-end trace duration — name the column so it cannot be misread as wall-clock latency:

esql
FROM traces-*
| WHERE @timestamp > NOW() - 3 hours AND attributes.gen_ai.operation.name IS NOT NULL
| STATS llm_span_count = COUNT(*), llm_duration_us = SUM(span.duration.us) BY trace.id
| WHERE llm_span_count > 1
| SORT llm_duration_us DESC
| LIMIT 50

"Are prompts getting blocked?" — check the finish-reason attribute and error.type on the trace path, or the integration's guardrail log events. A finish reason such as a content filter is a quality signal, not a transport error.

"Is there anything already alerting on this?" — GET kbn:/api/alerting/rules/_find and GET kbn:/api/observability/slos, filtered to the LLM-related services or integration metrics identified in step 2.

Guidelines

  • Answer only from data ingested into Elastic. Do not describe or rely on other vendors' UIs, consoles, or products. If the data is not in Elastic, the answer is that it is not in Elastic.
  • Discover before querying. Confirm the ingestion path (step 2) and the field names (step 3) from GET /_field_caps, GET /<index>/_mapping, or a sample document. Never guess an attribute path.
  • One consistent source per question. Do not blend APM traces and integration metrics in a single answer.
  • Cost is not in the GenAI spec. Treat a cost figure as available only when a cost field is present in the data.
  • Only traces reconstruct chains. If the question is about agentic orchestration and only integration metrics exist, say the chain is not reconstructable rather than approximating it from aggregates.
  • Gate time-series syntax on the version. Use TS with TRANGE and TBUCKET on Serverless or Stack 9.4+; fall back to FROM with BUCKET(@timestamp, ...) below that. Alias the bucket (BY bucket = TBUCKET(1 hour)) and sort on the alias.
  • Expect type conflicts on dynamically mapped attributes. Token attributes are frequently mapped as integer in one backing index and long in another after a rollover, which makes ES|QL refuse the field. Cast with TO_LONG(...) in an EVAL before aggregating.
  • No Kibana UI dependency. Prefer ES|QL and Elasticsearch APIs; use Kibana APIs only for SLOs and alerting. Never instruct the user to open the Kibana UI.
  • For ES|QL syntax and query patterns use the elasticsearch-esql skill; the TS command reference applies on Stack 9.4+ and Serverless, and the FROM command reference applies elsewhere.

Operations

HTTP API (shorthand)elastic CLI command
GET /elastic es info
GET /_data_stream/<name>elastic es indices get-data-stream --name '<name>'
GET /_resolve/index/<pattern>elastic es indices resolve-index --name '<pattern>'
GET /<index>/_mappingelastic es indices get-mapping --index '<index>'
GET /_field_capselastic es field-caps --index '<index>' --fields '<fields>'
POST /_queryelastic es esql query --format tsv --query '<esql>'
GET kbn:/api/alerting/rules/_findelastic kb alerting get-alerting-rules-find --filter '<filter>'
GET kbn:/api/observability/sloselastic kb slo find-slos-op --space-id '<space>' --kql-query '<kql>'

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Observability Llm Obs làm được gì?

Answer questions about LLM and agentic-application behavior from data already ingested into Elastic: latency and error rate, token and cost utilization, response quality and guardrail events, and agentic call-chain orchestration. Use when the user asks about LLM monitoring, GenAI observability, token spend or AI cost, model latency, prompt or guardrail failures, or how an agent's tool-call chain executed.

Vì sao nên dùng Observability Llm Obs trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Observability Llm Obs là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Observability Llm Obs trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/elastic/agent-skills/tree/main/plugins/observability/skills/llm-obs. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Observability Llm Obs?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Observability Llm Obs với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Observability Llm Obs với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Observability Llm Obs có miễn phí không?

Có. Kỹ năng này được elastic phát hành trên GitHub theo giấy phép Apache-2.0. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇