Bug 2120328

Summary: RFE: User-disabled error reporting
Product: Red Hat Enterprise Linux 9 Reporter: Jiří Mencák <jmencak>
Component: tunedAssignee: Jaroslav Škarvada <jskarvad>
Status: CLOSED MIGRATED QA Contact: Robin Hack <rhack>
Severity: unspecified Docs Contact:
Priority: high    
Version: 9.1CC: dhaupt, jeder, jskarvad
Target Milestone: rcKeywords: FutureFeature, MigratedToJIRA
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-09-21 21:07:17 UTC Type: Story
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jiří Mencák 2022-08-22 15:02:30 UTC
Description of problem:
Please allow optionally for no ERRORs to be showed (perhaps lower to INFO) when actions such as writing kernel parameters at runtime files.

Version-Release number of selected component (if applicable):
Any

How reproducible:
Always


Example:
[sysctl]
key=value

will produce an ERROR message in the logs, if/when for some reason kernel parameter "key" cannot be set value "value".  Disable error reporting based on this syntax:

[sysctl]
key=?value

Additional info:
https://github.com/redhat-performance/tuned/issues/192
https://github.com/redhat-performance/tuned/issues/412#issuecomment-1030874933
https://coreos.slack.com/archives/CQNBUEVM2/p1661171263592439

Comment 5 Jiří Mencák 2023-05-15 14:20:54 UTC
[sysctl]
key=?value

Is probably not a great idea.  We already have

[sysctl]
key=>value
key=<value

Let's do a per-instance warking/error disablement, something along the lines of
[sysctl_no_errors]
errors=off # or 0 or [Ff]alse, ...
key1=value1
key2=value2

Open to discussion on the exact syntax.

Comment 6 Jiří Mencák 2023-05-17 17:08:13 UTC
After spending some time to write a PoC of this, I believe I have come up with a more flexible syntax.

TuneD uses the following log levels:

Level                   Numeric value
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LOG_LEVEL_CONSOLE       60      # defined by TuneD
CRITICAL                50      # unused
ERROR                   40
WARNING                 30
INFO                    20
DEBUG                   10
NOTSET                  0

Also see:

CAPTURE_LOG_LEVELS = {
                "debug": logging.DEBUG,
                "info": logging.INFO,
                "warn": logging.WARN,
                "error": logging.ERROR,
                "console": LOG_LEVEL_CONSOLE,
                "none": None,
                }

I believe that better than using "errors=on/off" would actually be to set the logging level for a plug-in instance.

For example:

[sysctl_show_no_errors]
type=sysctl
log_level=console    # show only messages with CONSOLE (and higher) priority
sysctl_does_not_exist=1
kernel.pty.max=8192

[sysctl_show_no_warnings]
type=sysctl
log_level=error      # show only messages with ERROR (and higher) priority
sysctl_does_not_exist=1
kernel.nmi_watchdog=0

At the moment, setting a log level for a plug-in sets a logging level for all instances of the same type and we do not want that.
Changes to logs.py will likely be necessary.

Comment 7 RHEL Program Management 2023-09-21 20:56:36 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 8 RHEL Program Management 2023-09-21 21:07:17 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.