Skip to content

Conversation

kderusso
Copy link
Member

@kderusso kderusso commented Nov 6, 2024

This PR adds tracking for query rule types.

The List Query Rulesets PR has been updated to include total rule types. Here is an example updated response:

{
  "count": 2,
  "results": [
    {
      "ruleset_id": "my-ruleset",
      "rule_total_count": 3,
      "rule_criteria_types_counts": {
        "always": 3
      },
      "rule_type_counts": {
        "exclude": 1,
        "pinned": 2
      }
    },
    {
      "ruleset_id": "my-ruleset2",
      "rule_total_count": 3,
      "rule_criteria_types_counts": {
        "always": 3
      },
      "rule_type_counts": {
        "exclude": 1,
        "pinned": 2
      }
    }
  ]
}

The _xpack/usage call also propagates these stats. Here is an example of the updated enterprise_search section:

"enterprise_search": {
    "available": true,
    "enabled": true,
    "search_applications": {
      "count": 0
    },
    "analytics_collections": {
      "count": 0
    },
    "query_rulesets": {
      "total_rule_count": 6,
      "rule_criteria_total_counts": {
        "always": 6
      },
      "total_count": 2,
      "min_rule_count": 3,
      "max_rule_count": 3,
      "rule_type_total_counts": {
        "pinned": 4,
        "exclude": 2
      }
    }
  }

@kderusso kderusso added >enhancement auto-backport Automatically create backport pull requests when merged :SearchOrg/Relevance Label for the Search (solution/org) Relevance team v8.16.1 v8.15.5 labels Nov 6, 2024
@elasticsearchmachine
Copy link
Collaborator

Hi @kderusso, I've created a changelog YAML for you.

@kderusso kderusso force-pushed the kderusso/query-rules-type-stats branch from 3b117bc to 09b6eca Compare November 6, 2024 20:29
@elastic elastic deleted a comment from github-actions bot Nov 6, 2024
@kderusso kderusso force-pushed the kderusso/query-rules-type-stats branch from b4f66d4 to aaeac5b Compare November 7, 2024 18:22
@kderusso kderusso force-pushed the kderusso/query-rules-type-stats branch from aaeac5b to 14e925b Compare November 7, 2024 18:24
@kderusso kderusso marked this pull request as ready for review November 7, 2024 19:31
@kderusso kderusso requested a review from a team November 7, 2024 19:31
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/search-eng (Team:SearchOrg)

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/search-relevance (Team:Search - Relevance)

setup:
- requires:
cluster_features: [ "gte_v8.10.0" ]
reason: Introduced in 8.10.0
Copy link
Contributor

Choose a reason for hiding this comment

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

is this going to be an issue when we backport to 8.x? not saying we should necessarily change it here, but maybe when we backport we might need to?

@markjhoy markjhoy enabled auto-merge (squash) November 13, 2024 14:02
@markjhoy markjhoy disabled auto-merge November 13, 2024 14:35
@markjhoy
Copy link
Contributor

buildkite test this

@markjhoy markjhoy enabled auto-merge (squash) November 13, 2024 15:04
@markjhoy markjhoy merged commit 1b03a96 into elastic:main Nov 13, 2024
16 of 17 checks passed
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
8.16 Commit could not be cherrypicked due to conflicts
8.15 Commit could not be cherrypicked due to conflicts

You can use sqren/backport to manually backport by running backport --upstream elastic/elasticsearch --pr 116357

@markjhoy
Copy link
Contributor

@ioanatia and @kderusso - I was able to get this merged - however, backporting this to the 8.16 and 8.15 branches are failing - and trying to run backport --upstream elastic/elasticsearch --pr 116357 is showing a good amount of changes - especially in the TransportVersions.java file - which could be tricky if these changes are pushed there... any ideas / guidance?

smalyshev pushed a commit to smalyshev/elasticsearch that referenced this pull request Nov 13, 2024
* Add total rule type counts to list calls and xpack usage

* Add feature

* Update docs/changelog/116357.yaml

* Fix docs test failure & update yaml tests

* remove additional spaces

---------

Co-authored-by: Mark J. Hoy <[email protected]>
afoucret pushed a commit to afoucret/elasticsearch that referenced this pull request Nov 14, 2024
* Add total rule type counts to list calls and xpack usage

* Add feature

* Update docs/changelog/116357.yaml

* Fix docs test failure & update yaml tests

* remove additional spaces

---------

Co-authored-by: Mark J. Hoy <[email protected]>
@afoucret
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

Questions ?

Please refer to the Backport tool documentation

afoucret pushed a commit to afoucret/elasticsearch that referenced this pull request Nov 14, 2024
* Add total rule type counts to list calls and xpack usage

* Add feature

* Update docs/changelog/116357.yaml

* Fix docs test failure & update yaml tests

* remove additional spaces

---------

Co-authored-by: Mark J. Hoy <[email protected]>
(cherry picked from commit 1b03a96)
markjhoy pushed a commit that referenced this pull request Nov 14, 2024
* Add total rule type counts to list calls and xpack usage

* Add feature

* Update docs/changelog/116357.yaml

* Fix docs test failure & update yaml tests

* remove additional spaces

---------

Co-authored-by: Mark J. Hoy <[email protected]>
(cherry picked from commit 1b03a96)

Co-authored-by: Kathleen DeRusso <[email protected]>
markjhoy added a commit to markjhoy/elasticsearch that referenced this pull request Nov 14, 2024
markjhoy added a commit that referenced this pull request Nov 14, 2024
markjhoy added a commit to markjhoy/elasticsearch that referenced this pull request Nov 14, 2024
alexey-ivanov-es pushed a commit to alexey-ivanov-es/elasticsearch that referenced this pull request Nov 28, 2024
* Add total rule type counts to list calls and xpack usage

* Add feature

* Update docs/changelog/116357.yaml

* Fix docs test failure & update yaml tests

* remove additional spaces

---------

Co-authored-by: Mark J. Hoy <[email protected]>
@kderusso kderusso deleted the kderusso/query-rules-type-stats branch January 24, 2025 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically create backport pull requests when merged backport pending >enhancement :SearchOrg/Relevance Label for the Search (solution/org) Relevance team v8.15.5 v8.16.1 v9.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants