Repository navigation
K8SPS-500 Documented persistent logging - #267
Draft
nastena1606 wants to merge 1 commit into
Draft
nastena1606 wants to merge 1 commit into
nastena1606 wants to merge 1 commit into
Conversation
modified: docs/architecture.md
modified: docs/debug-logs.md
modified: docs/features.md
new file: docs/logrotate.md
modified: docs/operator.md
new file: docs/persistent-logging.md
modified: docs/what-next.md
modified: mkdocs-base.yml
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Several examples use an undefined image-version variable, and the rotation guidance contains lifecycle and configuration errors.
Review effort: Balanced
Findings: 5
Open (8)
Define fluentbitrecommended in all image references · New Remove duplicate MySQL log rotation rule · New Define fluentbitrecommended in the API example · New Document rotation requirements for .err files · New Define fluentbitrecommended for the image tag · New Link to the documentation release tag · New Clarify the ConfigMap key naming restriction · New Correct recovery guidance for Pod replacement · New
What changed in this PR
Documents persistent logging and log rotation for MySQL Pods.
Changes:
- Adds logging setup, customization, and rotation guides.
- Documents new
logcollectorCustom Resource fields. - Integrates logging guidance into navigation and related pages.
| File | Description |
|---|---|
mkdocs-base.yml |
Adds logging navigation. |
docs/what-next.md |
Links persistent logging guidance. |
docs/persistent-logging.md |
Adds the persistent logging guide. |
docs/operator.md |
Documents logcollector fields. |
docs/logrotate.md |
Adds log rotation guidance. |
docs/features.md |
Lists persistent logging capabilities. |
docs/debug-logs.md |
Explains access to collected logs. |
docs/architecture.md |
Adds logging sidecars to the architecture overview. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| spec: | ||
| logcollector: | ||
| enabled: true | ||
| image: perconalab/fluentbit:{{fluentbitrecommended}} |
| namespace: <namespace> | ||
| data: | ||
| slow.conf: | | ||
| /var/lib/mysql/log/slow.log { |
|
|
||
| | Value type | Example | | ||
| | ----------- | ---------- | | ||
| | :material-code-string: string | `perconalab/fluentbit:{{fluentbitrecommended}}` | |
|
|
||
| The collector tails files in two directories. | ||
|
|
||
| **MySQL error log.** Fluent Bit tails every `*.log` and `*.err` file in `/var/lib/mysql/log`. The Operator points only the error log at that directory. To collect the slow query log or the general log as well, set `slow_query_log_file` or `general_log_file` to a path under `/var/lib/mysql/log` in your MySQL configuration. |
| .... | ||
| logcollector: | ||
| enabled: true | ||
| image: perconalab/fluentbit:{{fluentbitrecommended}} |
|
|
||
| Set `spec.logcollector.logRotate.configuration` to replace the Operator-managed `mysql.conf` snippet. | ||
|
|
||
| You must provide the full configuration because this field replaces the built-in rules. Refer to the [default configuration :octicons-link-external-16:](https://github.com/percona/percona-server-mysql-operator/blob/main/build/logcollector/logrotate/logrotate.conf) for the built-in rules when you define your snippet. |
|
|
||
| ### `logcollector.logRotate.extraConfig.name` | ||
|
|
||
| Name of a ConfigMap in the same namespace that holds extra `logrotate` rules. Each key must end with `.conf`. Do not use `mysql.conf` as the name. That name is reserved for the Operator-managed configuration. See [Add extra rules from a ConfigMap](logrotate.md#add-extra-rules-from-a-configmap). |
|
|
||
| **MySQL error log.** Fluent Bit tails every `*.log` and `*.err` file in `/var/lib/mysql/log`. The Operator points only the error log at that directory. To collect the slow query log or the general log as well, set `slow_query_log_file` or `general_log_file` to a path under `/var/lib/mysql/log` in your MySQL configuration. | ||
|
|
||
| **Percona XtraBackup logs.** During a backup, the `xtrabackup` container writes command output to the `/var/log/xtrabackup/<backup-name>.log` file and to its own standard error. Fluent Bit tails `*.log` in that directory. The directory is an `emptyDir` volume. Kubernetes deletes it when the Pod is removed, so XtraBackup log files do not survive a Pod restart. After a restart, use the `xtrabackup` container's standard error from the previous container, if Kubernetes still has it (`kubectl logs <pod> -c xtrabackup --previous`). |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


modified: docs/architecture.md
modified: docs/debug-logs.md
modified: docs/features.md
new file: docs/logrotate.md
modified: docs/operator.md
new file: docs/persistent-logging.md
modified: docs/what-next.md
modified: mkdocs-base.yml