Skip to content

Add SamplingLogger utility for reducing log volume while maintaining observability #14353

@shubhampatel28

Description

@shubhampatel28

Task Description

What needs to be done:

Add a SamplingLogger utility class that logs at INFO level once every N times, otherwise at DEBUG level. Apply it to high-frequency log statements in AbstractTableFileSystemView:

  • "Building file system view for partition(s)" - DEBUG for metadata tables, INFO every 10th time for data tables
  • "Took X ms to read Y instants, Z replaced file groups" - INFO every 5th time

Why this task is needed:

In high-throughput scenarios with many partitions, these log statements generate excessive volume at INFO level, making it difficult to identify important events and increasing log storage costs. Sampling maintains periodic visibility for monitoring while reducing log volume by 80-90%.

Task Type

Code improvement/refactoring

Related Issues

Parent feature issue: (if applicable )
Related issues:
NOTE: Use Relationships button to add parent/blocking issues after issue is created.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:devtaskDevelopment tasks and maintenance work

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions