hastic-zzz / hastic-server

Hastic data management server for analyzing patterns and anomalies from Grafana
GNU General Public License v3.0
330 stars 23 forks source link

Bad UX: Error: Please configure HASTIC_API_KEY #818

Open jonyrock-back opened 4 years ago

jonyrock-back commented 4 years ago

This is what I get when I try to run hastic-server

/home/corp/temp_projects/hastic/hastic-server/server/dist/server-dev.js:164
            throw new Error(`Please configure ${field}`);
            ^

Error: Please configure HASTIC_API_KEY
    at getConfigField (/home/corp/temp_projects/hastic/hastic-server/server/dist/server-dev.js:164:19)
    at Object../src/config.ts (/home/corp/temp_projects/hastic/hastic-server/server/dist/server-dev.js:128:26)
    at __webpack_require__ (/home/corp/temp_projects/hastic/hastic-server/server/dist/server-dev.js:20:30)
    at Object../src/services/data_layer/index.ts (/home/corp/temp_projects/hastic/hastic-server/server/dist/server-dev.js:3172:18)
    at __webpack_require__ (/home/corp/temp_projects/hastic/hastic-server/server/dist/server-dev.js:20:30)
    at Object../src/services/data_service.ts (/home/corp/temp_projects/hastic/hastic-server/server/dist/server-dev.js:3882:22)
    at __webpack_require__ (/home/corp/temp_projects/hastic/hastic-server/server/dist/server-dev.js:20:30)
    at Object../src/models/analytic_unit_cache_model.ts (/home/corp/temp_projects/hastic/hastic-server/server/dist/server-dev.js:1151:24)
    at __webpack_require__ (/home/corp/temp_projects/hastic/hastic-server/server/dist/server-dev.js:20:30)
    at Object../src/controllers/analytics_controller.ts (/home/corp/temp_projects/hastic/hastic-server/server/dist/server-dev.js:268:27)

I see exception! I think we should now show any exception in production mode. To be more user friendly, we can print a link where user can learn more about this error.

jonyrock-back commented 4 years ago

I think we should be able to run hastic-server without HASTIC_API_KEY, it would be great if user can configure this in panel in hastic datasource config.