Skip to content

[Observability] Page attachment type #225295

Merged
dominiqueclarke merged 99 commits intoelastic:mainfrom
dominiqueclarke:feat/observability-generic-attachment
Jul 22, 2025
Merged

[Observability] Page attachment type #225295
dominiqueclarke merged 99 commits intoelastic:mainfrom
dominiqueclarke:feat/observability-generic-attachment

Conversation

@dominiqueclarke
Copy link
Copy Markdown
Contributor

@dominiqueclarke dominiqueclarke commented Jun 25, 2025

Closes #226073

Summary

This PR defines a generic "page" attachment type which can be used to attach any page in Kibana to a case. The attachment type is then implemented for the Synthetics monitor details page.

Screenshot 2025-06-25 at 10 43 15 PM

Overview

See implementation issue and its parent meta for more details on the "why" as well as our short-term future plans for extending this page attachment idea.

Technical details

  1. The type definition for the attachment persisted state
  2. The attachment spec
  3. The Synthetics implementation

Testing

  1. Add the xpack.observabilityShared.unsafe.investigativeExperienceEnabled: true feature flag.
  2. Create a Synthetics monitor. The easiest way to do so is to create a cluster via oblt cli and attach your local Kibana to it.
  3. Visit the Synthetics monitor details page.
  4. Click the Add to Case Button
  5. Ensure the attachment is added successfully via toast. Click View Case
  6. You should see the name of the monitor hyperlinked in the attachment comment. You should also see a Go to Monitor button in the comment actions. Lastly, you should see a Go To Monitor button in the actions dropdown.
  7. When you visit each link, you should be navigated back to the monitor details history page, with the time range as absolute value for the time range the user was viewing at the time they added the attachment.

Appendix

  1. Persistable state attachment type docs

dominiqueclarke and others added 27 commits June 10, 2025 15:22
@github-actions github-actions bot added the author:obs-ux-management PRs authored by the obs ux management team label Jun 25, 2025
@dominiqueclarke dominiqueclarke force-pushed the feat/observability-generic-attachment branch from a3a9ecf to 479cf7c Compare June 25, 2025 13:38

export const pageAttachmentPersistedStateSchema = z.object({
/**
* The type of page or page asset, e.g., 'dashboard', 'synthetics-test-run', 'slo-history', etc
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why do we need type here?

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.

It's basically a sub-type to help us make future decisions about how to render this page, how to evaluate it in LLM analysis, etc.

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.

@jasonrhodes Michael and I had actually discussed this over zoom last week. I should have put the reply here for reference.

Copy link
Copy Markdown
Contributor

@michaelolo24 michaelolo24 left a comment

Choose a reason for hiding this comment

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

Thank you for responding to all of the feedback here! LGTM!

Copy link
Copy Markdown
Contributor

@benakansara benakansara left a comment

Choose a reason for hiding this comment

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

LGTM. I have a few observations.

  • When creating a new case from monitor details page, the Actions popover doesn't close and once in create case form, it's not possible to move or remove it manually.
Screenshot 2025-07-21 at 3 46 12 PM
  • Should we allow right click on this link?
Screenshot 2025-07-21 at 3 50 24 PM
  • When I click on "Add to case", loading animation is shown next to "Run test manually" instead of "Add to case".
Screenshot 2025-07-21 at 3 43 32 PM

"extraPublicDirs": [
"common"
"common",
"public/client/attachment_framework/types"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I wonder if we should move these types to common?

dominiqueclarke and others added 3 commits July 21, 2025 11:41
…synthetics/components/monitor_details/actions.tsx

Co-authored-by: Bena Kansara <69037875+benakansara@users.noreply.github.com>
…miniqueclarke/kibana into feat/observability-generic-attachment
…synthetics/components/monitor_details/actions.test.tsx
…synthetics/components/monitor_details/actions.test.tsx
…synthetics/components/monitor_details/actions.test.tsx
@elasticmachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #65 / @ess @serverless @skipInServerlessMKI Import prebuilt rules when the package is not installed imports new prebuilt rules

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
observability 1412 1421 +9
synthetics 1367 1369 +2
total +11

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/page-attachment-schema - 3 +3
cases 109 110 +1
observabilityShared 506 515 +9
triggersActionsUi 494 493 -1
total +12

Async chunks

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

id before after diff
cases 1.3MB 1.3MB +247.0B
observability 1.3MB 1.3MB +3.1KB
synthetics 1.0MB 1.0MB +3.0KB
total +6.4KB

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
observabilityShared 18 19 +1

Page load bundle

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

id before after diff
cases 135.0KB 135.2KB +240.0B
observability 95.8KB 155.6KB +59.8KB
observabilityShared 66.9KB 67.0KB +152.0B
synthetics 28.0KB 28.2KB +149.0B
triggersActionsUi 105.7KB 105.6KB -66.0B
total +60.3KB
Unknown metric groups

API count

id before after diff
@kbn/page-attachment-schema - 3 +3
cases 129 130 +1
observabilityShared 512 521 +9
triggersActionsUi 498 497 -1
total +12

async chunk count

id before after diff
observability 23 25 +2

ESLint disabled line counts

id before after diff
observability 46 48 +2

Total ESLint disabled count

id before after diff
observability 47 49 +2

History

@dominiqueclarke dominiqueclarke merged commit 33a9007 into elastic:main Jul 22, 2025
14 checks passed
kdelemme pushed a commit to kdelemme/kibana that referenced this pull request Jul 23, 2025
Closes elastic#226073

## Summary

This PR defines a generic "page" attachment type which can be used to
attach any page in Kibana to a case. The attachment type is then
implemented for the Synthetics monitor details page.

<img width="1066" alt="Screenshot 2025-06-25 at 10 43 15 PM"
src="https://github.com/user-attachments/assets/6b55bf8f-b9ca-476f-b4ca-634b8e17d461"
/>

## Overview

See [implementation
issue](elastic#226073) and [its parent
meta](elastic#226072) for more details
on the "why" as well as our short-term future plans for extending this
page attachment idea.

 ## Technical details

1. [The type definition for the attachment persisted
state](https://github.com/elastic/kibana/pull/225295/files#diff-682c62b478a2d1aea2a471733166259185c1ba4534e293abec015abd64cc4c27)
2. [The attachment
spec](https://github.com/elastic/kibana/pull/225295/files#diff-2083a0a3bb7f475e6b8a50a061c2a0a78499b416f5d7465aaa3171a8dd8971fa)
3. [The Synthetics
implementation](https://github.com/elastic/kibana/pull/225295/files#diff-302cdc10545ddfaf8eae433954a03c7cd21b94c4f2f0706364ce50c1edf36a3b)

## Testing
1. Add the
`xpack.observabilityShared.unsafe.investigativeExperienceEnabled: true`
feature flag.
2. Create a Synthetics monitor. The easiest way to do so is to create a
cluster via oblt cli and attach your local Kibana to it.
3. Visit the Synthetics monitor details page.
4. Click the Add to Case Button
8. Ensure the attachment is added successfully via toast. Click View
Case
9. You should see the name of the monitor hyperlinked in the attachment
comment. You should also see a Go to Monitor button in the comment
actions. Lastly, you should see a Go To Monitor button in the actions
dropdown.
10. When you visit each link, you should be navigated back to the
monitor details history page, with the time range as absolute value for
the time range the user was viewing at the time they added the
attachment.

## Appendix

1. [Persistable state attachment type
docs](https://docs.elastic.dev/reops/attachment-framework-persistable-state)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Bena Kansara <bena.kansara@elastic.co>
Co-authored-by: Bena Kansara <69037875+benakansara@users.noreply.github.com>
kertal pushed a commit to kertal/kibana that referenced this pull request Jul 25, 2025
Closes elastic#226073

## Summary

This PR defines a generic "page" attachment type which can be used to
attach any page in Kibana to a case. The attachment type is then
implemented for the Synthetics monitor details page.

<img width="1066" alt="Screenshot 2025-06-25 at 10 43 15 PM"
src="https://github.com/user-attachments/assets/6b55bf8f-b9ca-476f-b4ca-634b8e17d461"
/>

## Overview

See [implementation
issue](elastic#226073) and [its parent
meta](elastic#226072) for more details
on the "why" as well as our short-term future plans for extending this
page attachment idea.

 ## Technical details

1. [The type definition for the attachment persisted
state](https://github.com/elastic/kibana/pull/225295/files#diff-682c62b478a2d1aea2a471733166259185c1ba4534e293abec015abd64cc4c27)
2. [The attachment
spec](https://github.com/elastic/kibana/pull/225295/files#diff-2083a0a3bb7f475e6b8a50a061c2a0a78499b416f5d7465aaa3171a8dd8971fa)
3. [The Synthetics
implementation](https://github.com/elastic/kibana/pull/225295/files#diff-302cdc10545ddfaf8eae433954a03c7cd21b94c4f2f0706364ce50c1edf36a3b)

## Testing
1. Add the
`xpack.observabilityShared.unsafe.investigativeExperienceEnabled: true`
feature flag.
2. Create a Synthetics monitor. The easiest way to do so is to create a
cluster via oblt cli and attach your local Kibana to it.
3. Visit the Synthetics monitor details page.
4. Click the Add to Case Button
8. Ensure the attachment is added successfully via toast. Click View
Case
9. You should see the name of the monitor hyperlinked in the attachment
comment. You should also see a Go to Monitor button in the comment
actions. Lastly, you should see a Go To Monitor button in the actions
dropdown.
10. When you visit each link, you should be navigated back to the
monitor details history page, with the time range as absolute value for
the time range the user was viewing at the time they added the
attachment.

## Appendix

1. [Persistable state attachment type
docs](https://docs.elastic.dev/reops/attachment-framework-persistable-state)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Bena Kansara <bena.kansara@elastic.co>
Co-authored-by: Bena Kansara <69037875+benakansara@users.noreply.github.com>
crespocarlos pushed a commit to crespocarlos/kibana that referenced this pull request Jul 25, 2025
Closes elastic#226073

## Summary

This PR defines a generic "page" attachment type which can be used to
attach any page in Kibana to a case. The attachment type is then
implemented for the Synthetics monitor details page.

<img width="1066" alt="Screenshot 2025-06-25 at 10 43 15 PM"
src="https://github.com/user-attachments/assets/6b55bf8f-b9ca-476f-b4ca-634b8e17d461"
/>

## Overview

See [implementation
issue](elastic#226073) and [its parent
meta](elastic#226072) for more details
on the "why" as well as our short-term future plans for extending this
page attachment idea.

 ## Technical details

1. [The type definition for the attachment persisted
state](https://github.com/elastic/kibana/pull/225295/files#diff-682c62b478a2d1aea2a471733166259185c1ba4534e293abec015abd64cc4c27)
2. [The attachment
spec](https://github.com/elastic/kibana/pull/225295/files#diff-2083a0a3bb7f475e6b8a50a061c2a0a78499b416f5d7465aaa3171a8dd8971fa)
3. [The Synthetics
implementation](https://github.com/elastic/kibana/pull/225295/files#diff-302cdc10545ddfaf8eae433954a03c7cd21b94c4f2f0706364ce50c1edf36a3b)

## Testing
1. Add the
`xpack.observabilityShared.unsafe.investigativeExperienceEnabled: true`
feature flag.
2. Create a Synthetics monitor. The easiest way to do so is to create a
cluster via oblt cli and attach your local Kibana to it.
3. Visit the Synthetics monitor details page.
4. Click the Add to Case Button
8. Ensure the attachment is added successfully via toast. Click View
Case
9. You should see the name of the monitor hyperlinked in the attachment
comment. You should also see a Go to Monitor button in the comment
actions. Lastly, you should see a Go To Monitor button in the actions
dropdown.
10. When you visit each link, you should be navigated back to the
monitor details history page, with the time range as absolute value for
the time range the user was viewing at the time they added the
attachment.

## Appendix

1. [Persistable state attachment type
docs](https://docs.elastic.dev/reops/attachment-framework-persistable-state)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Bena Kansara <bena.kansara@elastic.co>
Co-authored-by: Bena Kansara <69037875+benakansara@users.noreply.github.com>
fkanout added a commit to fkanout/kibana that referenced this pull request Sep 30, 2025
mgiota added a commit to mgiota/kibana that referenced this pull request Sep 30, 2025
mgiota added a commit to mgiota/kibana that referenced this pull request Sep 30, 2025
mgiota added a commit to mgiota/kibana that referenced this pull request Sep 30, 2025
mgiota added a commit to mgiota/kibana that referenced this pull request Sep 30, 2025
fkanout added a commit that referenced this pull request Oct 2, 2025
This reverts commit 33a9007.

I reviewed the files and resolved the merge conflicts. I didn’t fully
revert the PR, instead I cherry-picked the following:
- Locator enhancement (covering for time range and tabId)
- Actions
- Bug fix for running tests manually with required permissions
- Route config updates (covering Actions and tabs)
- Import adjustments

## Note

These PRs need to be merged first in the order they are listed:
- #236872
- <del>https://github.com/elastic/kibana/pull/236869</del>
- #237064

---------
Co-authored-by: Panagiota Mitsopoulou <giota85@gmail.com>
rylnd pushed a commit to rylnd/kibana that referenced this pull request Oct 17, 2025
…ic#236958)

This reverts commit 33a9007.

I reviewed the files and resolved the merge conflicts. I didn’t fully
revert the PR, instead I cherry-picked the following:
- Locator enhancement (covering for time range and tabId)
- Actions
- Bug fix for running tests manually with required permissions
- Route config updates (covering Actions and tabs)
- Import adjustments

## Note

These PRs need to be merged first in the order they are listed:
- elastic#236872
- <del>https://github.com/elastic/kibana/pull/236869</del>
- elastic#237064

---------
Co-authored-by: Panagiota Mitsopoulou <giota85@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author:obs-ux-management PRs authored by the obs ux management team backport:skip This PR does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:actionable-obs Formerly "obs-ux-management", responsible for SLO, o11y alerting, significant events, & synthetics. v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Incident Management] New page attachment exists for cases, using a feature flag