Skip to content

Label quota metrics retrieval with the real status code - #6252

Merged
bert-e merged 2 commits into
development/9.4from
improvement/CLDSRV-971/quota-metrics-retrieval-code-label
Aug 13, 2026
Merged

Label quota metrics retrieval with the real status code#6252
bert-e merged 2 commits into
development/9.4from
improvement/CLDSRV-971/quota-metrics-retrieval-code-label

Conversation

@delthas

@delthas delthas commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

lib/utilization/scuba/wrapper.js derived the Prometheus code label from
err.statusCode. scubaclient does not wrap errors, so axios failures arrive
with the status on err.response.status and nothing on err.statusCode, and
the label was always 500. A scuba 404 was indistinguishable from a genuine
5xx or from a connection failure.

The label is now derived the way lib/routes/veeam/utils.js already does it:

code = err.response?.status || err.statusCode || err.code || 500;

Transport failures surface their errno (ECONNREFUSED, ETIMEDOUT) rather
than being reported as 500, so the label is no longer strictly numeric.

Issue: CLDSRV-971

@bert-e

bert-e commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Hello delthas,

My role is to assist you with the merge of this
pull request. Please type @bert-e help to get information
on this process, or consult the user documentation.

Available options
name description privileged authored
/after_pull_request Wait for the given pull request id to be merged before continuing with the current one.
/bypass_author_approval Bypass the pull request author's approval
/bypass_build_status Bypass the build and test status
/bypass_commit_size Bypass the check on the size of the changeset TBA
/bypass_incompatible_branch Bypass the check on the source branch prefix
/bypass_jira_check Bypass the Jira issue check
/bypass_peer_approval Bypass the pull request peers' approval
/bypass_leader_approval Bypass the pull request leaders' approval
/approve Instruct Bert-E that the author has approved the pull request. ✍️
/create_pull_requests Allow the creation of integration pull requests.
/create_integration_branches Allow the creation of integration branches.
/no_octopus Prevent Wall-E from doing any octopus merge and use multiple consecutive merge instead
/unanimity Change review acceptance criteria from one reviewer at least to all reviewers
/wait Instruct Bert-E not to run until further notice.
Available commands
name description privileged
/help Print Bert-E's manual in the pull request.
/status Print Bert-E's current status in the pull request.
/clear Remove all comments from Bert-E from the history TBA
/retry Re-start a fresh build TBA
/build Re-start a fresh build TBA
/force_reset Delete integration branches & pull requests, and restart merge process from the beginning.
/reset Try to remove integration branches unless there are commits on them which do not appear on the source branch.

Status report is not available.

@bert-e

bert-e commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • 2 peers

@delthas
delthas marked this pull request as ready for review August 12, 2026 14:02
@delthas
delthas requested review from a team, DarkIsDude and francoisferrand August 12, 2026 14:02
@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

❌ 11 Tests Failed:

Tests completed Failed Passed Skipped
9863 11 9852 0
View the top 1 failed test(s) by shortest run time
should create an encrypted bucket and upload an object::KMIP backed server-side encryption should create an encrypted bucket and upload an object
Stack Traces | 40s run time
Timeout of 40000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (.../functional/kmip/serverside_encryption.js)
View the full list of 12 ❄️ flaky test(s)
"after each" hook for "should batch delete 1000 objects quietly"::Multi-Object Delete Success "after each" hook for "should batch delete 1000 objects quietly"

Flake rate in main: 100.00% (Passed 0 times, Failed 1 times)

Stack Traces | 6.02s run time
The bucket you tried to delete is not empty.
"before each" hook for "should batch delete 1000 objects quietly"::Multi-Object Delete Success "before each" hook for "should batch delete 1000 objects quietly"

Flake rate in main: 100.00% (Passed 0 times, Failed 1 times)

Stack Traces | 5.42s run time
Socket timed out without establishing a connection within 5000 ms
"before each" hook for "should grant read access"::With default signature PUT Bucket ACL using predefined groups - authenticated request "before each" hook for "should grant read access"

Flake rate in main: 100.00% (Passed 0 times, Failed 9 times)

Stack Traces | 0.488s run time
We encountered an internal error. Please try again.
"before each" hook for "should grant read access"::With default signature PUT Bucket ACL using predefined groups - unauthenticated request "before each" hook for "should grant read access"

Flake rate in main: 100.00% (Passed 0 times, Failed 9 times)

Stack Traces | 0.075s run time
We encountered an internal error. Please try again.
"before each" hook for "should grant read access"::With default signature PUT Object ACL using predefined groups - authenticated request "before each" hook for "should grant read access"

Flake rate in main: 100.00% (Passed 0 times, Failed 9 times)

Stack Traces | 0.224s run time
We encountered an internal error. Please try again.
"before each" hook for "should grant read access"::With default signature PUT Object ACL using predefined groups - unauthenticated request "before each" hook for "should grant read access"

Flake rate in main: 100.00% (Passed 0 times, Failed 9 times)

Stack Traces | 0.506s run time
We encountered an internal error. Please try again.
"before each" hook for "should grant read access"::With v4 signature PUT Bucket ACL using predefined groups - authenticated request "before each" hook for "should grant read access"

Flake rate in main: 100.00% (Passed 0 times, Failed 9 times)

Stack Traces | 0.053s run time
We encountered an internal error. Please try again.
"before each" hook for "should grant read access"::With v4 signature PUT Bucket ACL using predefined groups - unauthenticated request "before each" hook for "should grant read access"

Flake rate in main: 100.00% (Passed 0 times, Failed 9 times)

Stack Traces | 0.099s run time
We encountered an internal error. Please try again.
"before each" hook for "should grant read access"::With v4 signature PUT Object ACL using predefined groups - authenticated request "before each" hook for "should grant read access"

Flake rate in main: 100.00% (Passed 0 times, Failed 9 times)

Stack Traces | 0.1s run time
We encountered an internal error. Please try again.
"before each" hook for "should grant read access"::With v4 signature PUT Object ACL using predefined groups - unauthenticated request "before each" hook for "should grant read access"

Flake rate in main: 100.00% (Passed 0 times, Failed 9 times)

Stack Traces | 0.035s run time
We encountered an internal error. Please try again.
should allow action on an object satisfying the wildcard in the policy::With default signature Bucket policies with resource statement should allow action on an object satisfying the wildcard in the policy

Flake rate in main: 13.81% (Passed 668 times, Failed 107 times)

Stack Traces | 40s run time
Timeout of 40000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (.../test/bucket/bucketPolicyWithResourceStatements.js)
should allow action on an object specified in the policy::With default signature Bucket policies with resource statement should allow action on an object specified in the policy

Flake rate in main: 13.81% (Passed 668 times, Failed 107 times)

Stack Traces | 40s run time
Timeout of 40000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (.../test/bucket/bucketPolicyWithResourceStatements.js)

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

Comment thread lib/utilization/scuba/wrapper.js Outdated
@delthas
delthas force-pushed the improvement/CLDSRV-971/quota-metrics-retrieval-code-label branch from e34fa94 to 881d467 Compare August 12, 2026 15:33
Comment thread lib/utilization/scuba/wrapper.js Outdated
Comment thread tests/unit/quotas/scuba/wrapper.js
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
@delthas
delthas force-pushed the improvement/CLDSRV-971/quota-metrics-retrieval-code-label branch from 881d467 to 43f7fee Compare August 13, 2026 08:10
Comment thread tests/sur/quota.js

function getMetrics(cb) {
return http
.get({ host: '127.0.0.1', path: '/metrics', port: s3Config.metricsPort }, res => {
@delthas

delthas commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

/approve

@delthas

delthas commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

!done 3h

@bert-e

bert-e commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

I have successfully merged the changeset of this pull request
into targetted development branches:

  • ✔️ development/9.4

The following branches have NOT changed:

  • development/7.10
  • development/7.4
  • development/7.70
  • development/8.8
  • development/9.0
  • development/9.1
  • development/9.2
  • development/9.3

This pull request did not target the following hotfix branch(es) so they
were left untouched:

  • hotfix/7.7.0
  • hotfix/7.10.8
  • hotfix/7.6.0
  • hotfix/7.4.4
  • hotfix/7.10.28
  • hotfix/7.4.6
  • hotfix/7.4.7
  • hotfix/9.2.36
  • hotfix/6.4.7
  • hotfix/7.70.11
  • hotfix/7.70.21
  • hotfix/7.4.1
  • hotfix/7.4.10
  • hotfix/7.10.49
  • hotfix/8.8.45
  • hotfix/7.4.0
  • hotfix/9.0.32
  • hotfix/7.8.0
  • hotfix/7.4.5
  • hotfix/7.10.2
  • hotfix/7.10.30
  • hotfix/7.70.51
  • hotfix/7.10.15
  • hotfix/7.70.73
  • hotfix/7.4.2
  • hotfix/7.10.27
  • hotfix/7.4.9
  • hotfix/9.0.7
  • hotfix/7.4.8
  • hotfix/7.10.0
  • hotfix/7.2.0
  • hotfix/7.10.1
  • hotfix/7.4.3
  • hotfix/7.10.3
  • hotfix/7.9.0
  • hotfix/7.10.4
  • hotfix/7.70.45
  • hotfix/9.2.24

Please check the status of the associated issue CLDSRV-971.

Goodbye delthas.

The following options are set: approve

@bert-e
bert-e merged commit 43f7fee into development/9.4 Aug 13, 2026
38 checks passed
@bert-e
bert-e deleted the improvement/CLDSRV-971/quota-metrics-retrieval-code-label branch August 13, 2026 08:39
@delthas

delthas commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

CLDSRV-971: logged 3h; transitioned to Done (Fixed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants