Skip to content
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

add self logs debug severity grep filter #1437

Closed
wants to merge 2 commits into from

Conversation

braydonk
Copy link
Contributor

Description

Currently, Fluent Bit self logs absolutely explode if you turn on debug logging. This PR will add a filter to drop DEBUG Fluent Bit logs when the logging level is set to debug in the Ops Agent config.

Related issue

b/272779619

How has this been tested?

Tested the generated config in my own environment to ensure debug logs weren't sent to Cloud Logging.

Checklist:

  • Unit tests
    • Unit tests do not apply.
    • Unit tests have been added/modified and passed for this PR.
  • Integration tests
    • Integration tests do not apply.
    • Integration tests have been added/modified and passed for this PR.
  • Documentation
    • This PR introduces no user visible changes.
    • This PR introduces user visible changes and the corresponding documentation change has been made.
  • Minor version bump
    • This PR introduces no new features.
    • This PR introduces new features, and there is a separate PR to bump the minor version since the last release already.
    • This PR bumps the version.

@@ -89,8 +89,8 @@ func generateHealthChecksLogsComponents(ctx context.Context) []fluentbit.Compone

// This method creates a file input for the `logging-module.log` file, a regex parser for the
// fluent-bit self logs and a translator of severity to the logging api format.
Copy link
Contributor

Choose a reason for hiding this comment

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

The part of the comment and a translator of severity to the logging api format. should be removed from here (missed to do this update in my previous PR) since this "translation" now happens in generateSelfLogsProcessingComponents() for all self logs.

Config: map[string]string{
"Name": "grep",
"Match": fluentBitSelfLogsTag,
"Exclude": "severity DEBUG",
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this exclusion filter won't work since the severity field at this point hasn't been transformed correctly to a logging api friendly format (this func comment is misleading too, see other comment). The translation happens in generateSelfLogsProcessingComponents() to make the translation for all self logs once.

Some options for this to work :

  • Move filter to generateSelfLogsProcessingComponents() after severity field transform. The exclude filter would look like (may fail due to backslashes if this hasn't been fixed in the current fluent-bit version in the ops agent) :
"Exclude": "logging.googleapis.com/severity DEBUG",
  • Keep filter here in generateFluentBitSelfLogsComponents() and use lowercase debug :
"Exclude": "severity debug",

@@ -108,6 +108,16 @@ func generateFluentBitSelfLogsComponents(ctx context.Context) []fluentbit.Compon
},
},
}.Components(ctx, fluentBitSelfLogsTag, "fluent-bit-self-log-regex-parsing")...)
if logLevel == "debug" {
Copy link
Contributor

Choose a reason for hiding this comment

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

This would disable completely all fluent-bit debug logs. Is there any situation where we would want debug logs ? From my fluent-bit self logs exploration they haven't been useful at all, but there may be some case i'm not aware off.

@ridwanmsharif
Copy link
Contributor

Closing in favor of #1674

@ridwanmsharif ridwanmsharif deleted the braydonk-exclude-debugs branch July 23, 2024 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants