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

Buffer initializes a Stream with fixed log.labels and then all the messages within a buffer have the same labels #23

Closed
dnezic opened this issue Nov 26, 2024 · 2 comments · Fixed by #24
Assignees
Labels
bug Something isn't working

Comments

@dnezic
Copy link

dnezic commented Nov 26, 2024

Seems that if you send multiple messages in the same buffer with different levels, here:
https://github.com/xente/loki-logger-handler/blob/main/loki_logger_handler/loki_logger_handler.py#L112
All messages sent within a buffer will have the same label extracted, e.g. "level" extracted via:

label_keys={ "level", },

so, messages with level "DEBUG" and "INFO" will all have the label level set to "INFO", even if there is {level:"DEBUG"} in the raw message itself.

which can be fixed by changing this line:
https://github.com/xente/loki-logger-handler/blob/main/loki_logger_handler/loki_logger_handler.py#L180

should be:
key_list = sorted(labels.values())
instead of
key_list = sorted(labels.keys())

@xente xente added the bug Something isn't working label Nov 26, 2024
@xente xente self-assigned this Nov 27, 2024
@xente xente linked a pull request Nov 27, 2024 that will close this issue
@xente
Copy link
Owner

xente commented Nov 27, 2024

It will be fixed on 1.0.2 version

@xente xente closed this as completed in #24 Nov 27, 2024
@xente
Copy link
Owner

xente commented Nov 27, 2024

@dnezic v 1.0.2 has been released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants