Skip to content

Comments

[countersyncd] fix otel actor log level #4193

Merged
prsunny merged 3 commits intosonic-net:masterfrom
Janetxxx:dev/jc/fix-log
Feb 3, 2026
Merged

[countersyncd] fix otel actor log level #4193
prsunny merged 3 commits intosonic-net:masterfrom
Janetxxx:dev/jc/fix-log

Conversation

@Janetxxx
Copy link
Contributor

@Janetxxx Janetxxx commented Feb 3, 2026

What I did

  • Wrapping with log::log_enabled!(log::Level::Debug) avoids the cost of building log output unless Debug is enabled.
  • Changing print_otel_metrics() to Debug level prevents noisy logs in normal operation; it only shows up when debugging.
  • Removing print_to_console simplifies config and relies solely on log levels to control output.
    Why I did it
    Avoids the cost of building log output unless Debug is enabled.
    How I verified it
    Verified in internal setup.
    Details if related

Signed-off-by: Janet Cui <janet970527@gmail.com>
@Janetxxx Janetxxx requested a review from prsunny as a code owner February 3, 2026 06:06
Copilot AI review requested due to automatic review settings February 3, 2026 06:06
@mssonicbld
Copy link
Collaborator

/azp run

@Janetxxx Janetxxx requested a review from Pterosaur February 3, 2026 06:06
@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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

This pull request aims to optimize the OtelActor logging by replacing the print_to_console configuration field with a runtime check using log::log_enabled!(log::Level::Debug). The intention is to avoid the cost of building log output unless Debug level logging is enabled, and to change the logging from Info to Debug level to reduce noise in production.

Changes:

  • Replaced the config.print_to_console check with log::log_enabled!(log::Level::Debug) to gate the call to print_otel_metrics()
  • Changed all logging statements within print_otel_metrics() from info! to debug! level

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

Signed-off-by: Janet Cui <janet970527@gmail.com>
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Signed-off-by: Janet Cui <janet970527@gmail.com>
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@prsunny prsunny merged commit f1fd21d into sonic-net:master Feb 3, 2026
16 checks passed
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to msft-202412: Azure/sonic-swss.msft#204

@mssonicbld
Copy link
Collaborator

@Janetxxx cherry pick PR didn't pass PR checker. Please check!!!
Azure/sonic-swss.msft#204

3 similar comments
@mssonicbld
Copy link
Collaborator

@Janetxxx cherry pick PR didn't pass PR checker. Please check!!!
Azure/sonic-swss.msft#204

@mssonicbld
Copy link
Collaborator

@Janetxxx cherry pick PR didn't pass PR checker. Please check!!!
Azure/sonic-swss.msft#204

@mssonicbld
Copy link
Collaborator

@Janetxxx cherry pick PR didn't pass PR checker. Please check!!!
Azure/sonic-swss.msft#204

@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202511: #4221

theasianpianist pushed a commit to theasianpianist/sonic-swss that referenced this pull request Feb 17, 2026
What I did

Wrapping with log::log_enabled!(log::Level::Debug) avoids the cost of building log output unless Debug is enabled.
Changing print_otel_metrics() to Debug level prevents noisy logs in normal operation; it only shows up when debugging.
Removing print_to_console simplifies config and relies solely on log levels to control output.
Why I did it
Avoids the cost of building log output unless Debug is enabled.

Signed-off-by: Lawrence Lee <lawlee@microsoft.com>
ksravani-hcl pushed a commit to ksravani-hcl/sonic-swss that referenced this pull request Feb 20, 2026
What I did

Wrapping with log::log_enabled!(log::Level::Debug) avoids the cost of building log output unless Debug is enabled.
Changing print_otel_metrics() to Debug level prevents noisy logs in normal operation; it only shows up when debugging.
Removing print_to_console simplifies config and relies solely on log levels to control output.
Why I did it
Avoids the cost of building log output unless Debug is enabled.
baorliu pushed a commit to baorliu/sonic-swss that referenced this pull request Feb 23, 2026
What I did

Wrapping with log::log_enabled!(log::Level::Debug) avoids the cost of building log output unless Debug is enabled.
Changing print_otel_metrics() to Debug level prevents noisy logs in normal operation; it only shows up when debugging.
Removing print_to_console simplifies config and relies solely on log levels to control output.
Why I did it
Avoids the cost of building log output unless Debug is enabled.

Signed-off-by: Baorong Liu <96146196+baorliu@users.noreply.github.com>
ksravani-hcl pushed a commit to ksravani-hcl/sonic-swss that referenced this pull request Feb 24, 2026
What I did

Wrapping with log::log_enabled!(log::Level::Debug) avoids the cost of building log output unless Debug is enabled.
Changing print_otel_metrics() to Debug level prevents noisy logs in normal operation; it only shows up when debugging.
Removing print_to_console simplifies config and relies solely on log levels to control output.
Why I did it
Avoids the cost of building log output unless Debug is enabled.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants