-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HealthCheck log output options #23900
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
####> This option file is used in: | ||
####> podman create, run | ||
####> If file is edited, make sure the changes | ||
####> are applicable to all of those. | ||
#### **--health-log-destination**=*directory_path* | ||
|
||
Set the destination of the HealthCheck log. Directory path, local or events_logger (local use container state file) (Default: local) | ||
|
||
* `local`: (default) HealthCheck logs are stored in overlay containers. (For example: `$runroot/healthcheck.log`) | ||
* `directory`: creates a log file named `<container-ID>-healthcheck.log` with HealthCheck logs in the specified directory. | ||
* `events_logger`: The log will be written with logging mechanism set by events_logger. It also saves the log to a default directory, for performance on a system with a large number of logs. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
####> This option file is used in: | ||
####> podman create, run | ||
####> If file is edited, make sure the changes | ||
####> are applicable to all of those. | ||
#### **--health-max-log-count**=*number of stored logs* | ||
|
||
Set maximum number of attempts in the HealthCheck log file. ('0' value means an infinite number of attempts in the log file) (Default: 5 attempts) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
####> This option file is used in: | ||
####> podman create, run | ||
####> If file is edited, make sure the changes | ||
####> are applicable to all of those. | ||
#### **--health-max-log-size**=*size of stored logs* | ||
|
||
Set maximum length in characters of stored HealthCheck log. ("0" value means an infinite log length) (Default: 500 characters) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -279,6 +279,9 @@ Valid options for `[Container]` are listed below: | |
| GroupAdd=keep-groups | --group-add=keep-groups | | ||
| HealthCmd=/usr/bin/command | --health-cmd=/usr/bin/command | | ||
| HealthInterval=2m | --health-interval=2m | | ||
| HealthLogDestination=/foo/log | --health-log-destination=/foo/log | | ||
| HealthMaxLogCount=5 | --health-max-log-count=5 | | ||
| HealthMaxLogSize=500 | --health-max-log-size=500 | | ||
| HealthOnFailure=kill | --health-on-failure=kill | | ||
| HealthRetries=5 | --health-retries=5 | | ||
| HealthStartPeriod=1m | --health-start-period=period=1m | | ||
|
@@ -515,6 +518,28 @@ Equivalent to the Podman `--health-cmd` option. | |
Set an interval for the healthchecks. An interval of disable results in no automatic timer setup. | ||
Equivalent to the Podman `--health-interval` option. | ||
|
||
### `HealthLogDestination=` | ||
|
||
Set the destination of the HealthCheck log. Directory path, local or events_logger (local use container state file) | ||
(Default: local) | ||
Equivalent to the Podman `--health-log-destination` option. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe add a sentence at the end here saying "the default is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, |
||
|
||
* `local`: (default) HealthCheck logs are stored in overlay containers. (For example: `$runroot/healthcheck.log`) | ||
* `directory`: creates a log file named `<container-ID>-healthcheck.log` with HealthCheck logs in the specified directory. | ||
* `events_logger`: The log will be written with logging mechanism set by events_logger. It also saves the log to a default directory, for performance on a system with a large number of logs. | ||
|
||
### `HealthMaxLogCount=` | ||
|
||
Set maximum number of attempts in the HealthCheck log file. ('0' value means an infinite number of attempts in the log file) | ||
(Default: 5 attempts) | ||
Equivalent to the Podman `--Health-max-log-count` option. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the default here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 5 attempts There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please put these in the manpage, make it clear to users what the expectation is. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have added default values to man pages. |
||
|
||
### `HealthMaxLogSize=` | ||
|
||
Set maximum length in characters of stored HealthCheck log. ("0" value means an infinite log length) | ||
(Default: 500 characters) | ||
Equivalent to the Podman `--Health-max-log-size` option. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the default here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 500 characters |
||
|
||
### `HealthOnFailure=` | ||
|
||
Action to take once the container transitions to an unhealthy state. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know I should have asked on the design doc but is there reason to use a directory here? I think it would make sense to just use the full path as file instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the case that there are multiple containers with the same path, to avoid mixing health check logs, the log file name is generated automatically. Probably the container name could be used instead of the container-id if it is specific, to improve the user experience. @Luap99 WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is properly fine like this then. Prevent using the same path on multiple container like this seems reasonable. Using the ID will be better than the name as the name may be larger than the 255 char file name limit which would break us.