Skip to content

Commit

Permalink
One line fix for telemetry of cases (elastic#122477) (elastic#122711)
Browse files Browse the repository at this point in the history
## Summary

One line fix to make telemetry work for `cases` across spaces. Previously `cases` would only work from the `default` space where this fixes it by adding the one liner of: `namespaces: ['*'],` to work across all spaces for telemetry.

**Manual testing**

Create a new space such as "test":
<img width="1375" alt="Screen Shot 2022-01-06 at 4 10 17 PM" src="https://user-images.githubusercontent.com/1151048/148465490-bce93905-4fb9-4ba2-96b0-4be08fdd1616.png">

Create a rule and activate it within a space:
<img width="1197" alt="Screen Shot 2022-01-06 at 4 11 25 PM" src="https://user-images.githubusercontent.com/1151048/148465498-bd2e2177-f901-42e0-ad68-c509448a86d4.png">

Add an alert to a new or existing case:
<img width="437" alt="Screen Shot 2022-01-06 at 4 11 39 PM" src="https://user-images.githubusercontent.com/1151048/148465555-31340929-b842-4dd8-a523-5bc10ef54cfc.png">

Go the stack management -> advanced -> usage data -> and click "cluster data":
<img width="1688" alt="Screen Shot 2022-01-06 at 4 14 09 PM" src="https://user-images.githubusercontent.com/1151048/148465661-3ee7bc3f-aaaf-4d5c-aa47-6d758485482c.png">

You should see a fly out with cases greater than zero now:
<img width="790" alt="Screen Shot 2022-01-06 at 4 12 26 PM" src="https://user-images.githubusercontent.com/1151048/148465580-60667876-dbaa-41fb-b298-56a879fc6209.png">

### Checklist

- [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios

No functional tests exist with cases and telemetry at the moment so nothing could be updated. Adding them will require probably someone from the case team to start them or we will have to do cross collaboration for it. For now, I just made the fix without e2e tests to get this in. There aren't dashboards with cases + alerts at the moment so if this breaks this part of telemetry it's not a big deal at the moment.

(cherry picked from commit 8acf3be)

Co-authored-by: Frank Hassanabad <frank.hassanabad@elastic.co>
  • Loading branch information
kibanamachine and FrankHassanabad committed Jan 11, 2022
1 parent c4c32bd commit d355176
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ export const getDetectionRuleMetrics = async (
type: CASE_COMMENT_SAVED_OBJECT,
page: 1,
perPage: MAX_RESULTS_WINDOW,
namespaces: ['*'],
filter: `${CASE_COMMENT_SAVED_OBJECT}.attributes.type: alert`,
});

Expand Down

0 comments on commit d355176

Please sign in to comment.