Skip to content

Commit 1463b9b

Browse files
[SLO] Fix APM embeddable ids (elastic#264750)
## Summary Closes elastic#264008 As part of the dashboards as code effort, elastic#254079 introduced a change by which embeddable ids were changed. While most usages were properly updated, a couple of hardcoded string references in the SLO plugin were left unchanged. This is leading to issues where the APM embeddables in the alert details page are failing to be displayed because the code is unable to find the appropiate embeddable factory when searching by it's old id. In order to prevent issues like this in the future, I plan to do a follow up PR providing a proper fix to this issue in a way that allows the SLO plugin to consume the embeddable id constants defined in APM instead of having to relay on redefining the strings values in both plugins, which can lead to inconsistencies as this one. But, given the timing with the 9.4 BC I've decided to go first for this quick-and-easy approach of just changing the strings in the SLO plugin as well. While this is not ideal code-wise it will allow us to have a low-risk fix in time to be backported to 9.4 so we don't ship this view in a broken state.
1 parent c5cbc5f commit 1463b9b

2 files changed

Lines changed: 9 additions & 11 deletions

File tree

x-pack/solutions/observability/plugins/slo/public/components/alert_details/components/custom_panels/apm/apm_alert_details.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export function APMLatencyAlertDetails({
2828
<APMEmbeddableRoot
2929
slo={slo}
3030
dataTimeRange={dataTimeRange}
31-
embeddableId={'APM_ALERTING_LATENCY_CHART_EMBEDDABLE'}
31+
embeddableId={'apm_alerting_latency_chart'}
3232
alert={alert}
3333
rule={rule}
3434
/>
@@ -37,7 +37,7 @@ export function APMLatencyAlertDetails({
3737
<APMEmbeddableRoot
3838
slo={slo}
3939
dataTimeRange={dataTimeRange}
40-
embeddableId={'APM_ALERTING_THROUGHPUT_CHART_EMBEDDABLE'}
40+
embeddableId={'apm_alerting_throughput_chart'}
4141
alert={alert}
4242
rule={rule}
4343
/>
@@ -46,7 +46,7 @@ export function APMLatencyAlertDetails({
4646
<APMEmbeddableRoot
4747
slo={slo}
4848
dataTimeRange={dataTimeRange}
49-
embeddableId={'APM_ALERTING_FAILED_TRANSACTIONS_CHART_EMBEDDABLE'}
49+
embeddableId={'apm_alerting_failed_transactions_chart'}
5050
alert={alert}
5151
rule={rule}
5252
/>
@@ -67,7 +67,7 @@ export function APMAvailabilityAlertDetails({
6767
<APMEmbeddableRoot
6868
slo={slo}
6969
dataTimeRange={dataTimeRange}
70-
embeddableId={'APM_ALERTING_FAILED_TRANSACTIONS_CHART_EMBEDDABLE'}
70+
embeddableId={'apm_alerting_failed_transactions_chart'}
7171
alert={alert}
7272
rule={rule}
7373
/>
@@ -76,7 +76,7 @@ export function APMAvailabilityAlertDetails({
7676
<APMEmbeddableRoot
7777
slo={slo}
7878
dataTimeRange={dataTimeRange}
79-
embeddableId={'APM_ALERTING_THROUGHPUT_CHART_EMBEDDABLE'}
79+
embeddableId={'apm_alerting_throughput_chart'}
8080
alert={alert}
8181
rule={rule}
8282
/>
@@ -85,7 +85,7 @@ export function APMAvailabilityAlertDetails({
8585
<APMEmbeddableRoot
8686
slo={slo}
8787
dataTimeRange={dataTimeRange}
88-
embeddableId={'APM_ALERTING_LATENCY_CHART_EMBEDDABLE'}
88+
embeddableId={'apm_alerting_latency_chart'}
8989
alert={alert}
9090
rule={rule}
9191
/>

x-pack/solutions/observability/plugins/slo/public/components/alert_details/components/custom_panels/apm/embeddable_root.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,9 @@ import { apmTransactionDurationIndicatorSchema } from '@kbn/slo-schema';
1818
import type { BurnRateAlert, BurnRateRule, TimeRange } from '../../../types';
1919

2020
type EmbeddableId =
21-
| 'APM_THROUGHPUT_CHART_EMBEDDABLE'
22-
| 'APM_LATENCY_CHART_EMBEDDABLE'
23-
| 'APM_ALERTING_FAILED_TRANSACTIONS_CHART_EMBEDDABLE'
24-
| 'APM_ALERTING_LATENCY_CHART_EMBEDDABLE'
25-
| 'APM_ALERTING_THROUGHPUT_CHART_EMBEDDABLE';
21+
| 'apm_alerting_failed_transactions_chart'
22+
| 'apm_alerting_latency_chart'
23+
| 'apm_alerting_throughput_chart';
2624

2725
export type APMTransactionDurationSLOResponse = GetSLOResponse & {
2826
indicator: APMTransactionDurationIndicator;

0 commit comments

Comments
 (0)