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

Limit maximum amount of showed log lines with annotation #125

Open
alexey-demyanov opened this issue Aug 14, 2024 · 1 comment
Open

Limit maximum amount of showed log lines with annotation #125

alexey-demyanov opened this issue Aug 14, 2024 · 1 comment

Comments

@alexey-demyanov
Copy link

Description:

I would like to request the addition of an annotation that allows users to specify a maximum number of logs that can be outputted during a deployment job. This will help in managing log verbosity and preventing log overflow, which can be critical for maintaining clarity and performance during deployments.

Use Case:

In extensive deployment processes, the amount of logging information can become overwhelming and difficult to manage. This is particularly important in Continuous Integration (CI) systems like GitLab, where there are often constraints on the maximum amount of logs that a job can produce. Exceeding these limits can cause jobs to fail or logs to be truncated, making it harder to diagnose issues. Having a mechanism to limit the amount of logs will ensure that only the most critical information is logged, making it easier for developers and operators to troubleshoot issues without sifting through excessive log data.

Requested Annotation Example:

Copy Code
apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-deployment
  annotations:
    werf.io//max-logs: "1000"
spec:
  # Deployment specification

Expected Behavior:

When the annotation werf.io/max-logs is set on a deployment, the job responsible for deploying should limit the logs outputted to the specified number.

Any logs beyond the specified limit should be truncated or skipped.

Benefits:

Enhanced manageability of logs during deployments.

Improved performance due to reduced log clutter.

Easier identification and resolution of issues.

Better compatibility with CI systems like GitLab that have log size constraints.

Conclusion:

Adding this annotation will significantly improve the usability and efficiency of deployment processes, particularly in large-scale environments where log management is crucial. This feature will provide better control over log outputs and help maintain clearer and more concise logging practices.

Thank you for considering this feature request!

@ilya-lesikov
Copy link
Member

Should be noted that there are quite some annotations to limit log output, namely:
Annotation werf.io/log-regex
Annotation werf.io/log-regex-for-<container_name>
Annotation werf.io/skip-logs
Annotation werf.io/skip-logs-for-containers
Annotation werf.io/show-logs-only-for-containers

Although werf.io/max-logs might make sense too.

@ilya-lesikov ilya-lesikov changed the title Feature Request: Log Limitation Annotation for Resource Limit maximum amount of showed log lines with annotation Mar 31, 2025
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