Label quota metrics retrieval with the real status code - #6252
Conversation
Hello delthas,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
|
❌ 11 Tests Failed:
View the top 1 failed test(s) by shortest run time
View the full list of 12 ❄️ flaky test(s)
To view more test analytics, go to the Test Analytics Dashboard |
e34fa94 to
881d467
Compare
Prettier joins a long test title into a 122 character line it cannot break further, which trips the 120 column eslint limit, so silence max-len on that line. Issue: CLDSRV-971
scubaclient does not wrap errors, so axios failures reach the wrapper with the status on err.response.status and nothing on err.statusCode. The code label was therefore always 500, making it impossible to tell a scuba 404 from a genuine 5xx or from a connection failure. Read the status from the response, and fall back to the axios error code so transport failures surface their errno. There is no err.statusCode fallback: nothing in this path sets it, which is precisely why the label was always 500. Order matters, since axios also sets a code on responses it considers failures: on a 404 it reports ERR_BAD_REQUEST, so the response status has to win. Cover the retrieval label end to end in the SUR suite, where the scuba mock can return a 404 on demand, asserting both that a 404 is recorded and that it is not counted as a 500. Issue: CLDSRV-971
881d467 to
43f7fee
Compare
|
|
||
| function getMetrics(cb) { | ||
| return http | ||
| .get({ host: '127.0.0.1', path: '/metrics', port: s3Config.metricsPort }, res => { |
|
/approve |
|
!done 3h |
|
I have successfully merged the changeset of this pull request
The following branches have NOT changed:
This pull request did not target the following hotfix branch(es) so they
Please check the status of the associated issue CLDSRV-971. Goodbye delthas. The following options are set: approve |
|
|
lib/utilization/scuba/wrapper.jsderived the Prometheuscodelabel fromerr.statusCode. scubaclient does not wrap errors, so axios failures arrivewith the status on
err.response.statusand nothing onerr.statusCode, andthe label was always
500. A scuba 404 was indistinguishable from a genuine5xx or from a connection failure.
The label is now derived the way
lib/routes/veeam/utils.jsalready does it:Transport failures surface their errno (
ECONNREFUSED,ETIMEDOUT) ratherthan being reported as 500, so the label is no longer strictly numeric.
Issue: CLDSRV-971