-
Notifications
You must be signed in to change notification settings - Fork 35
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
Convert EventId to labels #43
Comments
Specifically I need this because I am using the .NET native logging methods with |
Alternatively you could tell me what would be the LogQL query to get the label that has Id |
I would strongly recommend reading some more about Loki best practices. In your screenshot you show 2 labels consisting of a log level as well as an EventId which both seem to be highly dynamic (EventId more so than log level). Both of these are not recommended for Loki. Here is a great read for more information regarding best practices for labels: https://grafana.com/docs/loki/latest/best-practices/ As for the LogQL, to get ID 101 you can use regex in the label. So something along the lines of: |
@Jexs I understand what you are saying about dynamic labels, but the EventId is already being added by this Nuget library so my suggested change would actually make it much smaller and less dynamic - by replacing the entire JSON with an integer. |
@Jexs no top of that, my EventIds are not dynamic, but rather static. |
EventIds are extremely useful when searching through logs for specific events.
Currently they are being pasted as json and the label parser only interprets the first
{
It would be great if EventId.Id and EventId.Name were parsed as individual labels so we can quickly search through logs using the label indexers.
cc @josephwoodward
The text was updated successfully, but these errors were encountered: