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

Unable to create a Watch with a Range query on a Long field using the max value for Java's Long #87723

Open
mcpate opened this issue Jan 7, 2021 · 1 comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Watcher Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more triage_needed

Comments

@mcpate
Copy link

mcpate commented Jan 7, 2021

Kibana version:
7.10.0

Elasticsearch version:
7.10.0

Server OS version:
Elastic Cloud

Browser version:
Chrome 87.0.4280.88

Browser OS version:

Original install method (e.g. download page, yum, from source, etc.):

Describe the bug:
I'm trying to create several Watches in Kibana based on a templated Watch definition (everything will be in the Watch's "metadata"). Each watch will use a range query on a Long field that uses slightly different upper/lower bounds. The range query looks like this:

                  "range": {
                    "account.deployments.total_capacity_active": {
                      "gte": "{{ctx.metadata.min_capacity_inclusive}}",
                      "lt": "{{ctx.metadata.max_capacity_exclusive}}"
                    }
                  }

For one of these watches, I'd like to use the following values for the range:

  • "gte": 10000000000000
  • "lt": 9223372036854775807 , where 9223372036854775807 is (2^63)-1 which is Java's Long.MAX_VALUE

It seems that in order to use 9223372036854775807 I have to make it a String in the metadata:

  "metadata": {
    "min_capacity_inclusive": 10000000000000,
    "max_capacity_exclusive": 9223372036854775807, <-- this DOES NOT work when I try to save/simulate the watch in Kibana
    "max_capacity_exclusive": "9223372036854775807", <-- this DOES work
    "min_capacity_inclusive_human": "10TB",
    "max_capacity_exclusive_human": "Long.MAX_VALUE TB",
    "window": "24h",
    "runbook_url": "link"
  }

The bug here is that I need to quote the 9223372036854775807 value to be able to save or simulate the watch even though this should be a value allowed by Elasticsearch. Furthermore, performing this range query works fine using DevTools which indicates different handling between the Watcher page and the DevTools page.

Steps to reproduce:
Try to create a watch that uses a range query with the above Long values. This will fail unless the 9223372036854775807 is wrapped in quotes.

Expected behavior:
Since 9223372036854775807 is a valid value for a Long field in Elasticsearch, I would expect that the Watcher UI would allow this to be passed in. At a minimum it would be nice to display an error describing the issue and that quotes are required.

Screenshots (if relevant):
N/A

Errors in browser console (if relevant):
None

Provide logs and/or server output (if relevant):

Any additional context:

@myasonik myasonik added bug Fixes for quality problems that affect the customer experience Feature:Watcher Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more triage_needed labels Jan 8, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/es-ui (Team:Elasticsearch UI)

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:Watcher Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more triage_needed
Projects
None yet
Development

No branches or pull requests

3 participants