Skip to content

RHINENG-16026: tweak Kessel logs#2100

Open
Dugowitch wants to merge 1 commit intoRedHatInsights:masterfrom
Dugowitch:ksl-log
Open

RHINENG-16026: tweak Kessel logs#2100
Dugowitch wants to merge 1 commit intoRedHatInsights:masterfrom
Dugowitch:ksl-log

Conversation

@Dugowitch
Copy link
Contributor

@Dugowitch Dugowitch commented Mar 11, 2026

Updated the duration from ns to ms for readability,
update the label to 'durationMs',
omit unnecessary list of workspaces,
and omit unnecessary final OK log.

Secure Coding Practices Checklist GitHub Link

Secure Coding Checklist

  • Input Validation
  • Output Encoding
  • Authentication and Password Management
  • Session Management
  • Access Control
  • Cryptographic Practices
  • Error Handling and Logging
  • Data Protection
  • Communication Security
  • System Configuration
  • Database Security
  • File Management
  • Memory Management
  • General Coding Practices

Summary by Sourcery

Adjust Kessel middleware logging to improve readability and reduce noise.

Enhancements:

  • Log Kessel request durations in milliseconds under a unified durationMs field instead of using raw time durations and workspace lists.
  • Remove an unnecessary debug log emitted after successful Kessel permission checks to reduce log verbosity.

Updated the duration from ns to ms for readability,
update the label to 'durationMs',
omit unnecessary list of workspaces,
and omit unnecessary final OK log.
@Dugowitch Dugowitch requested a review from a team as a code owner March 11, 2026 14:22
@sourcery-ai
Copy link

sourcery-ai bot commented Mar 11, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adjusts Kessel middleware logging for streamed workspace listing by switching duration logging from nanoseconds to milliseconds, simplifying logged fields, and removing an unnecessary success log message.

File-Level Changes

Change Details Files
Normalize and simplify error logging for streamed workspace listing.
  • Change duration field label from a generic receivingDuration to durationMs
  • Convert logged duration from time.Duration (nanoseconds) to integer milliseconds using time.Since(start).Nanoseconds()/1e6
  • Retain key context fields in the error log (permission and received_count) while keeping the message text the same
manager/middlewares/kessel.go
Reduce verbosity and sensitive data exposure in success debug logs for streamed workspace listing and Kessel permission checks.
  • Remove logging of the full workspaces slice from the success debug log, keeping only durationMs, permission, and received_count
  • Convert success-path duration logging to integer milliseconds and rename the field to durationMs for consistency with error logs
  • Delete the final "Kessel check OK" debug log after successfully setting inventory groups to reduce log noise
manager/middlewares/kessel.go

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • For consistency and clarity, consider using time.Since(start).Milliseconds() instead of time.Since(start).Nanoseconds()/1e6 when computing durationMs.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- For consistency and clarity, consider using `time.Since(start).Milliseconds()` instead of `time.Since(start).Nanoseconds()/1e6` when computing `durationMs`.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@github-actions
Copy link

SC Environment Impact Assessment

Overall Impact:NONE

No SC Environment-specific impacts detected in this PR.

What was checked

This PR was automatically scanned for:

  • Database migrations
  • ClowdApp configuration changes
  • Kessel integration changes
  • AWS service integrations (S3, RDS, ElastiCache)
  • Kafka topic changes
  • Secrets management changes
  • External dependencies

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.39%. Comparing base (4c3a143) to head (eab9df2).

Files with missing lines Patch % Lines
manager/middlewares/kessel.go 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2100      +/-   ##
==========================================
- Coverage   59.40%   59.39%   -0.01%     
==========================================
  Files         134      134              
  Lines        8707     8706       -1     
==========================================
- Hits         5172     5171       -1     
  Misses       2989     2989              
  Partials      546      546              
Flag Coverage Δ
unittests 59.39% <50.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@TenSt TenSt self-assigned this Mar 11, 2026
utils.LogError(
"err", err.Error(), "receivingDuration", time.Since(start), "permission", permission, "received_count",
len(workspaces), "failed to useStreamedListObjects",
"err", err.Error(), "durationMs", time.Since(start).Nanoseconds()/1e6, "permission", permission,
Copy link
Collaborator

Choose a reason for hiding this comment

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

As suggested by sourcery: time.Since(start).Milliseconds() would be better / more readable :) .

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.

4 participants