Skip to content

Commit

Permalink
[APM] Pass transaction.name and error groupId in alert flyout (#1…
Browse files Browse the repository at this point in the history
…62025)

closes #156805
#156804

- Auto-complete when params are present. 

- The params are not present when creating a rule from the Alerts page
or Management rules page.


https://github.com/elastic/kibana/assets/3369346/e4563072-6c9d-4245-9075-b6939c1542e7
  • Loading branch information
kpatticha authored Jul 17, 2023
1 parent 9f67549 commit af806fd
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function AlertingFlyout(props: Props) {
const { addFlyoutVisible, setAddFlyoutVisibility, ruleType } = props;

const serviceName = useServiceName();
const { query } = useApmParams('/*');
const { query, path } = useApmParams('/*');

const rangeFrom = 'rangeFrom' in query ? query.rangeFrom : undefined;
const rangeTo = 'rangeTo' in query ? query.rangeTo : undefined;
Expand All @@ -40,6 +40,9 @@ export function AlertingFlyout(props: Props) {
'environment' in query ? query.environment : ENVIRONMENT_ALL.value;
const transactionType =
'transactionType' in query ? query.transactionType : undefined;
const transactionName =
'transactionName' in query ? query.transactionName : undefined;
const errorGroupingKey = 'groupId' in path ? path.groupId : undefined;

const { services } = useKibana<ApmPluginStartDeps>();
const initialValues = getInitialAlertValues(ruleType, serviceName);
Expand All @@ -62,6 +65,8 @@ export function AlertingFlyout(props: Props) {
environment,
serviceName,
...(ruleType === ApmRuleType.ErrorCount ? {} : { transactionType }),
transactionName,
errorGroupingKey,
start,
end,
} as AlertMetadata,
Expand All @@ -73,6 +78,8 @@ export function AlertingFlyout(props: Props) {
onCloseAddFlyout,
services.triggersActionsUi,
serviceName,
transactionName,
errorGroupingKey,
transactionType,
environment,
start,
Expand Down

0 comments on commit af806fd

Please sign in to comment.