kibana/x-pack/test/api_integration/apis/metrics_ui/index.js
Maryam Saeidi e7ddab7e57
[AO] Add alertDetailsUrl for infra rule (#157987)
Closes #156534

## Summary

This PR adds the alertDetailsUrl to the infra rules. The value of this
variable is a link to the `observability > alerts` page filtered for
this instance of alert.


![image](409bea90-5d2b-4e60-ae4c-61223cccd41a)

Here is an example of this action variable:

|alertDetailsUrl as action variable|Result of action|
|---|---|

|![image](4f800c6d-f15f-481e-b7fc-4f85aa1085a7)|

**Note**
- I will change this field to `kibana.alert.url` in another
[ticket](https://github.com/elastic/kibana/issues/158359)

## 🧪 How to test
- Ensure that `server.publicBaseUrl` is configured in kibana.dev.yml
- Create a metric threshold/inventory/logs rule and use the
`context.alertDetailsUrl` in action for this rule
- After an alert is triggered, open the link provided by alertDetailsUrl
and make sure that the alert is filtered correctly
- Check the time range, it should be set for 5 mins before the alert
start time

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Carlos Crespo <crespocarlos@users.noreply.github.com>
2023-05-26 10:14:05 +02:00

28 lines
1.3 KiB
JavaScript

/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
export default function ({ loadTestFile }) {
describe('MetricsUI Endpoints', () => {
loadTestFile(require.resolve('./metadata'));
loadTestFile(require.resolve('./log_entry_highlights'));
loadTestFile(require.resolve('./log_summary'));
loadTestFile(require.resolve('./metrics'));
loadTestFile(require.resolve('./sources'));
loadTestFile(require.resolve('./snapshot'));
loadTestFile(require.resolve('./metrics_alerting'));
loadTestFile(require.resolve('./metrics_explorer'));
loadTestFile(require.resolve('./ip_to_hostname'));
loadTestFile(require.resolve('./http_source'));
loadTestFile(require.resolve('./metric_threshold_alert'));
loadTestFile(require.resolve('./metrics_overview_top'));
loadTestFile(require.resolve('./metrics_process_list'));
loadTestFile(require.resolve('./metrics_process_list_chart'));
loadTestFile(require.resolve('./infra_log_analysis_validation_log_entry_datasets'));
loadTestFile(require.resolve('./infra'));
loadTestFile(require.resolve('./inventory_threshold_alert'));
});
}