Skip to content

[kbn-evals] Fix APM/OTel tracing conflict and inference endpoint connector resolution#259446

Merged
viduni94 merged 9 commits intoelastic:mainfrom
viduni94:fix-kbn-evals
Mar 25, 2026
Merged

[kbn-evals] Fix APM/OTel tracing conflict and inference endpoint connector resolution#259446
viduni94 merged 9 commits intoelastic:mainfrom
viduni94:fix-kbn-evals

Conversation

@viduni94
Copy link
Copy Markdown
Contributor

@viduni94 viduni94 commented Mar 24, 2026

Closes #259472

Summary

Fixes two issues breaking kbn-evals runs (both local and CI):

1. APM / OpenTelemetry tracing conflict

A recent validation in initTelemetry (#258303, #258663) throws when Elastic APM and OpenTelemetry tracing are both active. The evals_tracing Scout config enables OTel tracing but didn't explicitly disable APM, causing Kibana (and the Playwright worker) to crash on startup.

Fix:

  • Added a coerceCliValue helper in applyConfigOverrides (kbn-apm-config-loader) that converts 'true'/'false' to booleans and numeric strings to numbers before they're set in the config object.
  • Added --elastic.apm.active=false and --elastic.apm.contextPropagationOnly=false to the evals_tracing Scout server config and to require_init_apm.js (for the Playwright worker when TRACING_EXPORTERS is set).
  • Updated the kbn-evals README to document the required APM settings when configuring tracing in kibana.dev.yml.

2. Inference endpoint connector resolution

#258530 consolidated LLM connector listing through the inference plugin's getConnectorList(), which now returns inference endpoint IDs (e.g.: .anthropic-claude-4.6-opus-chat_completion) instead of Kibana stack connector keys (e.g.: elastic-llm-claude-46-opus). kbn-evals was still passing the stack connector key to the inference API, which then tried to execute it as a Kibana action - resulting in "Saved object [action/.anthropic-claude-4.6-opus-chat_completion] not found".

Fix:

  • createConnectorFixture now detects .inference-type connectors and extracts their inferenceId from the config, using the ES inference endpoint ID directly. This bypasses the Kibana actions framework and aligns with the unified connector model from #258530.

Checklist

  • Unit or functional tests were updated or added to match the most common scenarios
  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines
  • Review the backport guidelines and apply applicable backport:* labels.

@viduni94 viduni94 self-assigned this Mar 24, 2026
@viduni94 viduni94 added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting Team:obs-ai Observability AI team labels Mar 24, 2026
@viduni94 viduni94 requested review from a team and vigneshshanmugam as code owners March 24, 2026 18:45
@elasticmachine
Copy link
Copy Markdown
Contributor

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

@viduni94 viduni94 changed the title Fix APM/OTel tracing conflict and inference endpoint connector resolu… [kbn-evals] Fix APM/OTel tracing conflict and inference endpoint connector resolution Mar 24, 2026
Comment on lines +378 to +379
elastic.apm.active: false
elastic.apm.contextPropagationOnly: false
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some additional doc references we'll probably want to update along with this one:

  1. This file:
  • Lines ~356-358 — the "configure the HTTP exporter in kibana.dev.yml" block only shows exporters, but the note about APM flags is added nearby (good).
  • Lines ~423-434 — the trace-based evaluators prerequisite section also shows exporter config without APM flags.
    These should either include the flags or cross-reference the note about them.
  1. Evals plugin readme: x-pack/platform/plugins/shared/evals/README.md

Missing elastic.apm.active: false and elastic.apm.contextPropagationOnly: false before the telemetry lines. Users following this README to configure their kibana.dev.yml will hit the same APM/OTel conflict.

  1. Agent Builder readme: x-pack/platform/plugins/shared/agent_builder/README.md

First example on lines 21-28 and the second example at lines 38-44. Neither snippet includes the APM-disable flags. Users enabling tracing for agent_builder will hit the same conflict.

  1. Entity Analytics readme: kbn-evals-suite-entity-analytics/README.md

This config is contradictory -- it sets sample_rate and exporters but disables tracing. This looks like an oversight and should probably enable tracing (in which case it also needs the APM flags). Not our config, but might as well cleanup. cc @ymao1

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @spong
Updated here - 751b67c

Copy link
Copy Markdown
Member

@spong spong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code reviewed and LGTM! 👍 Thanks for these fixes @viduni94 🙏

Left one comment about some further documentation updates if you don't mind, and also confirmed the new Scout server config fix propagates to all 11 eval suites, so that all LGTM.

@viduni94 viduni94 requested review from a team as code owners March 24, 2026 21:46
@viduni94 viduni94 requested a review from tiansivive March 24, 2026 21:46
@viduni94
Copy link
Copy Markdown
Contributor Author

Code reviewed and LGTM! 👍 Thanks for these fixes @viduni94 🙏

Thanks @spong

Left one comment about some further documentation updates if you don't mind

Yes, of course. I updated them

and also confirmed the new Scout server config fix propagates to all 11 eval suites, so that all LGTM.

Thank you 🙏🏻

@viduni94 viduni94 enabled auto-merge (squash) March 24, 2026 23:35
@viduni94 viduni94 disabled auto-merge March 24, 2026 23:35
@viduni94 viduni94 enabled auto-merge (squash) March 24, 2026 23:35
@viduni94 viduni94 added (deprecated) evals:streams-sigevents This label is deprecated. Use `evals:significant-events` to run the Significant Events eval suite. models:judge:eis/google-gemini-3.1-pro Override LLM-as-a-judge connector for evals: eis/google-gemini-3.1-pro models:weekly-eis-models Run evals against the weekly EIS model set (see eval_pipeline.ts) labels Mar 24, 2026
@viduni94
Copy link
Copy Markdown
Contributor Author

@spong @csr I had to push 2 more fixes to override env variables to disable APM

Thank you

Let me know whether these look okay to you. With these fixes, the evals are running without any config errors.

Comment on lines +26 to +27
// CI sets ELASTIC_APM_ACTIVE=true globally. The APM config loader merges env vars
// after Kibana config (CLI args), so the env var would override our --elastic.apm.active=false.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL, thank you!

@viduni94 viduni94 removed (deprecated) evals:streams-sigevents This label is deprecated. Use `evals:significant-events` to run the Significant Events eval suite. models:judge:eis/google-gemini-3.1-pro Override LLM-as-a-judge connector for evals: eis/google-gemini-3.1-pro models:weekly-eis-models Run evals against the weekly EIS model set (see eval_pipeline.ts) labels Mar 25, 2026
Copy link
Copy Markdown
Member

@csr csr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recent custom servers config changes LGTM

@viduni94 viduni94 enabled auto-merge (squash) March 25, 2026 16:04
}
}

// .inference connectors are backed by ES inference endpoints.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is okay for now, but the better solution would be to adapt use to accept both. We shouldn't need to do this transformation, as the inference plugin should accept both connector Ids and inference Ids. If they don't then that's a bug we need to address on the inference plugin.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @sphilipse
My initial thought was to add the fix here -

: async () => {
const executor = await getInferenceExecutor({
connectorId,
request,
actions,
esClient,
logger,
});
const connector = executor.getConnector();
const connectorType = connector.type;
const inferenceAdapter = getInferenceAdapter(connectorType);
if (!inferenceAdapter) {
throw createInferenceRequestError(
`Adapter for type ${connectorType} not implemented`,
400
);
}
return {
callbackContext: {
model: {
family: getConnectorFamily(connector),
provider: getConnectorProvider(connector),
id: getConnectorDefaultModel(connector),
},
},
getSpanModel: (modelName) => ({
id: modelName ?? getConnectorDefaultModel(connector),
family: getConnectorFamily(connector),
provider: getConnectorProvider(connector),
}),
chatComplete: (options) => inferenceAdapter.chatComplete({ ...options, executor }),
};
};

(But wasn't sure whether that would affect anything else as we are moving away of from stack connectors AFAIK)

The problem flow was:

  • resolveAndCreatePipeline checks endpointIdCache.has('elastic-llm-claude-46-opus')false (cache only has ES endpoint IDs)
  • Falls into the stack-connector path, calls getInferenceExecutor
  • Inside, getConnectorById resolves the stack connector to an inference endpoint with connectorId: '.anthropic-claude-4.6-opus-chat_completion' and isInferenceEndpoint: true
  • But createInferenceExecutor still calls actionsClient.execute() with the endpoint ID → "Saved object not found"

Proposed fix:

: async () => {
    const executor = await getInferenceExecutor({
      connectorId,
      request,
      actions,
      esClient,
      logger,
    });
    const connector = executor.getConnector();
    // If the stack connector resolved to an inference endpoint,
    // use the endpoint executor instead of the actions-based one.
    if (connector.isInferenceEndpoint) {
      const inferenceId = connector.connectorId;
      const endpointMeta = await resolveInferenceEndpoint({ inferenceId, esClient });
      const endpointExecutor = createInferenceEndpointExecutor({ inferenceId, esClient });
      return {
        callbackContext: {
          model: endpointMeta.modelId ? { id: endpointMeta.modelId } : undefined,
        },
        getSpanModel: (modelName) =>
          endpointMeta.provider
            ? { id: modelName ?? endpointMeta.modelId, provider: endpointMeta.provider }
            : undefined,
        chatComplete: (options) =>
          inferenceEndpointAdapter.chatComplete({ ...options, executor: endpointExecutor }),
      };
    }

    // ... rest of existing stack connector logic

Does this make sense to you? Or do you have any suggestions to resolve it in a better way?
Appreciate any thoughts 🙏🏻

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think this makes sense! Thanks @viduni94, you caught a bug for us :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @sphilipse
I'll open a follow up PR with the fix.

@viduni94
Copy link
Copy Markdown
Contributor Author

/ci

@viduni94
Copy link
Copy Markdown
Contributor Author

run docs-build

@viduni94
Copy link
Copy Markdown
Contributor Author

/sync-ci

@viduni94 viduni94 merged commit 149ebc8 into elastic:main Mar 25, 2026
16 checks passed
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

cc @viduni94

jeramysoucy pushed a commit to jeramysoucy/kibana that referenced this pull request Mar 26, 2026
…ector resolution (elastic#259446)

Closes elastic#259472

## Summary

Fixes two issues breaking `kbn-evals` runs (both local and CI):

### 1. APM / OpenTelemetry tracing conflict
A recent validation in `initTelemetry`
(elastic#258303,
elastic#258663) throws when Elastic APM
and OpenTelemetry tracing are both active. The `evals_tracing` Scout
config enables OTel tracing but didn't explicitly disable APM, causing
Kibana (and the Playwright worker) to crash on startup.

Fix:
- Added a `coerceCliValue` helper in `applyConfigOverrides`
(`kbn-apm-config-loader`) that converts 'true'/'false' to booleans and
numeric strings to numbers before they're set in the config object.
- Added `--elastic.apm.active=false` and
`--elastic.apm.contextPropagationOnly=false` to the `evals_tracing`
Scout server config and to `require_init_apm.js` (for the Playwright
worker when `TRACING_EXPORTERS` is set).
- Updated the `kbn-evals` README to document the required APM settings
when configuring tracing in `kibana.dev.yml`.

### 2. Inference endpoint connector resolution
elastic#258530 consolidated LLM connector
listing through the inference plugin's `getConnectorList()`, which now
returns inference endpoint IDs (e.g.:
`.anthropic-claude-4.6-opus-chat_completion`) instead of Kibana stack
connector keys (e.g.: `elastic-llm-claude-46-opus`). `kbn-evals` was
still passing the stack connector key to the inference API, which then
tried to execute it as a Kibana action - resulting in "Saved object
`[action/.anthropic-claude-4.6-opus-chat_completion]` not found".

Fix:
- `createConnectorFixture` now detects `.inference-type` connectors and
extracts their `inferenceId` from the config, using the ES inference
endpoint ID directly. This bypasses the Kibana actions framework and
aligns with the unified connector model from
[elastic#258530](elastic#258530).

### Checklist

- [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.
markov00 pushed a commit to markov00/kibana that referenced this pull request Mar 26, 2026
…ector resolution (elastic#259446)

Closes elastic#259472

## Summary

Fixes two issues breaking `kbn-evals` runs (both local and CI):

### 1. APM / OpenTelemetry tracing conflict
A recent validation in `initTelemetry`
(elastic#258303,
elastic#258663) throws when Elastic APM
and OpenTelemetry tracing are both active. The `evals_tracing` Scout
config enables OTel tracing but didn't explicitly disable APM, causing
Kibana (and the Playwright worker) to crash on startup.

Fix:
- Added a `coerceCliValue` helper in `applyConfigOverrides`
(`kbn-apm-config-loader`) that converts 'true'/'false' to booleans and
numeric strings to numbers before they're set in the config object.
- Added `--elastic.apm.active=false` and
`--elastic.apm.contextPropagationOnly=false` to the `evals_tracing`
Scout server config and to `require_init_apm.js` (for the Playwright
worker when `TRACING_EXPORTERS` is set).
- Updated the `kbn-evals` README to document the required APM settings
when configuring tracing in `kibana.dev.yml`.

### 2. Inference endpoint connector resolution
elastic#258530 consolidated LLM connector
listing through the inference plugin's `getConnectorList()`, which now
returns inference endpoint IDs (e.g.:
`.anthropic-claude-4.6-opus-chat_completion`) instead of Kibana stack
connector keys (e.g.: `elastic-llm-claude-46-opus`). `kbn-evals` was
still passing the stack connector key to the inference API, which then
tried to execute it as a Kibana action - resulting in "Saved object
`[action/.anthropic-claude-4.6-opus-chat_completion]` not found".

Fix:
- `createConnectorFixture` now detects `.inference-type` connectors and
extracts their `inferenceId` from the config, using the ES inference
endpoint ID directly. This bypasses the Kibana actions framework and
aligns with the unified connector model from
[elastic#258530](elastic#258530).

### Checklist

- [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.
viduni94 added a commit that referenced this pull request Mar 26, 2026
…oints (#259656)

Closes #259641

## Summary

When a stack connector ID (e.g.: a preconfigured `.inference` connector)
is passed to the inference plugin's `chatComplete` API,
`getConnectorById` may resolve it to an `InferenceConnector` with
`isInferenceEndpoint: true`. Previously, `resolveAndCreatePipeline` only
checked the `endpointIdCache` to decide whether to use the inference
endpoint execution path. If the cache didn't contain the ID, it fell
through to the stack connector adapter path, which then failed because
there's no adapter for the .inference connector type.

This caused a `Saved object [action/<inference-endpoint-id>] not found`
error when callers (e.g.: `kbn-evals`) passed preconfigured `.inference`
connector IDs, because the code attempted to execute the ES inference
endpoint ID as a Kibana saved-object action.

### Changes
- `callback_api.ts`: After `getInferenceExecutor` resolves the connector
in the stack connector branch, check `connector.isInferenceEndpoint`. If
true, redirect to the inference endpoint execution path
(`resolveInferenceEndpoint` + `createInferenceEndpointExecutor` +
`inferenceEndpointAdapter`).
- `api.test.ts`: Added tests covering the "stack connector resolving to
inference endpoint" path.
- `create_connector_fixture.ts` (`kbn-evals`): Removed the client-side
workaround that was extracting inferenceId from `.inference` connectors
- no longer needed now that the inference plugin handles this
server-side.
- `create_connector_fixture.test.ts`: Removed corresponding workaround
tests.

## Related
- #258530 introduced unified connector listing via
`getConnectorList()`/`getConnectorById()`, which returns inference
endpoints with `isInferenceEndpoint: true`
- #259446 added a temporary client-side workaround in `kbn-evals` (now
removed by this PR)

### Checklist

- [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.
shahargl pushed a commit to shahargl/kibana that referenced this pull request Mar 26, 2026
…oints (elastic#259656)

Closes elastic#259641

## Summary

When a stack connector ID (e.g.: a preconfigured `.inference` connector)
is passed to the inference plugin's `chatComplete` API,
`getConnectorById` may resolve it to an `InferenceConnector` with
`isInferenceEndpoint: true`. Previously, `resolveAndCreatePipeline` only
checked the `endpointIdCache` to decide whether to use the inference
endpoint execution path. If the cache didn't contain the ID, it fell
through to the stack connector adapter path, which then failed because
there's no adapter for the .inference connector type.

This caused a `Saved object [action/<inference-endpoint-id>] not found`
error when callers (e.g.: `kbn-evals`) passed preconfigured `.inference`
connector IDs, because the code attempted to execute the ES inference
endpoint ID as a Kibana saved-object action.

### Changes
- `callback_api.ts`: After `getInferenceExecutor` resolves the connector
in the stack connector branch, check `connector.isInferenceEndpoint`. If
true, redirect to the inference endpoint execution path
(`resolveInferenceEndpoint` + `createInferenceEndpointExecutor` +
`inferenceEndpointAdapter`).
- `api.test.ts`: Added tests covering the "stack connector resolving to
inference endpoint" path.
- `create_connector_fixture.ts` (`kbn-evals`): Removed the client-side
workaround that was extracting inferenceId from `.inference` connectors
- no longer needed now that the inference plugin handles this
server-side.
- `create_connector_fixture.test.ts`: Removed corresponding workaround
tests.

## Related
- elastic#258530 introduced unified connector listing via
`getConnectorList()`/`getConnectorById()`, which returns inference
endpoints with `isInferenceEndpoint: true`
- elastic#259446 added a temporary client-side workaround in `kbn-evals` (now
removed by this PR)

### Checklist

- [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.
jeramysoucy pushed a commit to jeramysoucy/kibana that referenced this pull request Apr 1, 2026
…ector resolution (elastic#259446)

Closes elastic#259472

## Summary

Fixes two issues breaking `kbn-evals` runs (both local and CI):

### 1. APM / OpenTelemetry tracing conflict
A recent validation in `initTelemetry`
(elastic#258303,
elastic#258663) throws when Elastic APM
and OpenTelemetry tracing are both active. The `evals_tracing` Scout
config enables OTel tracing but didn't explicitly disable APM, causing
Kibana (and the Playwright worker) to crash on startup.

Fix:
- Added a `coerceCliValue` helper in `applyConfigOverrides`
(`kbn-apm-config-loader`) that converts 'true'/'false' to booleans and
numeric strings to numbers before they're set in the config object.
- Added `--elastic.apm.active=false` and
`--elastic.apm.contextPropagationOnly=false` to the `evals_tracing`
Scout server config and to `require_init_apm.js` (for the Playwright
worker when `TRACING_EXPORTERS` is set).
- Updated the `kbn-evals` README to document the required APM settings
when configuring tracing in `kibana.dev.yml`.

### 2. Inference endpoint connector resolution
elastic#258530 consolidated LLM connector
listing through the inference plugin's `getConnectorList()`, which now
returns inference endpoint IDs (e.g.:
`.anthropic-claude-4.6-opus-chat_completion`) instead of Kibana stack
connector keys (e.g.: `elastic-llm-claude-46-opus`). `kbn-evals` was
still passing the stack connector key to the inference API, which then
tried to execute it as a Kibana action - resulting in "Saved object
`[action/.anthropic-claude-4.6-opus-chat_completion]` not found".

Fix:
- `createConnectorFixture` now detects `.inference-type` connectors and
extracts their `inferenceId` from the config, using the ES inference
endpoint ID directly. This bypasses the Kibana actions framework and
aligns with the unified connector model from
[elastic#258530](elastic#258530).

### Checklist

- [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.
jeramysoucy pushed a commit to jeramysoucy/kibana that referenced this pull request Apr 1, 2026
…oints (elastic#259656)

Closes elastic#259641

## Summary

When a stack connector ID (e.g.: a preconfigured `.inference` connector)
is passed to the inference plugin's `chatComplete` API,
`getConnectorById` may resolve it to an `InferenceConnector` with
`isInferenceEndpoint: true`. Previously, `resolveAndCreatePipeline` only
checked the `endpointIdCache` to decide whether to use the inference
endpoint execution path. If the cache didn't contain the ID, it fell
through to the stack connector adapter path, which then failed because
there's no adapter for the .inference connector type.

This caused a `Saved object [action/<inference-endpoint-id>] not found`
error when callers (e.g.: `kbn-evals`) passed preconfigured `.inference`
connector IDs, because the code attempted to execute the ES inference
endpoint ID as a Kibana saved-object action.

### Changes
- `callback_api.ts`: After `getInferenceExecutor` resolves the connector
in the stack connector branch, check `connector.isInferenceEndpoint`. If
true, redirect to the inference endpoint execution path
(`resolveInferenceEndpoint` + `createInferenceEndpointExecutor` +
`inferenceEndpointAdapter`).
- `api.test.ts`: Added tests covering the "stack connector resolving to
inference endpoint" path.
- `create_connector_fixture.ts` (`kbn-evals`): Removed the client-side
workaround that was extracting inferenceId from `.inference` connectors
- no longer needed now that the inference plugin handles this
server-side.
- `create_connector_fixture.test.ts`: Removed corresponding workaround
tests.

## Related
- elastic#258530 introduced unified connector listing via
`getConnectorList()`/`getConnectorById()`, which returns inference
endpoints with `isInferenceEndpoint: true`
- elastic#259446 added a temporary client-side workaround in `kbn-evals` (now
removed by this PR)

### Checklist

- [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.
paulinashakirova pushed a commit to paulinashakirova/kibana that referenced this pull request Apr 2, 2026
…ector resolution (elastic#259446)

Closes elastic#259472

## Summary

Fixes two issues breaking `kbn-evals` runs (both local and CI):

### 1. APM / OpenTelemetry tracing conflict
A recent validation in `initTelemetry`
(elastic#258303,
elastic#258663) throws when Elastic APM
and OpenTelemetry tracing are both active. The `evals_tracing` Scout
config enables OTel tracing but didn't explicitly disable APM, causing
Kibana (and the Playwright worker) to crash on startup.

Fix:
- Added a `coerceCliValue` helper in `applyConfigOverrides`
(`kbn-apm-config-loader`) that converts 'true'/'false' to booleans and
numeric strings to numbers before they're set in the config object.
- Added `--elastic.apm.active=false` and
`--elastic.apm.contextPropagationOnly=false` to the `evals_tracing`
Scout server config and to `require_init_apm.js` (for the Playwright
worker when `TRACING_EXPORTERS` is set).
- Updated the `kbn-evals` README to document the required APM settings
when configuring tracing in `kibana.dev.yml`.

### 2. Inference endpoint connector resolution
elastic#258530 consolidated LLM connector
listing through the inference plugin's `getConnectorList()`, which now
returns inference endpoint IDs (e.g.:
`.anthropic-claude-4.6-opus-chat_completion`) instead of Kibana stack
connector keys (e.g.: `elastic-llm-claude-46-opus`). `kbn-evals` was
still passing the stack connector key to the inference API, which then
tried to execute it as a Kibana action - resulting in "Saved object
`[action/.anthropic-claude-4.6-opus-chat_completion]` not found".

Fix:
- `createConnectorFixture` now detects `.inference-type` connectors and
extracts their `inferenceId` from the config, using the ES inference
endpoint ID directly. This bypasses the Kibana actions framework and
aligns with the unified connector model from
[elastic#258530](elastic#258530).

### Checklist

- [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.
paulinashakirova pushed a commit to paulinashakirova/kibana that referenced this pull request Apr 2, 2026
…oints (elastic#259656)

Closes elastic#259641

## Summary

When a stack connector ID (e.g.: a preconfigured `.inference` connector)
is passed to the inference plugin's `chatComplete` API,
`getConnectorById` may resolve it to an `InferenceConnector` with
`isInferenceEndpoint: true`. Previously, `resolveAndCreatePipeline` only
checked the `endpointIdCache` to decide whether to use the inference
endpoint execution path. If the cache didn't contain the ID, it fell
through to the stack connector adapter path, which then failed because
there's no adapter for the .inference connector type.

This caused a `Saved object [action/<inference-endpoint-id>] not found`
error when callers (e.g.: `kbn-evals`) passed preconfigured `.inference`
connector IDs, because the code attempted to execute the ES inference
endpoint ID as a Kibana saved-object action.

### Changes
- `callback_api.ts`: After `getInferenceExecutor` resolves the connector
in the stack connector branch, check `connector.isInferenceEndpoint`. If
true, redirect to the inference endpoint execution path
(`resolveInferenceEndpoint` + `createInferenceEndpointExecutor` +
`inferenceEndpointAdapter`).
- `api.test.ts`: Added tests covering the "stack connector resolving to
inference endpoint" path.
- `create_connector_fixture.ts` (`kbn-evals`): Removed the client-side
workaround that was extracting inferenceId from `.inference` connectors
- no longer needed now that the inference plugin handles this
server-side.
- `create_connector_fixture.test.ts`: Removed corresponding workaround
tests.

## Related
- elastic#258530 introduced unified connector listing via
`getConnectorList()`/`getConnectorById()`, which returns inference
endpoints with `isInferenceEndpoint: true`
- elastic#259446 added a temporary client-side workaround in `kbn-evals` (now
removed by this PR)

### Checklist

- [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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:obs-ai Observability AI team v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[kbn-evals] Evals broken on main: APM/OTel tracing conflict and inference endpoint connector resolution