appmetrics-elk
appmetrics-elk copied to clipboard
TypeError: esearch.searchExists is not a function
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
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);
Solution of @seabaylea works for me
[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.
node -version: 6.10 elastic server -varsion: 5.5
I try above api version but it not working, help me
var config = { host: 'http://172.28.49.13:9200', apiVersion: 2.4 } var appmetrics = require('appmetrics-elk').monitor(); appmetrics.disable('mysql'); // disable MySQL monitoring
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?