Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Fix issue that nothing is in 'Time field' dropdown when defining monitors by visual graph #222

Merged
merged 2 commits into from Dec 9, 2020

Conversation

ftianli-amzn
Copy link

@ftianli-amzn ftianli-amzn commented Dec 8, 2020

Issue #, if available:
image

In the console:

Alerting - ElasticsearchService - getMappings: { TypeError: Body can not be sent with method "GET"
    at Transport.request (/Users/ftianli/Github/kibana_7.9.1/node_modules/elasticsearch/src/lib/transport.js:215:7)
    at exec (/Users/ftianli/Github/kibana_7.9.1/node_modules/elasticsearch/src/lib/client_action.js:403:20)
    at ClientNamespace.call [as getMapping] (/Users/ftianli/Github/kibana_7.9.1/node_modules/elasticsearch/src/lib/client_action.js:61:16)
    at Promise (/Users/ftianli/Github/kibana_7.9.1/src/core/server/elasticsearch/legacy/cluster_client.ts:66:27)
    at new Promise (<anonymous>)
    at callAPI (/Users/ftianli/Github/kibana_7.9.1/src/core/server/elasticsearch/legacy/cluster_client.ts:65:18)
    at LegacyScopedClusterClient.scopedAPICaller (/Users/ftianli/Github/kibana_7.9.1/src/core/server/elasticsearch/legacy/cluster_client.ts:239:18)
    at LegacyScopedClusterClient.callAsCurrentUser (/Users/ftianli/Github/kibana_7.9.1/src/core/server/elasticsearch/legacy/scoped_cluster_client.ts:115:17)
    at handler (/Users/ftianli/Github/kibana_7.9.1/plugins/alerting-kibana-plugin/server/services/ElasticsearchService.js:112:30)
    at /Users/ftianli/Github/kibana_7.9.1/src/core/utils/context.ts:248:14
    at process._tickCallback (internal/process/next_tick.js:68:7) body: undefined, status: undefined }

Description of changes:
The body in the HTTP requests of the API calls of get alias, get indices and get mappings were not organized correctly during the migration to new Kibana platform (#209)

It caused nothing shows up in the 'Time field' dropdown menu when defining monitors by visual graph.

  • Organize the request body as an object to make it have got correct name-value pairs
  • Make the validation of the http requests more accurate, but it's not mandatory
  • Fix a typo in a handler of the http request

With the changes in the PR, the "time field" can be read and selected:
image

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ftianli-amzn ftianli-amzn merged commit 777c137 into opendistro-for-elasticsearch:master Dec 9, 2020
@ftianli-amzn ftianli-amzn deleted the fix_defining_by_graph branch December 9, 2020 19:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants