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

[Uptime] Fixed metric query broken because of missing mapping #68999

Merged
merged 6 commits into from
Jun 12, 2020

Conversation

shahzad31
Copy link
Contributor

@shahzad31 shahzad31 commented Jun 12, 2020

Summary

Fixes: #69000

Make sure to access fields only when they are present in scripted metric query.

@shahzad31 shahzad31 requested a review from andrewvc June 12, 2020 12:18
@shahzad31 shahzad31 marked this pull request as ready for review June 12, 2020 12:24
@shahzad31 shahzad31 requested a review from a team as a code owner June 12, 2020 12:24
@botelastic botelastic bot added the Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability label Jun 12, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/uptime (Team:uptime)

Copy link
Contributor

@andrewvc andrewvc left a comment

Choose a reason for hiding this comment

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

LGTM Pending @justinkambic 's approval. Had to add some brackets

Copy link
Contributor

@justinkambic justinkambic left a comment

Choose a reason for hiding this comment

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

I tested this locally as well (failure on master/7.8, succeeds with this patch), LGTM

Copy link
Contributor

@justinkambic justinkambic left a comment

Choose a reason for hiding this comment

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

I re-tested to ensure the monitor details page shows the x509 field data correctly. Still LGTM

@kibanamachine
Copy link
Contributor

💛 Build succeeded, but was flaky


Test Failures

Kibana Pipeline / kibana-oss-agent / Example plugin functional tests.test/examples/embeddables/adding_children·ts.embeddable explorer creating and adding children Can create a new child

Link to Jenkins

Standard Out

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

[00:00:00]       │
[00:00:28]         └-: embeddable explorer
[00:00:28]           └-> "before all" hook
[00:00:28]           └-> "before all" hook
[00:00:28]             │ debg navigating to embeddableExplorer url: http://localhost:6121/app/embeddableExplorer
[00:00:28]             │ debg navigate to: http://localhost:6121/app/embeddableExplorer
[00:00:28]             │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-16-tests-xl-1591979424286248319] [.kibana] creating index, cause [auto(bulk api)], templates [], shards [1]/[1], mappings []
[00:00:28]             │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-16-tests-xl-1591979424286248319] [.kibana/PmChlKdJQW253Eio46q_pw] create_mapping
[00:00:29]             │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-16-tests-xl-1591979424286248319] [.kibana/PmChlKdJQW253Eio46q_pw] update_mapping [_doc]
[00:00:29]             │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-16-tests-xl-1591979424286248319] [.kibana/PmChlKdJQW253Eio46q_pw] update_mapping [_doc]
[00:00:29]             │ debg browser[DEBUG] http://localhost:6121/9007199254740991/bundles/plugin/usageCollection/usageCollection.plugin.js 951:16 "Reporting application changed to undefined"
[00:00:29]             │ debg browser[DEBUG] http://localhost:6121/9007199254740991/bundles/plugin/usageCollection/usageCollection.plugin.js 951:16 "Reporting application changed to undefined"
[00:00:29]             │ debg browser[DEBUG] http://localhost:6121/9007199254740991/bundles/plugin/usageCollection/usageCollection.plugin.js 951:16 "Error Sending Metrics Report TypeError: Failed to fetch"
[00:00:29]             │ debg browser[INFO] http://localhost:6121/app/embeddableExplorer?_t=1591981508123 341 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:00:29]             │
[00:00:29]             │ debg browser[INFO] http://localhost:6121/bundles/app/core/bootstrap.js 11:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:00:29]             │ debg ... sleep(700) start
[00:00:30]             │ debg ... sleep(700) end
[00:00:30]             │ debg returned from get, calling refresh
[00:00:30]             │ debg browser[INFO] http://localhost:6121/app/embeddableExplorer?_t=1591981508123 341 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:00:30]             │
[00:00:30]             │ debg browser[INFO] http://localhost:6121/bundles/app/core/bootstrap.js 11:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:00:30]             │ debg currentUrl = http://localhost:6121/app/embeddableExplorer
[00:00:30]             │          appUrl = http://localhost:6121/app/embeddableExplorer
[00:00:30]             │ debg TestSubjects.find(kibanaChrome)
[00:00:30]             │ debg Find.findByCssSelector('[data-test-subj="kibanaChrome"]') with timeout=60000
[00:00:32]             │ debg browser[INFO] http://localhost:6121/9007199254740991/bundles/plugin/testbed/testbed.plugin.js 172:12 "Testbed plugin set up. uiProp: 'Accessible from client'"
[00:00:32]             │ debg browser[WARNING] http://localhost:6121/9007199254740991/bundles/core/core.entry.js 44017:18 "App [dev_tools] is using deprecated mount context. Use core.getStartServices() instead."
[00:00:32]             │ debg browser[INFO] http://localhost:6121/9007199254740991/bundles/kbn-ui-shared-deps/kbn-ui-shared-deps.js 395:106115 "INFO: 2020-06-12T17:05:11Z
[00:00:32]             │        Adding connection to http://localhost:6121/elasticsearch
[00:00:32]             │
[00:00:32]             │      "
[00:00:32]             │ debg browser[WARNING] http://localhost:6121/9007199254740991/bundles/core/core.entry.js 44017:18 "App [management] is using deprecated mount context. Use core.getStartServices() instead."
[00:00:32]             │ debg browser[DEBUG] http://localhost:6121/9007199254740991/bundles/plugin/usageCollection/usageCollection.plugin.js 951:16 "Reporting user-agent."
[00:00:32]             │ debg browser[INFO] http://localhost:6121/9007199254740991/bundles/plugin/testbed/testbed.plugin.js 180:12 "Testbed plugin started"
[00:00:32]             │ debg browser[DEBUG] http://localhost:6121/9007199254740991/bundles/plugin/usageCollection/usageCollection.plugin.js 951:16 "Reporting application changed to embeddableExplorer"
[00:00:32]             │ debg ... sleep(501) start
[00:00:32]             │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-16-tests-xl-1591979424286248319] [.kibana/PmChlKdJQW253Eio46q_pw] update_mapping [_doc]
[00:00:32]             │ debg ... sleep(501) end
[00:00:32]             │ debg in navigateTo url = http://localhost:6121/app/embeddableExplorer
[00:00:32]             │ debg TestSubjects.exists(statusPageContainer)
[00:00:32]             │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="statusPageContainer"]') with timeout=2500
[00:00:35]             │ debg --- retry.tryForTime error: [data-test-subj="statusPageContainer"] is not displayed
[00:00:38]           └-: creating and adding children
[00:00:38]             └-> "before all" hook
[00:00:38]             └-> "before all" hook
[00:00:38]               │ debg TestSubjects.click(embeddablePanelExamplae)
[00:00:38]               │ debg Find.clickByCssSelector('[data-test-subj="embeddablePanelExamplae"]') with timeout=10000
[00:00:38]               │ debg Find.findByCssSelector('[data-test-subj="embeddablePanelExamplae"]') with timeout=10000
[00:00:38]             └-> Can create a new child
[00:00:38]               └-> "before each" hook: global before each
[00:00:38]               │ debg TestSubjects.click(embeddablePanelToggleMenuIcon)
[00:00:38]               │ debg Find.clickByCssSelector('[data-test-subj="embeddablePanelToggleMenuIcon"]') with timeout=10000
[00:00:38]               │ debg Find.findByCssSelector('[data-test-subj="embeddablePanelToggleMenuIcon"]') with timeout=10000
[00:00:38]               │ debg TestSubjects.click(embeddablePanelAction-ACTION_ADD_PANEL)
[00:00:38]               │ debg Find.clickByCssSelector('[data-test-subj="embeddablePanelAction-ACTION_ADD_PANEL"]') with timeout=10000
[00:00:38]               │ debg Find.findByCssSelector('[data-test-subj="embeddablePanelAction-ACTION_ADD_PANEL"]') with timeout=10000
[00:00:38]               │ debg TestSubjects.click(createNew)
[00:00:38]               │ debg Find.clickByCssSelector('[data-test-subj="createNew"]') with timeout=10000
[00:00:38]               │ debg Find.findByCssSelector('[data-test-subj="createNew"]') with timeout=10000
[00:00:39]               │ debg TestSubjects.click(createNew-TODO_EMBEDDABLE)
[00:00:39]               │ debg Find.clickByCssSelector('[data-test-subj="createNew-TODO_EMBEDDABLE"]') with timeout=10000
[00:00:39]               │ debg Find.findByCssSelector('[data-test-subj="createNew-TODO_EMBEDDABLE"]') with timeout=10000
[00:00:49]               │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="createNew-TODO_EMBEDDABLE"])
[00:00:49]               │      Wait timed out after 10041ms
[00:00:49]               │ debg Find.findByCssSelector('[data-test-subj="createNew-TODO_EMBEDDABLE"]') with timeout=10000
[00:00:59]               │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="createNew-TODO_EMBEDDABLE"])
[00:00:59]               │      Wait timed out after 10018ms
[00:01:00]               │ debg Find.findByCssSelector('[data-test-subj="createNew-TODO_EMBEDDABLE"]') with timeout=10000
[00:01:10]               │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="createNew-TODO_EMBEDDABLE"])
[00:01:10]               │      Wait timed out after 10037ms
[00:01:10]               │ debg Find.findByCssSelector('[data-test-subj="createNew-TODO_EMBEDDABLE"]') with timeout=10000
[00:01:20]               │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="createNew-TODO_EMBEDDABLE"])
[00:01:20]               │      Wait timed out after 10052ms
[00:01:21]               │ debg Find.findByCssSelector('[data-test-subj="createNew-TODO_EMBEDDABLE"]') with timeout=10000
[00:01:31]               │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="createNew-TODO_EMBEDDABLE"])
[00:01:31]               │      Wait timed out after 10037ms
[00:01:31]               │ debg Find.findByCssSelector('[data-test-subj="createNew-TODO_EMBEDDABLE"]') with timeout=10000
[00:01:41]               │ debg --- retry.try failed again with the same message...
[00:01:42]               │ debg Find.findByCssSelector('[data-test-subj="createNew-TODO_EMBEDDABLE"]') with timeout=10000
[00:01:52]               │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="createNew-TODO_EMBEDDABLE"])
[00:01:52]               │      Wait timed out after 10028ms
[00:01:52]               │ debg Find.findByCssSelector('[data-test-subj="createNew-TODO_EMBEDDABLE"]') with timeout=10000
[00:02:02]               │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="createNew-TODO_EMBEDDABLE"])
[00:02:02]               │      Wait timed out after 10040ms
[00:02:03]               │ debg Find.findByCssSelector('[data-test-subj="createNew-TODO_EMBEDDABLE"]') with timeout=10000
[00:02:13]               │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="createNew-TODO_EMBEDDABLE"])
[00:02:13]               │      Wait timed out after 10031ms
[00:02:13]               │ debg Find.findByCssSelector('[data-test-subj="createNew-TODO_EMBEDDABLE"]') with timeout=10000
[00:02:23]               │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="createNew-TODO_EMBEDDABLE"])
[00:02:23]               │      Wait timed out after 10008ms
[00:02:24]               │ debg Find.findByCssSelector('[data-test-subj="createNew-TODO_EMBEDDABLE"]') with timeout=10000
[00:02:34]               │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="createNew-TODO_EMBEDDABLE"])
[00:02:34]               │      Wait timed out after 10054ms
[00:02:35]               │ debg Find.findByCssSelector('[data-test-subj="createNew-TODO_EMBEDDABLE"]') with timeout=10000
[00:02:45]               │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="createNew-TODO_EMBEDDABLE"])
[00:02:45]               │      Wait timed out after 10038ms
[00:02:45]               │ info Taking screenshot "/dev/shm/workspace/kibana/test/functional/screenshots/failure/embeddable explorer creating and adding children Can create a new child.png"
[00:02:45]               │ info Current URL is: http://localhost:6121/app/embeddableExplorer/embeddablePanelExamplae
[00:02:45]               │ info Saving page source to: /dev/shm/workspace/kibana/test/examples/failure_debug/html/embeddable explorer creating and adding children Can create a new child.html
[00:02:45]               └- ✖ fail: "embeddable explorer creating and adding children Can create a new child"
[00:02:45]               │

Stack Trace

Error: retry.try timeout: TimeoutError: Waiting for element to be located By(css selector, [data-test-subj="createNew-TODO_EMBEDDABLE"])
Wait timed out after 10038ms
    at /dev/shm/workspace/kibana/node_modules/selenium-webdriver/lib/webdriver.js:842:17
    at process._tickCallback (internal/process/next_tick.js:68:7)
    at onFailure (test/common/services/retry/retry_for_success.ts:28:9)
    at retryForSuccess (test/common/services/retry/retry_for_success.ts:68:13)

History

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

@shahzad31 shahzad31 merged commit f8cad12 into elastic:master Jun 12, 2020
@shahzad31 shahzad31 deleted the fix-missing-mapping-issue branch June 12, 2020 22:34
shahzad31 added a commit to shahzad31/kibana that referenced this pull request Jun 12, 2020
…c#68999)

Co-authored-by: Andrew Cholakian <andrew@andrewvc.com>
shahzad31 added a commit to shahzad31/kibana that referenced this pull request Jun 12, 2020
…c#68999)

Co-authored-by: Andrew Cholakian <andrew@andrewvc.com>
shahzad31 added a commit that referenced this pull request Jun 13, 2020
#69090)

Co-authored-by: Andrew Cholakian <andrew@andrewvc.com>

Co-authored-by: Andrew Cholakian <andrew@andrewvc.com>
shahzad31 added a commit that referenced this pull request Jun 13, 2020
#69091)

Co-authored-by: Andrew Cholakian <andrew@andrewvc.com>

Co-authored-by: Andrew Cholakian <andrew@andrewvc.com>
gmmorris added a commit to gmmorris/kibana that referenced this pull request Jun 15, 2020
* master: (91 commits)
  [Search][BUG] Call wrong search strategy recursively in async search (elastic#69116)
  [Observability] Create context container to enable Observability plugin registry function (elastic#68642)
  Rename space id for disabled index pattern test (elastic#68990)
  skip flaky suite (elastic#63339)
  Resolver Light Theme And Kibana Integration (elastic#67859)
  [kbn/dev-utils] expose public tooling_log module (elastic#68868)
  index pattern(s) take dependencies as object (elastic#69055)
  include ci-stats metrics in pr comment (elastic#68563)
  Bump webpack packages (elastic#68716)
  [Uptime] Fixed metric query broken because of missing mapping (elastic#68999)
  Added cloud as an optional dependency (elastic#69050)
  Fixed all external links (elastic#68614)
  [DOCS] Reorganizes doc nav to match new Kibana nav (elastic#69069)
  [Endpoint] Using the stats provided by the backend for resolver UI (elastic#68577)
  [DOCS] Removees 8.0 from Upgrade Assistant docs (elastic#69067)
  [ML] Fix cloud deployment ID check (elastic#68695)
  [DOCS] Move metrics app content to metrics monitoring guide (elastic#69033)
  Add ingest manager topic to docs (elastic#68980)
  [SECURITY SOLUTION] EMT-401: add policy data to metadata and fix tests (elastic#68582)
  [DOCS] Fixes POST request for saved objects (elastic#69036)
  ...
gmmorris added a commit to gmmorris/kibana that referenced this pull request Jun 15, 2020
* master: (60 commits)
  Re-enable mistakenly skipped tests. (elastic#69123)
  [Search][BUG] Call wrong search strategy recursively in async search (elastic#69116)
  [Observability] Create context container to enable Observability plugin registry function (elastic#68642)
  Rename space id for disabled index pattern test (elastic#68990)
  skip flaky suite (elastic#63339)
  Resolver Light Theme And Kibana Integration (elastic#67859)
  [kbn/dev-utils] expose public tooling_log module (elastic#68868)
  index pattern(s) take dependencies as object (elastic#69055)
  include ci-stats metrics in pr comment (elastic#68563)
  Bump webpack packages (elastic#68716)
  [Uptime] Fixed metric query broken because of missing mapping (elastic#68999)
  Added cloud as an optional dependency (elastic#69050)
  Fixed all external links (elastic#68614)
  [DOCS] Reorganizes doc nav to match new Kibana nav (elastic#69069)
  [Endpoint] Using the stats provided by the backend for resolver UI (elastic#68577)
  [DOCS] Removees 8.0 from Upgrade Assistant docs (elastic#69067)
  [ML] Fix cloud deployment ID check (elastic#68695)
  [DOCS] Move metrics app content to metrics monitoring guide (elastic#69033)
  Add ingest manager topic to docs (elastic#68980)
  [SECURITY SOLUTION] EMT-401: add policy data to metadata and fix tests (elastic#68582)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:fix Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability v7.9.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Uptime] Missing tls.x509 breaks scripted metric query
5 participants