Skip to content

Better observability for errors in token refresh#782

Merged
vgvoleg merged 4 commits intoydb-platform:mainfrom
makhalin:makhalin-patch-1
Mar 23, 2026
Merged

Better observability for errors in token refresh#782
vgvoleg merged 4 commits intoydb-platform:mainfrom
makhalin:makhalin-patch-1

Conversation

@makhalin
Copy link
Contributor

@makhalin makhalin commented Mar 16, 2026

The current logging behavior for problems in token refresh doesn't have enough information. This resulted in us getting a line in the logs like Failed to refresh token async: , which is impossible to understand. This MR suggests improving this section and displaying the log with a full traceback.

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Fixes: #785

No traceback is printed in logs.

What is the new behavior?

The full traceback of an error is printed in logs.

Other information

@vgvoleg
Copy link
Collaborator

vgvoleg commented Mar 18, 2026

Hi @makhalin ! thanks for this PR. can you create an Issue for this PR and link it in PR description?

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Improves error observability during credential token refresh by ensuring exception tracebacks are included in logs, making refresh failures diagnosable in production.

Changes:

  • Include exception traceback when sync token refresh fails (exc_info=True).
  • Include exception traceback when async token refresh fails (exc_info=True).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
ydb/credentials.py Adds traceback logging on token refresh failure in sync credentials flow.
ydb/aio/credentials.py Adds traceback logging on token refresh failure in async credentials flow.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@vgvoleg vgvoleg merged commit c706f42 into ydb-platform:main Mar 23, 2026
34 checks passed
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.

dev: Improve Error Logging for Token Refresh Failures

3 participants