When the endpoint is not found (eg. when API is down), Metrics are not updated.
Error:
TypeError: Cannot read properties of undefined (reading 'status')
at ...\node_modules\axios-prometheus-adapter\dist\lib\AxiosPrometheusAdapter.js:35:41
Workaround: Maybe when error.response is undefined/null, then asume status code 500 and read values from error.request._currentRequest (if _currentRequest exists, else "UNKNOWN" can be put as value on all labels, as final fallback).
When the endpoint is not found (eg. when API is down), Metrics are not updated.
Error:
AxiosPrometheusAdapter.js:
Code: https://github.com/PauloPepp/axios-prometheus-adapter/blob/c13c24a7b8d7fb91869de9a79b5f5858ab58a291/lib/AxiosPrometheusAdapter.ts#L46
DEBUG:
Workaround: Maybe when
error.response
is undefined/null, then asume status code 500 and read values fromerror.request._currentRequest
(if_currentRequest
exists, else "UNKNOWN" can be put as value on all labels, as final fallback).