Skip to content

[Discover][Traces] Add APM operation IDs to traces log fetching#268452

Merged
iblancof merged 14 commits into
elastic:mainfrom
iblancof:5348-traces-in-discover-monitor-transactions
May 12, 2026
Merged

[Discover][Traces] Add APM operation IDs to traces log fetching#268452
iblancof merged 14 commits into
elastic:mainfrom
iblancof:5348-traces-in-discover-monitor-transactions

Conversation

@iblancof
Copy link
Copy Markdown
Contributor

@iblancof iblancof commented May 8, 2026

Summary

Relates to https://github.com/elastic/observability-dev/issues/5348

This PR instruments two log-fetching code paths in the trace document viewer with APM execution context and explicit error capture, enabling RED metrics (rate, errors, duration) visibility in APM for those operations. Without operation IDs, all Kibana search requests appear identically in APM's search/ese spans with no way to attribute latency or throughput to a specific feature.

fetchLogDocumentById

fetchLogDocumentById is called when a user opens a log document from the expanded waterfall flyout. Because this function owns the data.search.search call directly, we can instrument it fully:

  • An executionContext with operation_id: fetch-log-by-id is passed to the search call. The Kibana HTTP layer forwards this via the x-kbn-context header, and the server-side APM agent attaches it as a kibana_meta_operation_id label on the resulting span.
  • The search call is wrapped in a try-catch that calls apm.captureError with the same label, so failures appear in APM with the correct operation context.
  • toasts.addDanger is replaced with toasts.add({ color: 'danger', ... }) to avoid double error capture: addDanger internally calls apm.captureError, which would produce a duplicate error event alongside ours.

Logs embeddable (TraceContextLogEvents)

The correlated logs section in the trace document overview renders via LazySavedSearchComponent, which delegates all fetching to SearchEmbeddable internally. Because we do not own the fetch call, explicit error capture is not feasible: SearchEmbeddable handles errors internally and surfaces them as inline UI state, so failures never propagate as rejections we can catch or as failed HTTP spans in APM.

For latency and throughput, we thread executionContext with operation_id: fetch-trace-context-logs from TraceContextLogEvents down through LogEventsComponent and LazySavedSearchComponent to SearchEmbeddable's parentApi. The embeddable reads execution context from parentApi and includes it in every search request, tagging those spans with kibana_meta_operation_id: fetch-trace-context-logs on the server.

This required adding executionContext as a typed prop to LogEventsProps and SavedSearchComponentProps, and declaring @kbn/core-execution-context-common in kbn_references for both affected packages.

How to test

Verify the logs embeddable span label:

  • Start Kibana with a synthtrace scenario that includes log documents correlated to a trace (e.g. node scripts/synthtrace logs_traces_hosts).
  • Open a trace document in the doc viewer and expand the Logs section.
  • In APM, filter search/ese spans by labels.kibana_meta_operation_id: fetch-trace-context-logs and confirm requests from the logs section appear with that label.

Verify the fetch log span label and error capture:

  • From the expanded waterfall, click a log item to open the log document flyout.
  • In APM, filter by labels.kibana_meta_operation_id: fetch-log-by-id and confirm the fetch span appears.
  • To test error capture: temporarily break the fetch (e.g. pass an invalid index) and confirm a single APM error appears with labels.kibana_meta_operation_id: fetch-log-by-id, not two.

@iblancof iblancof self-assigned this May 8, 2026
@iblancof iblancof requested a review from a team as a code owner May 8, 2026 14:07
@iblancof iblancof added release_note:skip Skip the PR/issue when compiling release notes backport:version Backport to applied version labels Team:obs-exploration Observability Exploration team v9.4.0 v9.5.0 labels May 8, 2026
@infra-vault-gh-plugin-prod
Copy link
Copy Markdown

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

@iblancof iblancof requested a review from a team as a code owner May 8, 2026 14:36
Copy link
Copy Markdown
Contributor

@cauemarcondes cauemarcondes left a comment

Choose a reason for hiding this comment

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

LGTM

@iblancof iblancof changed the title [Discover][Traces] Add APM operation IDs to trace log fetch spans [Discover][Traces] Add APM operation IDs to traces log fetching May 11, 2026
Copy link
Copy Markdown
Contributor

@lukasolson lukasolson left a comment

Choose a reason for hiding this comment

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

Minor notes below, LGTM!

@kibanamachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Scout Lane #8 - stateful-classic / default / local-stateful-classic - APM integration not installed but setup completed - Admin user
  • [job] [logs] Scout Lane #6 - stateful-classic / default / local-stateful-classic - Hosts Page - Flyout - Dashboards Tab
  • [job] [logs] Scout Lane #6 - stateful-classic / default / local-stateful-classic - Hosts Page - Flyout - Logs Tab
  • [job] [logs] Scout Lane #6 - stateful-classic / default / local-stateful-classic - Hosts Page - Flyout - Metadata Tab
  • [job] [logs] Scout Lane #6 - stateful-classic / default / local-stateful-classic - Hosts Page - Flyout - Metrics Tab
  • [job] [logs] Scout Lane #6 - stateful-classic / default / local-stateful-classic - Hosts Page - Flyout - Open as page and return
  • [job] [logs] Scout Lane #6 - stateful-classic / default / local-stateful-classic - Hosts Page - Flyout - Overview Tab - KPI charts and collapsible sections
  • [job] [logs] Scout Lane #6 - stateful-classic / default / local-stateful-classic - Hosts Page - Flyout - Overview Tab - Services section
  • [job] [logs] Scout Lane #6 - stateful-classic / default / local-stateful-classic - Hosts Page - Flyout - Processes Tab
  • [job] [logs] Scout Lane #8 - stateful-classic / default / local-stateful-classic - Observability Landing Page (discover.isEsqlDefault enabled) - redirects to onboarding when no logs data exists

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
logsShared 453 455 +2

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
apm 2.8MB 2.8MB +54.0B
fleet 2.7MB 2.7MB +54.0B
infra 1.5MB 1.5MB +54.0B
logsShared 98.4KB 102.6KB +4.2KB
unifiedDocViewer 676.6KB 676.7KB +96.0B
total +4.5KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
logsShared 73.9KB 74.0KB +107.0B
Unknown metric groups

API count

id before after diff
@kbn/saved-search-component 26 27 +1

History

cc @iblancof

@iblancof iblancof merged commit 9fca0a1 into elastic:main May 12, 2026
59 checks passed
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 9.4

https://github.com/elastic/kibana/actions/runs/25719254934

@kibanamachine
Copy link
Copy Markdown
Contributor

💚 All backports created successfully

Status Branch Result
9.4

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request May 12, 2026
…#268452) (#268809)

# Backport

This will backport the following commits from `main` to `9.4`:
- [[Discover][Traces] Add APM operation IDs to traces log fetching
(#268452)](#268452)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Irene
Blanco","email":"irene.blanco@elastic.co"},"sourceCommit":{"committedDate":"2026-05-12T07:09:53Z","message":"[Discover][Traces]
Add APM operation IDs to traces log fetching (#268452)\n\n##
Summary\n\nRelates to
https://github.com/elastic/observability-dev/issues/5348\n\nThis PR
instruments two log-fetching code paths in the trace document\nviewer
with APM execution context and explicit error capture, enabling\nRED
metrics (rate, errors, duration) visibility in APM for
those\noperations. Without operation IDs, all Kibana search requests
appear\nidentically in APM's search/ese spans with no way to attribute
latency\nor throughput to a specific feature.\n\n###
fetchLogDocumentById\n\n`fetchLogDocumentById` is called when a user
opens a log document from\nthe expanded waterfall flyout. Because this
function owns the\n`data.search.search` call directly, we can instrument
it fully:\n\n- An `executionContext` with `operation_id:
fetch-log-by-id` is passed\nto the search call. The Kibana HTTP layer
forwards this via the\n`x-kbn-context` header, and the server-side APM
agent attaches it as a\n`kibana_meta_operation_id` label on the
resulting span.\n- The search call is wrapped in a try-catch that
calls\n`apm.captureError` with the same label, so failures appear in APM
with\nthe correct operation context.\n- `toasts.addDanger` is replaced
with `toasts.add({ color: 'danger', ...\n})` to avoid double error
capture: `addDanger` internally calls\n`apm.captureError`, which would
produce a duplicate error event\nalongside ours.\n\n### Logs embeddable
(TraceContextLogEvents)\n\nThe correlated logs section in the trace
document overview renders via\n`LazySavedSearchComponent`, which
delegates all fetching to\n`SearchEmbeddable` internally. Because we do
not own the fetch call,\nexplicit error capture is not feasible:
`SearchEmbeddable` handles\nerrors internally and surfaces them as
inline UI state, so failures\nnever propagate as rejections we can catch
or as failed HTTP spans in\nAPM.\n\nFor latency and throughput, we
thread `executionContext` with\n`operation_id: fetch-trace-context-logs`
from `TraceContextLogEvents`\ndown through `LogEventsComponent` and
`LazySavedSearchComponent` to\n`SearchEmbeddable`'s `parentApi`. The
embeddable reads execution context\nfrom `parentApi` and includes it in
every search request, tagging those\nspans with
`kibana_meta_operation_id: fetch-trace-context-logs` on
the\nserver.\n\nThis required adding `executionContext` as a typed prop
to\n`LogEventsProps` and `SavedSearchComponentProps`, and
declaring\n`@kbn/core-execution-context-common` in `kbn_references` for
both\naffected packages.\n\n### How to test\n\nVerify the logs
embeddable span label:\n\n- Start Kibana with a synthtrace scenario that
includes log documents\ncorrelated to a trace (e.g. `node
scripts/synthtrace\nlogs_traces_hosts`).\n- Open a trace document in the
doc viewer and expand the Logs section.\n- In APM, filter search/ese
spans by `labels.kibana_meta_operation_id:\nfetch-trace-context-logs`
and confirm requests from the logs section\nappear with that
label.\n\nVerify the fetch log span label and error capture:\n\n- From
the expanded waterfall, click a log item to open the log
document\nflyout.\n- In APM, filter by `labels.kibana_meta_operation_id:
fetch-log-by-id`\nand confirm the fetch span appears.\n- To test error
capture: temporarily break the fetch (e.g. pass an\ninvalid index) and
confirm a single APM error appears
with\n`labels.kibana_meta_operation_id: fetch-log-by-id`, not
two.\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"9fca0a10f22c136932d2a8ef8a6c82738897c1ba","branchLabelMapping":{"^v9.5.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:version","Team:obs-exploration","v9.4.0","v9.5.0"],"title":"[Discover][Traces]
Add APM operation IDs to traces log
fetching","number":268452,"url":"https://github.com/elastic/kibana/pull/268452","mergeCommit":{"message":"[Discover][Traces]
Add APM operation IDs to traces log fetching (#268452)\n\n##
Summary\n\nRelates to
https://github.com/elastic/observability-dev/issues/5348\n\nThis PR
instruments two log-fetching code paths in the trace document\nviewer
with APM execution context and explicit error capture, enabling\nRED
metrics (rate, errors, duration) visibility in APM for
those\noperations. Without operation IDs, all Kibana search requests
appear\nidentically in APM's search/ese spans with no way to attribute
latency\nor throughput to a specific feature.\n\n###
fetchLogDocumentById\n\n`fetchLogDocumentById` is called when a user
opens a log document from\nthe expanded waterfall flyout. Because this
function owns the\n`data.search.search` call directly, we can instrument
it fully:\n\n- An `executionContext` with `operation_id:
fetch-log-by-id` is passed\nto the search call. The Kibana HTTP layer
forwards this via the\n`x-kbn-context` header, and the server-side APM
agent attaches it as a\n`kibana_meta_operation_id` label on the
resulting span.\n- The search call is wrapped in a try-catch that
calls\n`apm.captureError` with the same label, so failures appear in APM
with\nthe correct operation context.\n- `toasts.addDanger` is replaced
with `toasts.add({ color: 'danger', ...\n})` to avoid double error
capture: `addDanger` internally calls\n`apm.captureError`, which would
produce a duplicate error event\nalongside ours.\n\n### Logs embeddable
(TraceContextLogEvents)\n\nThe correlated logs section in the trace
document overview renders via\n`LazySavedSearchComponent`, which
delegates all fetching to\n`SearchEmbeddable` internally. Because we do
not own the fetch call,\nexplicit error capture is not feasible:
`SearchEmbeddable` handles\nerrors internally and surfaces them as
inline UI state, so failures\nnever propagate as rejections we can catch
or as failed HTTP spans in\nAPM.\n\nFor latency and throughput, we
thread `executionContext` with\n`operation_id: fetch-trace-context-logs`
from `TraceContextLogEvents`\ndown through `LogEventsComponent` and
`LazySavedSearchComponent` to\n`SearchEmbeddable`'s `parentApi`. The
embeddable reads execution context\nfrom `parentApi` and includes it in
every search request, tagging those\nspans with
`kibana_meta_operation_id: fetch-trace-context-logs` on
the\nserver.\n\nThis required adding `executionContext` as a typed prop
to\n`LogEventsProps` and `SavedSearchComponentProps`, and
declaring\n`@kbn/core-execution-context-common` in `kbn_references` for
both\naffected packages.\n\n### How to test\n\nVerify the logs
embeddable span label:\n\n- Start Kibana with a synthtrace scenario that
includes log documents\ncorrelated to a trace (e.g. `node
scripts/synthtrace\nlogs_traces_hosts`).\n- Open a trace document in the
doc viewer and expand the Logs section.\n- In APM, filter search/ese
spans by `labels.kibana_meta_operation_id:\nfetch-trace-context-logs`
and confirm requests from the logs section\nappear with that
label.\n\nVerify the fetch log span label and error capture:\n\n- From
the expanded waterfall, click a log item to open the log
document\nflyout.\n- In APM, filter by `labels.kibana_meta_operation_id:
fetch-log-by-id`\nand confirm the fetch span appears.\n- To test error
capture: temporarily break the fetch (e.g. pass an\ninvalid index) and
confirm a single APM error appears
with\n`labels.kibana_meta_operation_id: fetch-log-by-id`, not
two.\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"9fca0a10f22c136932d2a8ef8a6c82738897c1ba"}},"sourceBranch":"main","suggestedTargetBranches":["9.4"],"targetPullRequestStates":[{"branch":"9.4","label":"v9.4.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.5.0","branchLabelMappingKey":"^v9.5.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/268452","number":268452,"mergeCommit":{"message":"[Discover][Traces]
Add APM operation IDs to traces log fetching (#268452)\n\n##
Summary\n\nRelates to
https://github.com/elastic/observability-dev/issues/5348\n\nThis PR
instruments two log-fetching code paths in the trace document\nviewer
with APM execution context and explicit error capture, enabling\nRED
metrics (rate, errors, duration) visibility in APM for
those\noperations. Without operation IDs, all Kibana search requests
appear\nidentically in APM's search/ese spans with no way to attribute
latency\nor throughput to a specific feature.\n\n###
fetchLogDocumentById\n\n`fetchLogDocumentById` is called when a user
opens a log document from\nthe expanded waterfall flyout. Because this
function owns the\n`data.search.search` call directly, we can instrument
it fully:\n\n- An `executionContext` with `operation_id:
fetch-log-by-id` is passed\nto the search call. The Kibana HTTP layer
forwards this via the\n`x-kbn-context` header, and the server-side APM
agent attaches it as a\n`kibana_meta_operation_id` label on the
resulting span.\n- The search call is wrapped in a try-catch that
calls\n`apm.captureError` with the same label, so failures appear in APM
with\nthe correct operation context.\n- `toasts.addDanger` is replaced
with `toasts.add({ color: 'danger', ...\n})` to avoid double error
capture: `addDanger` internally calls\n`apm.captureError`, which would
produce a duplicate error event\nalongside ours.\n\n### Logs embeddable
(TraceContextLogEvents)\n\nThe correlated logs section in the trace
document overview renders via\n`LazySavedSearchComponent`, which
delegates all fetching to\n`SearchEmbeddable` internally. Because we do
not own the fetch call,\nexplicit error capture is not feasible:
`SearchEmbeddable` handles\nerrors internally and surfaces them as
inline UI state, so failures\nnever propagate as rejections we can catch
or as failed HTTP spans in\nAPM.\n\nFor latency and throughput, we
thread `executionContext` with\n`operation_id: fetch-trace-context-logs`
from `TraceContextLogEvents`\ndown through `LogEventsComponent` and
`LazySavedSearchComponent` to\n`SearchEmbeddable`'s `parentApi`. The
embeddable reads execution context\nfrom `parentApi` and includes it in
every search request, tagging those\nspans with
`kibana_meta_operation_id: fetch-trace-context-logs` on
the\nserver.\n\nThis required adding `executionContext` as a typed prop
to\n`LogEventsProps` and `SavedSearchComponentProps`, and
declaring\n`@kbn/core-execution-context-common` in `kbn_references` for
both\naffected packages.\n\n### How to test\n\nVerify the logs
embeddable span label:\n\n- Start Kibana with a synthtrace scenario that
includes log documents\ncorrelated to a trace (e.g. `node
scripts/synthtrace\nlogs_traces_hosts`).\n- Open a trace document in the
doc viewer and expand the Logs section.\n- In APM, filter search/ese
spans by `labels.kibana_meta_operation_id:\nfetch-trace-context-logs`
and confirm requests from the logs section\nappear with that
label.\n\nVerify the fetch log span label and error capture:\n\n- From
the expanded waterfall, click a log item to open the log
document\nflyout.\n- In APM, filter by `labels.kibana_meta_operation_id:
fetch-log-by-id`\nand confirm the fetch span appears.\n- To test error
capture: temporarily break the fetch (e.g. pass an\ninvalid index) and
confirm a single APM error appears
with\n`labels.kibana_meta_operation_id: fetch-log-by-id`, not
two.\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"9fca0a10f22c136932d2a8ef8a6c82738897c1ba"}}]}]
BACKPORT-->

Co-authored-by: Irene Blanco <irene.blanco@elastic.co>
patrykkopycinski pushed a commit to patrykkopycinski/kibana that referenced this pull request May 13, 2026
…tic#268452)

## Summary

Relates to elastic/observability-dev#5348

This PR instruments two log-fetching code paths in the trace document
viewer with APM execution context and explicit error capture, enabling
RED metrics (rate, errors, duration) visibility in APM for those
operations. Without operation IDs, all Kibana search requests appear
identically in APM's search/ese spans with no way to attribute latency
or throughput to a specific feature.

### fetchLogDocumentById

`fetchLogDocumentById` is called when a user opens a log document from
the expanded waterfall flyout. Because this function owns the
`data.search.search` call directly, we can instrument it fully:

- An `executionContext` with `operation_id: fetch-log-by-id` is passed
to the search call. The Kibana HTTP layer forwards this via the
`x-kbn-context` header, and the server-side APM agent attaches it as a
`kibana_meta_operation_id` label on the resulting span.
- The search call is wrapped in a try-catch that calls
`apm.captureError` with the same label, so failures appear in APM with
the correct operation context.
- `toasts.addDanger` is replaced with `toasts.add({ color: 'danger', ...
})` to avoid double error capture: `addDanger` internally calls
`apm.captureError`, which would produce a duplicate error event
alongside ours.

### Logs embeddable (TraceContextLogEvents)

The correlated logs section in the trace document overview renders via
`LazySavedSearchComponent`, which delegates all fetching to
`SearchEmbeddable` internally. Because we do not own the fetch call,
explicit error capture is not feasible: `SearchEmbeddable` handles
errors internally and surfaces them as inline UI state, so failures
never propagate as rejections we can catch or as failed HTTP spans in
APM.

For latency and throughput, we thread `executionContext` with
`operation_id: fetch-trace-context-logs` from `TraceContextLogEvents`
down through `LogEventsComponent` and `LazySavedSearchComponent` to
`SearchEmbeddable`'s `parentApi`. The embeddable reads execution context
from `parentApi` and includes it in every search request, tagging those
spans with `kibana_meta_operation_id: fetch-trace-context-logs` on the
server.

This required adding `executionContext` as a typed prop to
`LogEventsProps` and `SavedSearchComponentProps`, and declaring
`@kbn/core-execution-context-common` in `kbn_references` for both
affected packages.

### How to test

Verify the logs embeddable span label:

- Start Kibana with a synthtrace scenario that includes log documents
correlated to a trace (e.g. `node scripts/synthtrace
logs_traces_hosts`).
- Open a trace document in the doc viewer and expand the Logs section.
- In APM, filter search/ese spans by `labels.kibana_meta_operation_id:
fetch-trace-context-logs` and confirm requests from the logs section
appear with that label.

Verify the fetch log span label and error capture:

- From the expanded waterfall, click a log item to open the log document
flyout.
- In APM, filter by `labels.kibana_meta_operation_id: fetch-log-by-id`
and confirm the fetch span appears.
- To test error capture: temporarily break the fetch (e.g. pass an
invalid index) and confirm a single APM error appears with
`labels.kibana_meta_operation_id: fetch-log-by-id`, not two.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
jcger pushed a commit that referenced this pull request May 26, 2026
)

## Summary

Relates to elastic/observability-dev#5348

This PR instruments two log-fetching code paths in the trace document
viewer with APM execution context and explicit error capture, enabling
RED metrics (rate, errors, duration) visibility in APM for those
operations. Without operation IDs, all Kibana search requests appear
identically in APM's search/ese spans with no way to attribute latency
or throughput to a specific feature.

### fetchLogDocumentById

`fetchLogDocumentById` is called when a user opens a log document from
the expanded waterfall flyout. Because this function owns the
`data.search.search` call directly, we can instrument it fully:

- An `executionContext` with `operation_id: fetch-log-by-id` is passed
to the search call. The Kibana HTTP layer forwards this via the
`x-kbn-context` header, and the server-side APM agent attaches it as a
`kibana_meta_operation_id` label on the resulting span.
- The search call is wrapped in a try-catch that calls
`apm.captureError` with the same label, so failures appear in APM with
the correct operation context.
- `toasts.addDanger` is replaced with `toasts.add({ color: 'danger', ...
})` to avoid double error capture: `addDanger` internally calls
`apm.captureError`, which would produce a duplicate error event
alongside ours.

### Logs embeddable (TraceContextLogEvents)

The correlated logs section in the trace document overview renders via
`LazySavedSearchComponent`, which delegates all fetching to
`SearchEmbeddable` internally. Because we do not own the fetch call,
explicit error capture is not feasible: `SearchEmbeddable` handles
errors internally and surfaces them as inline UI state, so failures
never propagate as rejections we can catch or as failed HTTP spans in
APM.

For latency and throughput, we thread `executionContext` with
`operation_id: fetch-trace-context-logs` from `TraceContextLogEvents`
down through `LogEventsComponent` and `LazySavedSearchComponent` to
`SearchEmbeddable`'s `parentApi`. The embeddable reads execution context
from `parentApi` and includes it in every search request, tagging those
spans with `kibana_meta_operation_id: fetch-trace-context-logs` on the
server.

This required adding `executionContext` as a typed prop to
`LogEventsProps` and `SavedSearchComponentProps`, and declaring
`@kbn/core-execution-context-common` in `kbn_references` for both
affected packages.

### How to test

Verify the logs embeddable span label:

- Start Kibana with a synthtrace scenario that includes log documents
correlated to a trace (e.g. `node scripts/synthtrace
logs_traces_hosts`).
- Open a trace document in the doc viewer and expand the Logs section.
- In APM, filter search/ese spans by `labels.kibana_meta_operation_id:
fetch-trace-context-logs` and confirm requests from the logs section
appear with that label.

Verify the fetch log span label and error capture:

- From the expanded waterfall, click a log item to open the log document
flyout.
- In APM, filter by `labels.kibana_meta_operation_id: fetch-log-by-id`
and confirm the fetch span appears.
- To test error capture: temporarily break the fetch (e.g. pass an
invalid index) and confirm a single APM error appears with
`labels.kibana_meta_operation_id: fetch-log-by-id`, not two.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels release_note:skip Skip the PR/issue when compiling release notes Team:obs-exploration Observability Exploration team v9.4.2 v9.5.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants