Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[APM] add view in apm button to alert details page #184687

Conversation

dominiqueclarke
Copy link
Contributor

@dominiqueclarke dominiqueclarke commented Jun 3, 2024

Summary

Relates to #184204
Relates to #184236

After adding the View in APM buttons to APM alert details visualizations, a bug was introduced where the share plugin was not available in the codepath.

This was due to using the useAPMPluginContext hook. APM plugin context does not exist within the observability plugin where this component is rendered.

The use of useAPMPluginContext did work when using the visualization embeddables, because they are wrapped in context, but when using the visualizations on their own, such as in the APM latency alert details page, the experience was broken.

To fix the experience, we added some defensive code and hid the button when the share plugin was not available.

Now, we want to introduce a permenant fix to re-introduce the View in APM button the APM alert details visualization. This fix uses useKibana rather than useAPMPluginContext to gain access to the share plugin.

SLO APM latency SLI alert details
image

SLO APM error rate SLI alert details
image

APM latency alert details
image

Testing

Both the APM SLO burn rate rules and the APM latency rules should be tested in this PR

  1. Generate APM test data. For example, you can use node scripts/synthtrace simple_trace --live
  2. Create an APM latency rule with the threshold that will trigger an alert
  3. Navigate to the alert details page
  4. Ensure the page loads and the View in APM button appears
  5. Click on the View in APM button to ensure it navigates to APM appropriately
  6. Create an APM latency SLI within the SLO app. Choose a threshold that will trigger a low SLI value
  7. Wait for a burn rate alert to fire (the rule is created automatically)
  8. Navigate to the alert details page. Ensure the page loads and the View in APM button appears
  9. Click on the View in APM button to ensure it navigates to APM appropriately
  10. Repeat steps 6 to 9 with the APM error rate SLI within the SLO app.

@dominiqueclarke
Copy link
Contributor Author

/ci

@apmmachine
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@dominiqueclarke
Copy link
Contributor Author

/ci

@dominiqueclarke dominiqueclarke added Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team Team:obs-ux-management Observability Management User Experience Team apm:review v8.15.0 release_note:skip Skip the PR/issue when compiling release notes labels Jun 4, 2024
@dominiqueclarke dominiqueclarke changed the title apm - add view in apm button to alert details page [APM] add view in apm button to alert details page Jun 4, 2024
@dominiqueclarke dominiqueclarke marked this pull request as ready for review June 4, 2024 14:33
@dominiqueclarke dominiqueclarke requested a review from a team as a code owner June 4, 2024 14:33
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services)

@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-management-team (Team:obs-ux-management)

@botelastic botelastic bot added the ci:project-deploy-observability Create an Observability project label Jun 6, 2024
Copy link
Contributor

@crespocarlos crespocarlos left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +33 to +35
const {
services: { share },
} = useKibana<ObservabilityPublicPluginsStart>();
Copy link
Contributor

Choose a reason for hiding this comment

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

This is confusing but we're already doing the same in failed_transaction_chart.tsx, x-latency_chart.tsx and throughput_chart.tsx

@dominiqueclarke dominiqueclarke added ci:project-deploy-observability Create an Observability project and removed ci:project-deploy-observability Create an Observability project labels Jun 7, 2024
@botelastic botelastic bot added the ci:project-deploy-observability Create an Observability project label Jun 10, 2024
@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #63 / Dataset quality API tests integrations/integrations.spec.ts basic Integration gets the installed integrations returns only log based integrations and its datasets map

Metrics [docs]

Async chunks

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

id before after diff
apm 3.5MB 3.5MB +30.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@dominiqueclarke dominiqueclarke merged commit a919cd8 into elastic:main Jun 10, 2024
22 checks passed
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Jun 10, 2024
@dominiqueclarke dominiqueclarke deleted the fix/add-view-in-apm-button-to-alert-details-page branch June 10, 2024 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apm:review backport:skip This commit does not require backporting ci:project-deploy-observability Create an Observability project release_note:skip Skip the PR/issue when compiling release notes Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team Team:obs-ux-management Observability Management User Experience Team v8.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants