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

Fixit Week 2023-08: Reduce verbosity of logging in containers #847

Closed
nkinkade opened this issue Aug 22, 2023 · 3 comments
Closed

Fixit Week 2023-08: Reduce verbosity of logging in containers #847

nkinkade opened this issue Aug 22, 2023 · 3 comments
Assignees

Comments

@nkinkade
Copy link
Contributor

The spend on log storage in GCP is non-trivial. The logs are polluted with mostly useless debug information, making them hard to look through for log entries of interest. The software we use to upload container logs (Vector) is exceedingly busy, possibly triggering latent, edge-case bugs.

@nkinkade
Copy link
Contributor Author

After considering the best way forward, I think the first pass for this will be to leverage Vector filtering rules to eliminate a bunch of common info/debug log message from most services that will account for the majority of the log messages. This is easy and doesn't touching any code. Additionally, in the short to mid term, this also leaves all the current logging available in container logs and k8s, so that they can be leveraged for debugging. It will only affect which logs get pushed to Cloud Logging.

The longer term solution will probably be to use a leveled/structured logger for all of M-Lab's services so that they can be properly filtered and displayed in various environments.

nkinkade added a commit that referenced this issue Aug 25, 2023
This is a first stab at trying to filter log messages from 3rd-party
experiments, as well as overly verbose messages from sidecars.

#847
@nkinkade
Copy link
Contributor Author

NEU-SNS/revtrvp#11

nkinkade added a commit that referenced this issue Aug 25, 2023
…#848)

* Filters unwanted logs messages from GCP

This is a first stab at trying to filter log messages from 3rd-party
experiments, as well as overly verbose messages from sidecars.

#847

* YAMLize multiple conditions

I'm not sure if this is the right syntax. Documentation on using
multiple conditions in YAML is sparse to non-existent.

* Renames Vector filter transforms

Vector threw this error:

Configuration error. error=More than one component with name "kubernetes_logs" (source, transform)

* Updates sinks input names to match transform names

* Moves dot inside double quotes in filter transform

* Ands expression, and removes quotes from left sides

* Tries a different syntax for filter using match()

* Casts .message as a string

Got this from Vector:

.message: this expression resolves to any, but the parameter "value"
expects the exact type string # Please enter the commit message for your
changes. Lines starting

* Adds 'abort' expression to fallible function

* Casts 'container_name' to string
@nkinkade
Copy link
Contributor Author

PR #849 closes this issue. We ultimately decided to not push any experiment container logs to GCP, by default. If we need to in the future, then it should be as easy as changing the pod label vector.dev/exclude: true to "false", which could be done more permanently through PR on this repo and removing the label from the template, or by temporarily modifying the DaemonSet in the live cluster (i.e., kubectl edit ds <ds name>).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants