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

Improve Client Registration Error Collection #4993

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

samgst-amazon
Copy link
Contributor

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Description

Error loading client registration - Error collection

  • add a try-catch block to append specific errors being bubbled up while loading registration
  • Append the reason description with specific step names so we know where the failure occured
  • Add metadata to indicate whether registration has expired/is invalid instead of emitting null client registration message
  • Attempt reauth if registration is expired
  • Add metric that indicates when a registration/access token was succesfully written to the json file and stored in cache

Checklist

  • My code follows the code style of this project
  • I have added tests to cover my changes
  • A short description of the change has been added to the CHANGELOG if the change is customer-facing in the IDE.
  • I have added metrics for my changes (if required)

License

I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link

github-actions bot commented Oct 21, 2024

Qodana Community for JVM

It seems all right 👌

No new problems were found according to the checks applied

💡 Qodana analysis was run in the pull request mode: only the changed files were checked
☁️ View the detailed Qodana report

Contact Qodana team

Contact us at [email protected]

@samgst-amazon samgst-amazon force-pushed the samgst/AddClientRegistrationErrorMetrics branch from 1498d93 to e723169 Compare October 21, 2024 21:27
if (registration == null) {
val message = "Unable to load client registration from cache"
val (message, reason) = when {
currentToken.expiresAt.isBefore(Instant.now(clock)) -> Pair(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

may need to change this whole block but I still need to add reauth logic here!

@samgst-amazon samgst-amazon force-pushed the samgst/AddClientRegistrationErrorMetrics branch from e723169 to a93e410 Compare October 21, 2024 21:31
@samgst-amazon samgst-amazon force-pushed the samgst/AddClientRegistrationErrorMetrics branch from a93e410 to 7504455 Compare October 21, 2024 21:33
Comment on lines +516 to +518
} catch (e: Exception) {
throw e
}
Copy link
Contributor

Choose a reason for hiding this comment

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

?

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