Johnathan_Huettner | 2023-03-07 22:35:30 UTC | #1
Hope I'm posting in the right forum! The built-in Genesys PureCloud Dashboards aren't really meeting our needs. I'd like to load Genesys data into Prometheus and be able to write our own queries and display the data using Grafana. That creates a need for a bridge to pull data out of the Genesys API and import it into Prometheus. I found Open Data Exporter at https://github.com/MyPureCloud/open-data-exporter which appears to be very much what we're looking for. However it looks like this tool hasn't really been used much and I'm running into problems using it. Environment is a Debian 11 Bullseye. We are in US West. I generated clientID and Secret, config.json looks like:
"purecloud": { "clientId": "REDACTED", "clientSecret": "REDACTED", "timeout": 10000, "environment": "https://api.usw2.pure.cloud" },
Throws error:
root@vmmonitor01:/usr/local/src/open-data-exporter/src# node index.js loading config from ./config.json Initializing logger for api at level silly error: uncaughtException: Cannot read property 'environment' of undefined date=Tue Mar 07 2023 14:16:53 GMT-0800 (Pacific Standard Time), pid=47359, uid=0, gid=0, cwd=/usr/local/src/open-data-exporter/src, execPath=/usr/bin/node, version=v12.22.12, argv=[/usr/bin/node, /usr/local/src/open-data-exporter/src/index.js], rss=59117568, heapTotal=29196288, heapUsed=12950008, external=1478749, arrayBuffers=73304, loadavg=[0, 0, 0], uptime=2418031, trace=[column=55, file=/usr/local/src/open-data-exporter/src/api.js, function=new Api, line=15, method=null, native=false, column=18, file=/usr/local/src/open-data-exporter/src/api.js, function=null, line=351, method=null, native=false, column=30, file=internal/modules/cjs/loader.js, function=Module.compile, line=999, method=compile, native=false, column=10, file=internal/modules/cjs/loader.js, function=Module.extensions..js, line=1027, method=.js, native=false, column=32, file=internal/modules/cjs/loader.js, function=Module.load, line=863, method=load, native=false, column=14, file=internal/modules/cjs/loader.js, function=Module.load, line=708, method=load, native=false, column=19, file=internal/modules/cjs/loader.js, function=Module.require, line=887, method=require, native=false, column=18, file=internal/modules/cjs/helpers.js, function=require, line=74, method=null, native=false, column=13, file=/usr/local/src/open-data-exporter/src/executor.js, function=null, line=11, method=null, native=false, column=30, file=internal/modules/cjs/loader.js, function=Module.compile, line=999, method=compile, native=false], stack=[TypeError: Cannot read property 'environment' of undefined, at new Api (/usr/local/src/open-data-exporter/src/api.js:15:55), at Object.<anonymous> (/usr/local/src/open-data-exporter/src/api.js:351:18), at Module.compile (internal/modules/cjs/loader.js:999:30), at Object.Module.extensions..js (internal/modules/cjs/loader.js:1027:10), at Module.load (internal/modules/cjs/loader.js:863:32), at Function.Module.load (internal/modules/cjs/loader.js:708:14), at Module.require (internal/modules/cjs/loader.js:887:19), at require (internal/modules/cjs/helpers.js:74:18), at Object.<anonymous> (/usr/local/src/open-data-exporter/src/executor.js:11:13), at Module._compile (internal/modules/cjs/loader.js:999:30)]
Any ideas?
jacobshaw | 2023-03-08 14:28:41 UTC | #2
Hi @Johnathan_Huettner I noticed that your configuration is under the object named purecloud but the repo looks for it in camel case like pureCloud. I'm not sure it's case sensitive or if there're other problems, but want to call that out for you to try before going more depth.
tim.smith | 2023-03-08 14:38:27 UTC | #3
Johnathan_Huettner, post:1, topic:18783
error: uncaughtException: Cannot read property 'environment'
Johnathan_Huettner, post:1, topic:18783
trace=[column=55, file=/usr/local/src/open-data-exporter/src/api.js, function=new Api, line=15,
Jacob is correct, the code requires the correct casing: https://github.com/MyPureCloud/open-data-exporter/blob/master/src/api.js#L15. The config file is documented here: https://github.com/MyPureCloud/open-data-exporter/wiki/Configuration-Files#purecloud.
Johnathan_Huettner | 2023-03-08 22:38:36 UTC | #4
Thank you all that fixed the problem!
John_Carnell | 2023-03-27 15:36:56 UTC | #5
This post was migrated from the old Developer Forum.
ref: 18783