Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Stack Monitoring] Empty include array in terms aggregation fails to retrieve logstash pipelines #202020

Closed
consulthys opened this issue Nov 27, 2024 · 0 comments · Fixed by #202039
Assignees
Labels
bug Fixes for quality problems that affect the customer experience Feature:Stack Monitoring Team:Monitoring Stack Monitoring team

Comments

@consulthys
Copy link
Contributor

Describe the bug:

In Stack Monitoring, when retrieving Logstash pipelines to be displayed on the Logstash > Pipelines page, the aggregation query might contain an empty "include": [] array, which has the nasty effect of... excluding everything

"by_pipeline_id": {
	"terms": {
		"field": "logstash.node.stats.pipelines.id",
		"size": 1000,
		"include": []                 <---------- Culprit
	},

Steps to reproduce:

The issue can easily be reproduced with the following test:

Test

POST test/_bulk
{"index":{}}
{"test": "foo"}
{"index":{}}
{"test": "bar"}

# returns both keywords
POST test/_search
{
  "size": 0,
  "aggs": {
    "fields": {
      "terms": {
        "field": "test.keyword"
      }
    }
  }
}

# returns no keywords
POST test/_search
{
  "size": 0,
  "aggs": {
    "fields": {
      "terms": {
        "field": "test.keyword",
        "include": []
      }
    }
  }
}

Expected behavior:

If the include array is empty, it should not be included at all in the terms aggregation query.

"by_pipeline_id": {
	"terms": {
		"field": "logstash.node.stats.pipelines.id",
		"size": 1000
	},
@consulthys consulthys added bug Fixes for quality problems that affect the customer experience Feature:Stack Monitoring Team:Monitoring Stack Monitoring team labels Nov 27, 2024
@consulthys consulthys self-assigned this Nov 27, 2024
kibanamachine pushed a commit to kibanamachine/kibana that referenced this issue Nov 28, 2024
…stash pipelines (elastic#202039)

## Summary

This PR fixes the query that retrieves Logstash pipeline stats and
metrics to be displayed in Stack Monitoring. The problem with the
existing query is that a `terms` aggregation contains an empty
`"include": []` filtering array, but that has the nasty effect of
excluding everything and not returning anything, hence the screen is
empty.

The fix is to only add the `include` array if it's not empty. The PR
also fixes a wrong field name used in a cardinality aggregation:
`logstash.node.stats.logstash.uuid` instead of
`logstash_stats.logstash.uuid`

Closes elastic#202020

### Checklist

- [X] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.

---------

Co-authored-by: Chris Earle <[email protected]>
(cherry picked from commit b7e46bd)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this issue Nov 28, 2024
…stash pipelines (elastic#202039)

## Summary

This PR fixes the query that retrieves Logstash pipeline stats and
metrics to be displayed in Stack Monitoring. The problem with the
existing query is that a `terms` aggregation contains an empty
`"include": []` filtering array, but that has the nasty effect of
excluding everything and not returning anything, hence the screen is
empty.

The fix is to only add the `include` array if it's not empty. The PR
also fixes a wrong field name used in a cardinality aggregation:
`logstash.node.stats.logstash.uuid` instead of
`logstash_stats.logstash.uuid`

Closes elastic#202020

### Checklist

- [X] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.

---------

Co-authored-by: Chris Earle <[email protected]>
(cherry picked from commit b7e46bd)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this issue Nov 28, 2024
…stash pipelines (elastic#202039)

## Summary

This PR fixes the query that retrieves Logstash pipeline stats and
metrics to be displayed in Stack Monitoring. The problem with the
existing query is that a `terms` aggregation contains an empty
`"include": []` filtering array, but that has the nasty effect of
excluding everything and not returning anything, hence the screen is
empty.

The fix is to only add the `include` array if it's not empty. The PR
also fixes a wrong field name used in a cardinality aggregation:
`logstash.node.stats.logstash.uuid` instead of
`logstash_stats.logstash.uuid`

Closes elastic#202020

### Checklist

- [X] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.

---------

Co-authored-by: Chris Earle <[email protected]>
(cherry picked from commit b7e46bd)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this issue Nov 28, 2024
…stash pipelines (elastic#202039)

## Summary

This PR fixes the query that retrieves Logstash pipeline stats and
metrics to be displayed in Stack Monitoring. The problem with the
existing query is that a `terms` aggregation contains an empty
`"include": []` filtering array, but that has the nasty effect of
excluding everything and not returning anything, hence the screen is
empty.

The fix is to only add the `include` array if it's not empty. The PR
also fixes a wrong field name used in a cardinality aggregation:
`logstash.node.stats.logstash.uuid` instead of
`logstash_stats.logstash.uuid`

Closes elastic#202020

### Checklist

- [X] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.

---------

Co-authored-by: Chris Earle <[email protected]>
(cherry picked from commit b7e46bd)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this issue Nov 28, 2024
…stash pipelines (elastic#202039)

## Summary

This PR fixes the query that retrieves Logstash pipeline stats and
metrics to be displayed in Stack Monitoring. The problem with the
existing query is that a `terms` aggregation contains an empty
`"include": []` filtering array, but that has the nasty effect of
excluding everything and not returning anything, hence the screen is
empty.

The fix is to only add the `include` array if it's not empty. The PR
also fixes a wrong field name used in a cardinality aggregation:
`logstash.node.stats.logstash.uuid` instead of
`logstash_stats.logstash.uuid`

Closes elastic#202020

### Checklist

- [X] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.

---------

Co-authored-by: Chris Earle <[email protected]>
(cherry picked from commit b7e46bd)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this issue Nov 28, 2024
…stash pipelines (elastic#202039)

## Summary

This PR fixes the query that retrieves Logstash pipeline stats and
metrics to be displayed in Stack Monitoring. The problem with the
existing query is that a `terms` aggregation contains an empty
`"include": []` filtering array, but that has the nasty effect of
excluding everything and not returning anything, hence the screen is
empty.

The fix is to only add the `include` array if it's not empty. The PR
also fixes a wrong field name used in a cardinality aggregation:
`logstash.node.stats.logstash.uuid` instead of
`logstash_stats.logstash.uuid`

Closes elastic#202020

### Checklist

- [X] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.

---------

Co-authored-by: Chris Earle <[email protected]>
(cherry picked from commit b7e46bd)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this issue Nov 28, 2024
…stash pipelines (elastic#202039)

## Summary

This PR fixes the query that retrieves Logstash pipeline stats and
metrics to be displayed in Stack Monitoring. The problem with the
existing query is that a `terms` aggregation contains an empty
`"include": []` filtering array, but that has the nasty effect of
excluding everything and not returning anything, hence the screen is
empty.

The fix is to only add the `include` array if it's not empty. The PR
also fixes a wrong field name used in a cardinality aggregation:
`logstash.node.stats.logstash.uuid` instead of
`logstash_stats.logstash.uuid`

Closes elastic#202020

### Checklist

- [X] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.

---------

Co-authored-by: Chris Earle <[email protected]>
(cherry picked from commit b7e46bd)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this issue Nov 28, 2024
…stash pipelines (elastic#202039)

## Summary

This PR fixes the query that retrieves Logstash pipeline stats and
metrics to be displayed in Stack Monitoring. The problem with the
existing query is that a `terms` aggregation contains an empty
`"include": []` filtering array, but that has the nasty effect of
excluding everything and not returning anything, hence the screen is
empty.

The fix is to only add the `include` array if it's not empty. The PR
also fixes a wrong field name used in a cardinality aggregation:
`logstash.node.stats.logstash.uuid` instead of
`logstash_stats.logstash.uuid`

Closes elastic#202020

### Checklist

- [X] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.

---------

Co-authored-by: Chris Earle <[email protected]>
(cherry picked from commit b7e46bd)
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this issue Dec 12, 2024
…stash pipelines (elastic#202039)

## Summary

This PR fixes the query that retrieves Logstash pipeline stats and
metrics to be displayed in Stack Monitoring. The problem with the
existing query is that a `terms` aggregation contains an empty
`"include": []` filtering array, but that has the nasty effect of
excluding everything and not returning anything, hence the screen is
empty.

The fix is to only add the `include` array if it's not empty. The PR
also fixes a wrong field name used in a cardinality aggregation:
`logstash.node.stats.logstash.uuid` instead of
`logstash_stats.logstash.uuid`

Closes elastic#202020

### Checklist

- [X] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.

---------

Co-authored-by: Chris Earle <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Stack Monitoring Team:Monitoring Stack Monitoring team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant