appmetrics-elk icon indicating copy to clipboard operation
appmetrics-elk copied to clipboard

TypeError: esearch.searchExists is not a function

Open alexanderjsx opened this issue 8 years ago • 5 comments

Getting Type error on fresh installation:

    at Object.monitor (/Users/ajakoba/KWIFF_REPOS/core/core-logging/node_modules/appmetrics-elk/lib/appmetrics-elk.js:70:13)
    at Object.<anonymous> (/Users/ajakoba/KWIFF_REPOS/core/core-logging/index.js:2:27)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Function.Module.runMain (module.js:441:10)
    at startup (node.js:139:18)
    at node.js:974:3

elasticsearch node module version installed with the library is 12.1.3 elasticsearch server version 5.1.1 node version v4.6.1

alexanderjsx avatar Dec 27 '16 11:12 alexanderjsx

It looks like the searchExists() API was removed in the easticsearch.js 5.0 API update.

As a workaround, you should be able to request the 2.4 API using the apiVersion field in the Elasticsearch config object you pass to the monitor() API of appmetrics-elk, eg.

var config = {
    apiVersion = '2.4'
}
var appmetrics = require('appmetrics-elk').monitor(config); 

seabaylea avatar Dec 28 '16 10:12 seabaylea

Solution of @seabaylea works for me

arjanvanderleden avatar Jan 16 '17 09:01 arjanvanderleden

[Mon Aug 21 18:08:45 2017] com.ibm.diagnostics.healthcenter.loader INFO: Node Application Metrics 1.2.0.201612012154 (Agent Core 3.1.0) [Mon Aug 21 18:08:45 2017] com.ibm.diagnostics.healthcenter.mqtt INFO: Connecting to broker localhost:1883 /project/academic/node_modules/appmetrics-elk/lib/appmetrics-elk.js:70 esearch.searchExists({ ^

TypeError: esearch.searchExists is not a function at Object.monitor (/project/academic/node_modules/appmetrics-elk/lib/appmetrics-elk.js:70:13) at Object. (/project/academic/app.js:31:44) at Module._compile (module.js:570:32) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3) at Module.runMain (module.js:604:10) at run (bootstrap_node.js:394:7) at startup (bootstrap_node.js:149:9)

node -version: 6.10 elastic server -varsion: 5.5

I try above api version but it not working, help me

imvishalsingh avatar Aug 21 '17 12:08 imvishalsingh

var config = { host: 'http://172.28.49.13:9200', apiVersion: 2.4 } var appmetrics = require('appmetrics-elk').monitor(); appmetrics.disable('mysql'); // disable MySQL monitoring

imvishalsingh avatar Aug 21 '17 12:08 imvishalsingh

I updated package.json to: "appmetrics": "^3.0.0", "elasticsearch": "13.3.1"

This work around no longer works apparently. Maybe apiVersion can't go back that far? Any ideas?

ggb667 avatar Jan 08 '18 20:01 ggb667