Skip to content

[Alerting] Add snapshot telemetry for _ignored fields#221480

Merged
maryam-saeidi merged 12 commits intoelastic:mainfrom
maryam-saeidi:220815-add-ignored-field-telemetry
May 28, 2025
Merged

[Alerting] Add snapshot telemetry for _ignored fields#221480
maryam-saeidi merged 12 commits intoelastic:mainfrom
maryam-saeidi:220815-add-ignored-field-telemetry

Conversation

@maryam-saeidi
Copy link
Member

@maryam-saeidi maryam-saeidi commented May 26, 2025

Closes #220815

Summary

This PR adds telemetry for _ignored fields. The goal is to have an alert based on this field and get notified in case a user hits the mapping limit, but by default, we don't expect this to happen.

This PR adds count_ignored_fields_by_rule_type field that counts the number of _ignored fields per rule type.

In the future, we can extend the telemetry data to also include the actual number of mappings over the limit (there is a feature request for adding field count information to index API)

How to test

  • Add a lot of dynamic fields as mentioned here: Auto increase fields limit of the alert indices #216719
  • Create a rule with a custom threshold rule with multiple group by fields to generate an alert with _ignored field
  • Run the following API and check the value of count_ignored_fields_by_rule_type
    POST kbn:/internal/telemetry/clusters/_stats?apiVersion=2
    {
      "unencrypted": true,
      "refreshCache": true
    }
    
Here is what it looks like:

image

image

@maryam-saeidi maryam-saeidi self-assigned this May 26, 2025
@github-actions github-actions bot added the author:obs-ux-management PRs authored by the obs ux management team label May 26, 2025
@maryam-saeidi maryam-saeidi removed the author:obs-ux-management PRs authored by the obs ux management team label May 26, 2025
@github-actions github-actions bot added the author:obs-ux-management PRs authored by the obs ux management team label May 26, 2025
@maryam-saeidi
Copy link
Member Author

/ci

@maryam-saeidi
Copy link
Member Author

/ci

@maryam-saeidi maryam-saeidi added release_note:skip Skip the PR/issue when compiling release notes backport:version Backport to applied version labels v9.1.0 v8.19.0 labels May 27, 2025
@maryam-saeidi maryam-saeidi marked this pull request as ready for review May 27, 2025 13:07
@maryam-saeidi maryam-saeidi requested review from a team as code owners May 27, 2025 13:07
Copy link
Member

@afharo afharo left a comment

Choose a reason for hiding this comment

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

Telemetry changes LGTM

@maryam-saeidi maryam-saeidi requested a review from ymao1 May 28, 2025 08:21
Copy link
Contributor

@ymao1 ymao1 left a comment

Choose a reason for hiding this comment

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

Response Ops changes LGTM

@maryam-saeidi maryam-saeidi enabled auto-merge (squash) May 28, 2025 15:18
@maryam-saeidi maryam-saeidi merged commit cde7a86 into elastic:main May 28, 2025
11 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.19

https://github.com/elastic/kibana/actions/runs/15304969318

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Unknown metric groups

ESLint disabled line counts

id before after diff
alerting 91 92 +1

Total ESLint disabled count

id before after diff
alerting 98 99 +1

History

cc @maryam-saeidi

@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.19 Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 221480

Questions ?

Please refer to the Backport tool documentation

akowalska622 pushed a commit to akowalska622/kibana that referenced this pull request May 29, 2025
Closes elastic#220815

## Summary

This PR adds telemetry for _ignored fields. The goal is to have an alert
based on this field and get notified in case a user hits the mapping
limit, but by default, we don't expect this to happen.

This PR adds `count_ignored_fields_by_rule_type` field that counts the
number of _ignored fields per rule type.

In the future, we can extend the telemetry data to also include the
actual number of mappings over the limit (there is a [feature
request](elastic/elasticsearch#68947) for
adding field count information to index API)

### How to test

- Add a lot of dynamic fields as mentioned here:
elastic#216719
- Create a rule with a custom threshold rule with multiple group by
fields to generate an alert with _ignored field
- Run the following API and check the value of
`count_ignored_fields_by_rule_type`
  ```
  POST kbn:/internal/telemetry/clusters/_stats?apiVersion=2
  {
    "unencrypted": true,
    "refreshCache": true
  }
  ```

<details>
<summary> Here is what it looks like:</summary>


![image](https://github.com/user-attachments/assets/bb71bde1-9002-4f96-9b84-3e4c7b6f0aed)


![image](https://github.com/user-attachments/assets/725fda41-454b-4ed0-a2dc-40796729bc19)


</details>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label May 30, 2025
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 221480 locally
cc: @maryam-saeidi

@maryam-saeidi
Copy link
Member Author

💚 All backports created successfully

Status Branch Result
8.19

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

maryam-saeidi added a commit to maryam-saeidi/kibana that referenced this pull request Jun 2, 2025
Closes elastic#220815

## Summary

This PR adds telemetry for _ignored fields. The goal is to have an alert
based on this field and get notified in case a user hits the mapping
limit, but by default, we don't expect this to happen.

This PR adds `count_ignored_fields_by_rule_type` field that counts the
number of _ignored fields per rule type.

In the future, we can extend the telemetry data to also include the
actual number of mappings over the limit (there is a [feature
request](elastic/elasticsearch#68947) for
adding field count information to index API)

### How to test

- Add a lot of dynamic fields as mentioned here:
elastic#216719
- Create a rule with a custom threshold rule with multiple group by
fields to generate an alert with _ignored field
- Run the following API and check the value of
`count_ignored_fields_by_rule_type`
  ```
  POST kbn:/internal/telemetry/clusters/_stats?apiVersion=2
  {
    "unencrypted": true,
    "refreshCache": true
  }
  ```

<details>
<summary> Here is what it looks like:</summary>

![image](https://github.com/user-attachments/assets/bb71bde1-9002-4f96-9b84-3e4c7b6f0aed)

![image](https://github.com/user-attachments/assets/725fda41-454b-4ed0-a2dc-40796729bc19)

</details>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit cde7a86)

# Conflicts:
#	x-pack/platform/plugins/shared/alerting/server/usage/lib/get_telemetry_from_alerts.test.ts
@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @maryam-saeidi

maryam-saeidi added a commit that referenced this pull request Jun 3, 2025
#222150)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[Alerting] Add snapshot telemetry for _ignored fields
(#221480)](#221480)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Maryam
Saeidi","email":"maryam.saeidi@elastic.co"},"sourceCommit":{"committedDate":"2025-05-28T16:02:33Z","message":"[Alerting]
Add snapshot telemetry for _ignored fields (#221480)\n\nCloses
https://github.com/elastic/kibana/issues/220815\n\n## Summary\n\nThis PR
adds telemetry for _ignored fields. The goal is to have an alert\nbased
on this field and get notified in case a user hits the mapping\nlimit,
but by default, we don't expect this to happen.\n\nThis PR adds
`count_ignored_fields_by_rule_type` field that counts the\nnumber of
_ignored fields per rule type.\n\nIn the future, we can extend the
telemetry data to also include the\nactual number of mappings over the
limit (there is a
[feature\nrequest](elastic/elasticsearch#68947)
for\nadding field count information to index API)\n\n### How to
test\n\n- Add a lot of dynamic fields as mentioned
here:\nhttps://github.com//pull/216719\n- Create a rule
with a custom threshold rule with multiple group by\nfields to generate
an alert with _ignored field\n- Run the following API and check the
value of\n`count_ignored_fields_by_rule_type`\n ```\n POST
kbn:/internal/telemetry/clusters/_stats?apiVersion=2\n {\n
\"unencrypted\": true,\n \"refreshCache\": true\n }\n
```\n\n<details>\n<summary> Here is what it looks
like:</summary>\n\n\n![image](https://github.com/user-attachments/assets/bb71bde1-9002-4f96-9b84-3e4c7b6f0aed)\n\n\n![image](https://github.com/user-attachments/assets/725fda41-454b-4ed0-a2dc-40796729bc19)\n\n\n</details>\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"cde7a86287956467fffe4346a14a7fd24b99ff93","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport
missing","backport:version","v9.1.0","v8.19.0","author:obs-ux-management"],"title":"[Alerting]
Add snapshot telemetry for _ignored
fields","number":221480,"url":"https://github.com/elastic/kibana/pull/221480","mergeCommit":{"message":"[Alerting]
Add snapshot telemetry for _ignored fields (#221480)\n\nCloses
https://github.com/elastic/kibana/issues/220815\n\n## Summary\n\nThis PR
adds telemetry for _ignored fields. The goal is to have an alert\nbased
on this field and get notified in case a user hits the mapping\nlimit,
but by default, we don't expect this to happen.\n\nThis PR adds
`count_ignored_fields_by_rule_type` field that counts the\nnumber of
_ignored fields per rule type.\n\nIn the future, we can extend the
telemetry data to also include the\nactual number of mappings over the
limit (there is a
[feature\nrequest](elastic/elasticsearch#68947)
for\nadding field count information to index API)\n\n### How to
test\n\n- Add a lot of dynamic fields as mentioned
here:\nhttps://github.com//pull/216719\n- Create a rule
with a custom threshold rule with multiple group by\nfields to generate
an alert with _ignored field\n- Run the following API and check the
value of\n`count_ignored_fields_by_rule_type`\n ```\n POST
kbn:/internal/telemetry/clusters/_stats?apiVersion=2\n {\n
\"unencrypted\": true,\n \"refreshCache\": true\n }\n
```\n\n<details>\n<summary> Here is what it looks
like:</summary>\n\n\n![image](https://github.com/user-attachments/assets/bb71bde1-9002-4f96-9b84-3e4c7b6f0aed)\n\n\n![image](https://github.com/user-attachments/assets/725fda41-454b-4ed0-a2dc-40796729bc19)\n\n\n</details>\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"cde7a86287956467fffe4346a14a7fd24b99ff93"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/221480","number":221480,"mergeCommit":{"message":"[Alerting]
Add snapshot telemetry for _ignored fields (#221480)\n\nCloses
https://github.com/elastic/kibana/issues/220815\n\n## Summary\n\nThis PR
adds telemetry for _ignored fields. The goal is to have an alert\nbased
on this field and get notified in case a user hits the mapping\nlimit,
but by default, we don't expect this to happen.\n\nThis PR adds
`count_ignored_fields_by_rule_type` field that counts the\nnumber of
_ignored fields per rule type.\n\nIn the future, we can extend the
telemetry data to also include the\nactual number of mappings over the
limit (there is a
[feature\nrequest](elastic/elasticsearch#68947)
for\nadding field count information to index API)\n\n### How to
test\n\n- Add a lot of dynamic fields as mentioned
here:\nhttps://github.com//pull/216719\n- Create a rule
with a custom threshold rule with multiple group by\nfields to generate
an alert with _ignored field\n- Run the following API and check the
value of\n`count_ignored_fields_by_rule_type`\n ```\n POST
kbn:/internal/telemetry/clusters/_stats?apiVersion=2\n {\n
\"unencrypted\": true,\n \"refreshCache\": true\n }\n
```\n\n<details>\n<summary> Here is what it looks
like:</summary>\n\n\n![image](https://github.com/user-attachments/assets/bb71bde1-9002-4f96-9b84-3e4c7b6f0aed)\n\n\n![image](https://github.com/user-attachments/assets/725fda41-454b-4ed0-a2dc-40796729bc19)\n\n\n</details>\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"cde7a86287956467fffe4346a14a7fd24b99ff93"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Jun 3, 2025
@maryam-saeidi maryam-saeidi deleted the 220815-add-ignored-field-telemetry branch June 3, 2025 07:44
zacharyparikh pushed a commit to zacharyparikh/kibana that referenced this pull request Jun 4, 2025
Closes elastic#220815

## Summary

This PR adds telemetry for _ignored fields. The goal is to have an alert
based on this field and get notified in case a user hits the mapping
limit, but by default, we don't expect this to happen.

This PR adds `count_ignored_fields_by_rule_type` field that counts the
number of _ignored fields per rule type.

In the future, we can extend the telemetry data to also include the
actual number of mappings over the limit (there is a [feature
request](elastic/elasticsearch#68947) for
adding field count information to index API)

### How to test

- Add a lot of dynamic fields as mentioned here:
elastic#216719
- Create a rule with a custom threshold rule with multiple group by
fields to generate an alert with _ignored field
- Run the following API and check the value of
`count_ignored_fields_by_rule_type`
  ```
  POST kbn:/internal/telemetry/clusters/_stats?apiVersion=2
  {
    "unencrypted": true,
    "refreshCache": true
  }
  ```

<details>
<summary> Here is what it looks like:</summary>


![image](https://github.com/user-attachments/assets/bb71bde1-9002-4f96-9b84-3e4c7b6f0aed)


![image](https://github.com/user-attachments/assets/725fda41-454b-4ed0-a2dc-40796729bc19)


</details>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
nickpeihl pushed a commit to nickpeihl/kibana that referenced this pull request Jun 12, 2025
Closes elastic#220815

## Summary

This PR adds telemetry for _ignored fields. The goal is to have an alert
based on this field and get notified in case a user hits the mapping
limit, but by default, we don't expect this to happen.

This PR adds `count_ignored_fields_by_rule_type` field that counts the
number of _ignored fields per rule type.

In the future, we can extend the telemetry data to also include the
actual number of mappings over the limit (there is a [feature
request](elastic/elasticsearch#68947) for
adding field count information to index API)

### How to test

- Add a lot of dynamic fields as mentioned here:
elastic#216719
- Create a rule with a custom threshold rule with multiple group by
fields to generate an alert with _ignored field
- Run the following API and check the value of
`count_ignored_fields_by_rule_type`
  ```
  POST kbn:/internal/telemetry/clusters/_stats?apiVersion=2
  {
    "unencrypted": true,
    "refreshCache": true
  }
  ```

<details>
<summary> Here is what it looks like:</summary>


![image](https://github.com/user-attachments/assets/bb71bde1-9002-4f96-9b84-3e4c7b6f0aed)


![image](https://github.com/user-attachments/assets/725fda41-454b-4ed0-a2dc-40796729bc19)


</details>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author:obs-ux-management PRs authored by the obs ux management team backport:version Backport to applied version labels release_note:skip Skip the PR/issue when compiling release notes v8.19.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Observability Alerting] Add telemetry for number of mappings for each rule type

5 participants