Skip to content

[9.3] [Obs AI] Extend get_services tool and add get_trace_metrics tool (#247474) | [Obs AI] Replace get_data_sources with get_index_info tool (#248234)#249116

Merged
sorenlouv merged 8 commits intoelastic:9.3from
sorenlouv:backport/9.3/pr-247474_pr-248234
Jan 16, 2026

Conversation

@sorenlouv
Copy link
Member

viduni94 and others added 2 commits January 14, 2026 23:36
…lastic#247474)

Closes elastic/obs-ai-team#427
Closes elastic/obs-ai-team#409

This PR includes the following changes

1. Extend the `get_services` tool to retrieve services from logs and
metrics.
2. Adds a new tool to retrieve RED metrics for services -
`get_trace_metrics`
3. Allows drilling down into a particular service for further
investigation

Differences between the 2 tools:

Tool | get_services | get_trace_metrics
-- | -- | --
Purpose | High-level overview of all services | Detailed drill-down
into specific services
Data Sources | APM, Logs, and Metrics | APM only (RED/trace metrics can
be obtained only for APM services)
Filtering | By environment, health status | By KQL filter (any field)
Grouping | Fixed (by service) | Flexible (by transaction, host,
container, etc.)
Transaction Types | Includes only the primary transaction type (the
transaction type with the higher throughput) | Includes all transaction
types

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

_Cursor + Claude-4.5-Opus-High was used in this PR_

---------

Co-authored-by: Arturo Lidueña <arturo.liduena@elastic.co>
(cherry picked from commit c8f30f8)
…ic#248234)

Closes elastic/obs-ai-team#455

This PR introduces the `get_index_info` tool which replaces
`get_data_sources` and adds field discovery capabilities. This is
similar to the `get_dataset_info` tool we have for Obs AI Assistant.

The tool has three operations:

**`get_index_info({ operation: "get-overview" })`**
Returns the same data sources as `get_data_sources` (APM indices, logs,
metrics, alerts) plus a list of curated observability fields that exist
in the cluster. Each field includes a `schema` indicator (`ecs`, `otel`,
or `internal`).

**`get_index_info({ operation: "list-fields", index, start?, end?,
kqlFilter?, intent? })`**
Returns fields with actual data. If the LLM specifies an `intent` and
there are >100 fields, we filter them using a model to just the relevant
ones.

**`get_index_info({ operation: "get-field-values", index, fields })`**
Returns field values:
- Distinct values for keyword fields
- Min/max ranges for numeric and date fields

The LLM needs to know what fields exist in the user's cluster before
building queries. Without this, it guesses field names which leads to
invalid filters and confusing errors. This is especially important
because customers can use different schemas (ECS vs OTel).

Run the synthtrace scenario to populate observability indices with test
data:

```bash
node scripts/synthtrace \
  src/platform/packages/shared/kbn-synthtrace/src/scenarios/agent_builder/tools/get_index_info/curated_fields.ts \
  --from "now-15m" --to "now" --clean --workers=1
```

```
POST kbn:///api/agent_builder/tools/_execute
{
  "tool_id": "observability.get_index_info",
  "tool_params": { "operation": "get-overview" }
}
```

```
POST kbn:///api/agent_builder/tools/_execute
{
  "tool_id": "observability.get_index_info",
  "tool_params": { "operation": "get-field-values", "index": "metrics-*", "fields": "host.name" }
}
```

(cherry picked from commit b6be8eb)
@sorenlouv sorenlouv added the backport This PR is a backport of another PR label Jan 14, 2026
@sorenlouv sorenlouv enabled auto-merge (squash) January 14, 2026 22:37
@botelastic botelastic bot added the Team:obs-presentation Focus: APM UI, Infra UI, Hosts UI, Universal Profiling, Obs Overview and left Navigation label Jan 14, 2026
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-presentation-team (Team:obs-presentation)

@sorenlouv sorenlouv merged commit 0bdd87c into elastic:9.3 Jan 16, 2026
13 checks passed
@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #77 / cloud_security_posture GET /internal/cloud_security_posture/benchmark "before each" hook for "Should return non-empty array filled with Rules if user has CSP integrations"
  • [job] [logs] FTR Configs #42 / console app console autocomplete feature Autocomplete shouldnt trigger within a multiline block comment

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/synthtrace 149 164 +15
Unknown metric groups

API count

id before after diff
@kbn/synthtrace 165 188 +23

History

@sorenlouv sorenlouv deleted the backport/9.3/pr-247474_pr-248234 branch January 16, 2026 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR Team:obs-presentation Focus: APM UI, Infra UI, Hosts UI, Universal Profiling, Obs Overview and left Navigation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants