Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass backendErr to emitMetrics #3949

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

s-fairchild
Copy link
Collaborator

nil was mistakenly being passed to emitMetrics, causing resultType to always fail collection due to the nil backendError provided.

Which issue this PR addresses:

Fixes ARO-10816

What this PR does / why we need it:

The backend error was not being passed to emitMetrics, nil was being provided instead.
This caused the resultType to always fail to collect, given that the error was always nil.

Example of this:

WARN[0000] failed to collect metric: resulttype          resource_group=resourcegroup resource_id=/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resourcegroup/providers/microsoft.redhatopenshift/openshiftclusters/resourcename resource_name=resourcename subscription_id=00000000-0000-0000-0000-000000000000

INFO[0000] backend.openshiftcluster.AdminUpdating: resulttype = empty  resource_group=resourcegroup resource_id=/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resourcegroup/providers/microsoft.redhatopenshift/openshiftclusters/resourcename resource_name=resourcename subscription_id=00000000-0000-0000-0000-000000000000

Test plan for issue:

Existing unit tests cover this.

Is there any documentation that needs to be updated for this PR?

No

How do you know this will function as expected in production?

The existing unit tests work correctly when the backendErr is provided, with a status code.

# Failure status code
INFO[0000] long running operation failed                 LOGKIND=asyncqos errorDetails="oh no!" operationType=AdminUpdating resource_group=resourcegroup resource_id=/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resourcegroup/providers/microsoft.redhatopenshift/openshiftclusters/resourcename resource_name=resourcename resultType=InternalServerError subscription_id=00000000-0000-0000-0000-000000000000

# Success status code
INFO[0000] long running operation succeeded              LOGKIND=asyncqos operationType=AdminUpdating resource_group=resourcegroup resource_id=/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resourcegroup/providers/microsoft.redhatopenshift/openshiftclusters/resourcename resource_name=resourcename resultType=Success subscription_id=00000000-0000-0000-0000-000000000000

nil was mistakenly being passed to emitMetrics, causing resultType to always fail collection due to the nil backendError provided.
@s-fairchild
Copy link
Collaborator Author

/azp run ci

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@hlipsig hlipsig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working chainsaw Pull requests or issues owned by Team Chainsaw
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants