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

Add more Cirrus error logging info #5483

Merged
merged 7 commits into from
Jan 14, 2025
Merged

Add more Cirrus error logging info #5483

merged 7 commits into from
Jan 14, 2025

Conversation

codemist
Copy link
Collaborator

References:

Jira: MNTOR-
Figma:

Description

Screenshot (if applicable)

Not applicable.

How to test

Checklist (Definition of Done)

  • Localization strings (if needed) have been added.
  • Commits in this PR are minimal and have descriptive commit messages.
  • I've added or updated the relevant sections in readme and/or code comments
  • I've added a unit test to test for potential regressions of this bug.
  • If this PR implements a feature flag or experimentation, the Ship Behind Feature Flag status in Jira has been set
  • Product Owner accepted the User Story (demo of functionality completed) or waived the privilege.
  • All acceptance criteria are met.
  • Jira ticket has been updated (if needed) to match changes made during the development process.
  • Jira ticket has been updated (if needed) with suggestions for QA when this PR is deployed to stage.

@codemist codemist requested a review from rhelmer January 10, 2025 12:55
Copy link

logger.error(
"NIMBUS_UUID_NAMESPACE environment variable is missing. Cannot generate experimentationId.",
{
accountId,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's avoid logging the accountId, any problem here is unlikely to be related to the user (more likely the variable we need is not set)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in cdb32cf

@@ -47,6 +53,9 @@ export function getExperimentationId(
);
return "guest-no-experimentation-id-set-by-monitor-middleware";
}
logger.info("Using experimentationId from header for guest user", {
experimentationId,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Likewise here, let's just lot that this is being set without logging the ID.

logger.info("Sending request to Cirrus", {
serverUrl: serverUrl.toString(),
previewMode: params.previewMode,
client_id: params.experimentationId,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's not log the experimentationId, the other params are fine.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in 1412e7c

serverUrl,
ex,
flags,
params,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think in this case it's OK (since we could be sending invalid params)

@@ -43,14 +43,6 @@ export function middleware(request: NextRequest) {
},
});

if (!existingExperimentationId) {
response.cookies.set({
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why remove this?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the point of setting the cookie is for users that are not authenticated, so there's no way to keep track of which experiments or roll-outs they are enrolled in otherwise.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

My bad, I was just supposed to remove the logger line in this file. Good catch!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in 8c23f7b

@codemist codemist requested a review from rhelmer January 14, 2025 11:42
@codemist codemist merged commit ca3bbf3 into main Jan 14, 2025
16 checks passed
@codemist codemist deleted the cirrus-logs branch January 14, 2025 19:41
Copy link

Cleanup completed - database 'blurts-server-pr-5483' destroyed, cloud run service 'blurts-server-pr-5483' destroyed

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.

2 participants