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

[Loki] How to include label if not exist #1234

Open
churtado-tech opened this issue Feb 13, 2025 · 0 comments
Open

[Loki] How to include label if not exist #1234

churtado-tech opened this issue Feb 13, 2025 · 0 comments

Comments

@churtado-tech
Copy link

I am currently using Loki Mixin Dashboards and noticed that the current logs do not include a level label. I understand that this label is planned for future implementation in our apps, but in the meantime, I would like to suggest a temporary solution to improve dashboard functionality.

Problem:
• The Loki Mixin dashboards rely on the level label to categorize logs (e.g., info, warn, error), but currently, many logs do not have this label.
• This causes issues with filtering and visualizing logs effectively in the dashboards.
• Until the level label is officially included, users must manually handle missing levels, which disrupts dashboard usability.

Proposed Solution:
• Implement a default value of "info" for logs that do not have a level label.
• This could be achieved using a label_format transformation in Prometheus recording rules or by adjusting the dashboard queries to apply a default value when level is missing.
• This change would ensure that all logs are categorized properly and allow the dashboards to function as expected.

Expected Outcome:
• Logs without a level label will be treated as info, allowing dashboards to work consistently.
• Users will be able to filter logs based on level without missing uncategorized entries.
• Once the official implementation of level is completed, this workaround can be adjusted or removed accordingly.

How can achieve that?

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

No branches or pull requests

1 participant