Skip to content

Conversation

nastena1606
Copy link
Collaborator

modified: docs/debug-logs.md

Copy link

@Copilot 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 PR documents cluster-level logging functionality for the Percona Operator for MongoDB, explaining how logs are persistently stored and managed in Kubernetes environments.

  • Adds comprehensive documentation for cluster-level logging feature
  • Explains how Fluent Bit is used as a sidecar container for log collection
  • Documents configuration options and behavior for the log collector

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Percona Operator for MongoDB addresses this challenge with **cluster-level logging**, ensuring logs are stored persistently, independent of the Pods. This approach helps ensure that logs are available for review even after a Pod restarts.
The Operator collects logs using [Fluent Bit :octicons-link-external-16:] - a lightweight log processor, which supports many output plugins and has broad forwarding capabilities. Fluent Bit runs as a sidecar container within each database Pod. It collects logs from the primary `mongod` container, adds metadata, and stores them in a single file in a dedicated log-specific Persistent Volume Claim (PVC) at `/data/db/logs/`. This allows logs to survive Pod restarts and be accessed for later debugging.
Copy link
Preview

Copilot AI Sep 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The Fluent Bit link appears to be using a syntax for external links that may not render correctly in all markdown processors. Consider using standard markdown link syntax like [Fluent Bit](https://fluentbit.io/) or verify that the :octicons-link-external-16: syntax is supported by your documentation system.

Suggested change
The Operator collects logs using [Fluent Bit :octicons-link-external-16:] - a lightweight log processor, which supports many output plugins and has broad forwarding capabilities. Fluent Bit runs as a sidecar container within each database Pod. It collects logs from the primary `mongod` container, adds metadata, and stores them in a single file in a dedicated log-specific Persistent Volume Claim (PVC) at `/data/db/logs/`. This allows logs to survive Pod restarts and be accessed for later debugging.
The Operator collects logs using [Fluent Bit](https://fluentbit.io/) - a lightweight log processor, which supports many output plugins and has broad forwarding capabilities. Fluent Bit runs as a sidecar container within each database Pod. It collects logs from the primary `mongod` container, adds metadata, and stores them in a single file in a dedicated log-specific Persistent Volume Claim (PVC) at `/data/db/logs/`. This allows logs to survive Pod restarts and be accessed for later debugging.

Copilot uses AI. Check for mistakes.

Comment on lines +81 to +82
You can additionally configure Fluent Bit using the `logcollector.configuration` subsection in
the `deploy/cr.yaml` Custom Resource manifest. This allows you to define custom filters and output plugins to suit your specific logging and monitoring needs.
Copy link
Preview

Copilot AI Sep 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The sentence is broken across two lines unnecessarily. Consider joining these lines for better readability: 'You can additionally configure Fluent Bit using the logcollector.configuration subsection in the deploy/cr.yaml Custom Resource manifest.'

Suggested change
You can additionally configure Fluent Bit using the `logcollector.configuration` subsection in
the `deploy/cr.yaml` Custom Resource manifest. This allows you to define custom filters and output plugins to suit your specific logging and monitoring needs.
You can additionally configure Fluent Bit using the `logcollector.configuration` subsection in the `deploy/cr.yaml` Custom Resource manifest. This allows you to define custom filters and output plugins to suit your specific logging and monitoring needs.

Copilot uses AI. Check for mistakes.

You can additionally configure Fluent Bit using the `logcollector.configuration` subsection in
the `deploy/cr.yaml` Custom Resource manifest. This allows you to define custom filters and output plugins to suit your specific logging and monitoring needs.
When you add a new configuration to the `logcollector.configuration` and this field was previously empty, it triggers a Smart Update. However, if the configuration was not empty, subsequent changes won't trigger an update automatically.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

However, if the configuration was not empty, subsequent changes won't trigger an update automatically.

If we have a non-empty configuration and we update it for some reason, after applying the changes we will trigger the update without a problem!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So in any case we trigger the cluster update?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, update is triggered in either case

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@nastena1606 nastena1606 added the pending release PR is ready to be included in the upcoming release label Sep 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending release PR is ready to be included in the upcoming release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants