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

[7.14] [Metrics UI] Correct inaccurate offsetting for non-rate aggregations inside of metrics threshold alerts (#106947) #107167

Merged
merged 3 commits into from
Jul 29, 2021

Conversation

phillipb
Copy link
Contributor

Backports the following commits to 7.14:

…inside of metrics threshold alerts (elastic#106947)

* Don't skip last bucket for most aggs

* Allow alerting on partial buckets for certain aggs

* Fix test, PR feedback, and some comments

* Remove all offset logic for date_range aggs

* Remove code comment

* Add delivery delay

* Fix the date range for query

* Add TODO
@phillipb phillipb enabled auto-merge (squash) July 29, 2021 14:20
@kibanamachine
Copy link
Contributor

💛 Build succeeded, but was flaky


Test Failures

Kibana Pipeline / general / Firefox UI Functional Tests.test/functional/apps/discover/_field_data·ts.discover app discover tab field data the search term should be highlighted in the field data

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has failed 8 times on tracked branches: https://github.com/elastic/kibana/issues/100437

[00:00:00]       │
[00:08:35]         └-: discover app
[00:08:35]           └-> "before all" hook in "discover app"
[00:08:35]           └-> "before all" hook in "discover app"
[00:08:35]           └-: discover tab
[00:08:35]             └-> "before all" hook in "discover tab"
[00:08:35]             └-> "before all" hook in "discover tab"
[00:08:35]               │ debg Cleaning all saved objects { space: undefined }
[00:08:35]               │ info deleting batch of 1 objects
[00:08:36]               │ succ deleted 1 objects
[00:08:36]               │ debg resolved import for test/functional/fixtures/kbn_archiver/discover.json to /dev/shm/workspace/parallel/9/kibana/test/functional/fixtures/kbn_archiver/discover.json
[00:08:36]               │ info importing 2 saved objects { space: undefined }
[00:08:36]               │ info [o.e.c.m.MetadataMappingService] [node-01] [.kibana_7.14.0_001/oEhrn6lTRR2fAwuP3ngE-w] update_mapping [_doc]
[00:08:37]               │ succ import success
[00:08:37]               │ info [test/functional/fixtures/es_archiver/logstash_functional] Loading "mappings.json"
[00:08:37]               │ info [test/functional/fixtures/es_archiver/logstash_functional] Loading "data.json.gz"
[00:08:37]               │ info [o.e.c.m.MetadataCreateIndexService] [node-01] [logstash-2015.09.22] creating index, cause [api], templates [], shards [1]/[0]
[00:08:37]               │ info [test/functional/fixtures/es_archiver/logstash_functional] Created index "logstash-2015.09.22"
[00:08:37]               │ debg [test/functional/fixtures/es_archiver/logstash_functional] "logstash-2015.09.22" settings {"index":{"analysis":{"analyzer":{"url":{"max_token_length":"1000","tokenizer":"uax_url_email","type":"standard"}}},"number_of_replicas":"0","number_of_shards":"1"}}
[00:08:37]               │ info [o.e.c.m.MetadataCreateIndexService] [node-01] [logstash-2015.09.20] creating index, cause [api], templates [], shards [1]/[0]
[00:08:37]               │ info [test/functional/fixtures/es_archiver/logstash_functional] Created index "logstash-2015.09.20"
[00:08:37]               │ debg [test/functional/fixtures/es_archiver/logstash_functional] "logstash-2015.09.20" settings {"index":{"analysis":{"analyzer":{"url":{"max_token_length":"1000","tokenizer":"uax_url_email","type":"standard"}}},"number_of_replicas":"0","number_of_shards":"1"}}
[00:08:37]               │ info [o.e.c.m.MetadataCreateIndexService] [node-01] [logstash-2015.09.21] creating index, cause [api], templates [], shards [1]/[0]
[00:08:37]               │ info [test/functional/fixtures/es_archiver/logstash_functional] Created index "logstash-2015.09.21"
[00:08:37]               │ debg [test/functional/fixtures/es_archiver/logstash_functional] "logstash-2015.09.21" settings {"index":{"analysis":{"analyzer":{"url":{"max_token_length":"1000","tokenizer":"uax_url_email","type":"standard"}}},"number_of_replicas":"0","number_of_shards":"1"}}
[00:08:47]               │ info progress: 11134
[00:08:50]               │ info [test/functional/fixtures/es_archiver/logstash_functional] Indexed 4633 docs into "logstash-2015.09.22"
[00:08:50]               │ info [test/functional/fixtures/es_archiver/logstash_functional] Indexed 4757 docs into "logstash-2015.09.20"
[00:08:50]               │ info [test/functional/fixtures/es_archiver/logstash_functional] Indexed 4614 docs into "logstash-2015.09.21"
[00:08:50]               │ debg replacing kibana config doc: {"defaultIndex":"logstash-*","discover:searchFieldsFromSource":true}
[00:08:51]               │ debg applying update to kibana config: {"timepicker:timeDefaults":"{ \"from\": \"2015-09-18T06:31:44.000Z\", \"to\": \"2015-09-23T18:31:44.000Z\"}"}
[00:08:52]               │ debg navigating to discover url: http://localhost:6191/app/discover#/
[00:08:52]               │ debg navigate to: http://localhost:6191/app/discover#/
[00:08:52]               │ debg browser[log] "^ A single error about an inline script not firing due to content security policy is expected!"
[00:08:52]               │ debg ... sleep(700) start
[00:08:53]               │ debg ... sleep(700) end
[00:08:53]               │ debg returned from get, calling refresh
[00:08:54]               │ debg browser[log] "^ A single error about an inline script not firing due to content security policy is expected!"
[00:08:56]               │ debg currentUrl = http://localhost:6191/app/discover#/
[00:08:56]               │          appUrl = http://localhost:6191/app/discover#/
[00:08:56]               │ debg TestSubjects.find(kibanaChrome)
[00:08:56]               │ debg Find.findByCssSelector('[data-test-subj="kibanaChrome"]') with timeout=60000
[00:08:57]               │ debg ... sleep(501) start
[00:08:57]               │ debg ... sleep(501) end
[00:08:57]               │ debg in navigateTo url = http://localhost:6191/app/discover#/?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:%272015-09-18T06:31:44.000Z%27,to:%272015-09-23T18:31:44.000Z%27))&_a=(columns:!(_source),filters:!(),index:%27logstash-*%27,interval:auto,query:(language:kuery,query:%27%27),sort:!(!(%27@timestamp%27,desc)))
[00:08:57]               │ debg --- retry.tryForTime error: URL changed, waiting for it to settle
[00:08:58]               │ debg ... sleep(501) start
[00:08:58]               │ debg ... sleep(501) end
[00:08:58]               │ debg in navigateTo url = http://localhost:6191/app/discover#/?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:%272015-09-18T06:31:44.000Z%27,to:%272015-09-23T18:31:44.000Z%27))&_a=(columns:!(_source),filters:!(),index:%27logstash-*%27,interval:auto,query:(language:kuery,query:%27%27),sort:!(!(%27@timestamp%27,desc)))
[00:08:58]             └-: field data
[00:08:58]               └-> "before all" hook for "search php should show the correct hit count"
[00:08:58]               └-> search php should show the correct hit count
[00:08:58]                 └-> "before each" hook: global before each for "search php should show the correct hit count"
[00:08:58]                 │ debg QueryBar.setQuery(php)
[00:08:58]                 │ debg TestSubjects.click(queryInput)
[00:08:58]                 │ debg Find.clickByCssSelector('[data-test-subj="queryInput"]') with timeout=10000
[00:08:58]                 │ debg Find.findByCssSelector('[data-test-subj="queryInput"]') with timeout=10000
[00:08:59]                 │ info [o.e.c.m.MetadataMappingService] [node-01] [.kibana_7.14.0_001/oEhrn6lTRR2fAwuP3ngE-w] update_mapping [_doc]
[00:09:01]                 │ debg TestSubjects.getAttribute(queryInput, value, tryTimeout=120000, findTimeout=10000)
[00:09:01]                 │ debg TestSubjects.find(queryInput)
[00:09:01]                 │ debg Find.findByCssSelector('[data-test-subj="queryInput"]') with timeout=10000
[00:09:02]                 │ debg QueryBar.submitQuery
[00:09:02]                 │ debg TestSubjects.click(queryInput)
[00:09:02]                 │ debg Find.clickByCssSelector('[data-test-subj="queryInput"]') with timeout=10000
[00:09:02]                 │ debg Find.findByCssSelector('[data-test-subj="queryInput"]') with timeout=10000
[00:09:02]                 │ debg isGlobalLoadingIndicatorVisible
[00:09:02]                 │ debg TestSubjects.exists(globalLoadingIndicator)
[00:09:02]                 │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="globalLoadingIndicator"]') with timeout=1500
[00:09:03]                 │ debg TestSubjects.exists(globalLoadingIndicator-hidden)
[00:09:03]                 │ debg Find.existsByCssSelector('[data-test-subj="globalLoadingIndicator-hidden"]') with timeout=100000
[00:09:04]                 │ info [o.e.c.m.MetadataMappingService] [node-01] [.kibana_7.14.0_001/oEhrn6lTRR2fAwuP3ngE-w] update_mapping [_doc]
[00:09:05]                 │ debg isGlobalLoadingIndicatorVisible
[00:09:05]                 │ debg TestSubjects.exists(globalLoadingIndicator)
[00:09:05]                 │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="globalLoadingIndicator"]') with timeout=1500
[00:09:07]                 │ debg --- retry.tryForTime error: [data-test-subj="globalLoadingIndicator"] is not displayed
[00:09:07]                 │ debg TestSubjects.exists(globalLoadingIndicator-hidden)
[00:09:07]                 │ debg Find.existsByCssSelector('[data-test-subj="globalLoadingIndicator-hidden"]') with timeout=100000
[00:09:07]                 │ debg TestSubjects.getVisibleText(discoverQueryHits)
[00:09:07]                 │ debg TestSubjects.find(discoverQueryHits)
[00:09:07]                 │ debg Find.findByCssSelector('[data-test-subj="discoverQueryHits"]') with timeout=10000
[00:09:07]                 └- ✓ pass  (9.2s) "discover app discover tab field data search php should show the correct hit count"
[00:09:07]               └-> the search term should be highlighted in the field data
[00:09:07]                 └-> "before each" hook: global before each for "the search term should be highlighted in the field data"
[00:09:07]                 │ debg QueryBar.setQuery(php)
[00:09:07]                 │ debg TestSubjects.click(queryInput)
[00:09:07]                 │ debg Find.clickByCssSelector('[data-test-subj="queryInput"]') with timeout=10000
[00:09:07]                 │ debg Find.findByCssSelector('[data-test-subj="queryInput"]') with timeout=10000
[00:09:08]                 │ debg TestSubjects.getAttribute(queryInput, value, tryTimeout=120000, findTimeout=10000)
[00:09:08]                 │ debg TestSubjects.find(queryInput)
[00:09:08]                 │ debg Find.findByCssSelector('[data-test-subj="queryInput"]') with timeout=10000
[00:09:08]                 │ debg QueryBar.submitQuery
[00:09:08]                 │ debg TestSubjects.click(queryInput)
[00:09:08]                 │ debg Find.clickByCssSelector('[data-test-subj="queryInput"]') with timeout=10000
[00:09:08]                 │ debg Find.findByCssSelector('[data-test-subj="queryInput"]') with timeout=10000
[00:09:09]                 │ debg isGlobalLoadingIndicatorVisible
[00:09:09]                 │ debg TestSubjects.exists(globalLoadingIndicator)
[00:09:09]                 │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="globalLoadingIndicator"]') with timeout=1500
[00:09:09]                 │ debg TestSubjects.exists(globalLoadingIndicator-hidden)
[00:09:09]                 │ debg Find.existsByCssSelector('[data-test-subj="globalLoadingIndicator-hidden"]') with timeout=100000
[00:09:11]                 │ debg TestSubjects.moveMouseTo(field-extension)
[00:09:11]                 │ debg TestSubjects.find(field-extension)
[00:09:11]                 │ debg Find.findByCssSelector('[data-test-subj="field-extension"]') with timeout=10000
[00:09:11]                 │ debg TestSubjects.click(fieldToggle-extension)
[00:09:11]                 │ debg Find.clickByCssSelector('[data-test-subj="fieldToggle-extension"]') with timeout=10000
[00:09:11]                 │ debg Find.findByCssSelector('[data-test-subj="fieldToggle-extension"]') with timeout=10000
[00:09:11]                 │ debg TestSubjects.find(docTable)
[00:09:11]                 │ debg Find.findByCssSelector('[data-test-subj="docTable"]') with timeout=10000
[00:09:12]                 │ debg Firefox stdout: 1627576328892	Marionette	WARN	TimedPromise timed out after 500 ms: stacktrace:
[00:09:12]                 │      TimedPromise/<@chrome://marionette/content/sync.js:228:19
[00:09:12]                 │      TimedPromise@chrome://marionette/content/sync.js:213:10
[00:09:12]                 │      interaction.flushEventLoop@chrome://marionette/content/interaction.js:418:10
[00:09:12]                 │      webdriverClickElement@chrome://marionette/content/interaction.js:179:31
[00:09:12]                 │
[00:09:12]                 │ info Taking screenshot "/dev/shm/workspace/parallel/9/kibana/test/functional/screenshots/failure/discover app discover tab field data the search term should be highlighted in the field data.png"
[00:09:13]                 │ info Current URL is: http://localhost:6191/app/discover#/?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:%272015-09-18T06:31:44.000Z%27,to:%272015-09-23T18:31:44.000Z%27))&_a=(columns:!(extension),filters:!(),index:%27logstash-*%27,interval:auto,query:(language:kuery,query:php),sort:!(!(%27@timestamp%27,desc)))
[00:09:13]                 │ info Saving page source to: /dev/shm/workspace/parallel/9/kibana/test/functional/failure_debug/html/discover app discover tab field data the search term should be highlighted in the field data.html
[00:09:13]                 └- ✖ fail: discover app discover tab field data the search term should be highlighted in the field data
[00:09:13]                 │      StaleElementReferenceError: The element reference of <mark> is stale; either the element is no longer attached to the DOM, it is not in the current frame context, or the document has been refreshed
[00:09:13]                 │       at Object.throwDecodedError (node_modules/selenium-webdriver/lib/error.js:550:15)
[00:09:13]                 │       at parseHttpResponse (node_modules/selenium-webdriver/lib/http.js:565:13)
[00:09:13]                 │       at Executor.execute (node_modules/selenium-webdriver/lib/http.js:491:26)
[00:09:13]                 │       at runMicrotasks (<anonymous>)
[00:09:13]                 │       at processTicksAndRejections (internal/process/task_queues.js:95:5)
[00:09:13]                 │       at Task.exec (test/functional/services/remote/prevent_parallel_calls.ts:28:20)
[00:09:13]                 │ 
[00:09:13]                 │ 

Stack Trace

StaleElementReferenceError: The element reference of <mark> is stale; either the element is no longer attached to the DOM, it is not in the current frame context, or the document has been refreshed
    at Object.throwDecodedError (node_modules/selenium-webdriver/lib/error.js:550:15)
    at parseHttpResponse (node_modules/selenium-webdriver/lib/http.js:565:13)
    at Executor.execute (node_modules/selenium-webdriver/lib/http.js:491:26)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at Task.exec (test/functional/services/remote/prevent_parallel_calls.ts:28:20) {
  remoteStacktrace: 'WebDriverError@chrome://marionette/content/error.js:181:5\n' +
    'StaleElementReferenceError@chrome://marionette/content/error.js:442:5\n' +
    'get@chrome://marionette/content/element.js:239:13\n' +
    'evaluate.fromJSON@chrome://marionette/content/evaluate.js:242:26\n' +
    'dispatch/</req<@chrome://marionette/content/listener.js:101:29\n' +
    'dispatch/<@chrome://marionette/content/listener.js:100:15\n'
}

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@phillipb phillipb merged commit faca703 into elastic:7.14 Jul 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants