-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Support Loki structured metadata #18876
Comments
Hi, I can take this (unless we don't want it) |
this would help out a lot for people that want better search performance with high cardinality |
The concern I have before we embark on this is:
Do we have any insight as to how likely this is to change in future and how much it may change? I would prefer not to take on the additional maintenance if we are going to have to update this feature regularly until it becomes stable. |
According to a Grafana blog post today, structured metadata will be GA in Loki 3.0, which they mention later in the post will be "coming soon". I imagine the feature won't change drastically after that. |
Agreed, it seems unlikely to change after Loki 3.0. We'd be happy to see a contribution to support it then. |
As of Loki 2.9.4, the Structured metadata feature was marked as generally available. |
Loki 3.0 is out :) |
Indeed it is! I'm not sure when we (the core team) would get to this ourselves, but happy to see a PR if someone wants to take a shot. |
@jszwedko I would like to pick this up in the coming week, should I just start working on a PR or ask to have the issue assigned? |
@maxboone nice! That would be fantastic. I assigned you to this issue just so people are aware you are working on it. Let us know if you have any questions or need any pointers! We'd be happy to provide feedback on the PR. |
Hey folks! I work on the Loki project and would like to offer my assistance in answering questions here or helping with this implementation, please let me know if I can help! I'm not sure I can help writing rust but I can help answer questions from the Loki side. |
"In the coming week" didn't end up happening, but I've started work on it just now and expect to send in a PR by the end of the week! @jszwedko the main thing that I am wondering about is how to stay backwards compatible with older Loki versions, as the protobuf definition (that includes structured metadata) is different - but I guess we can better work that out from the PR, just a heads-up that I'll be asking for comments on that (: |
Thank you for this much needed feature. Any updates on the ETA of merge/release? |
I am currently vacationing (with laptop, but less responsive) but have the PR with the implementation as ready as I could get it - awaiting review. I'll poke the reviewer there again! If you really need it you can test a build of the PR branch, and maybe see whether it works as expected? |
@maxboone sounds good thank you |
Closed by #20576 (comment) |
@jszwedko do you think we will have a release for this feature or should we use a nightly build for the time being? |
It will be included in v0.42.0 which is scheduled for next week. |
A note for the community
Use Cases
Structured metadata offers a way to attach metadata labels to logs without indexing them.
Currently, we only save some metadata and send it to Loki by using
labels
. We drop most of the other metadata because they have a high cardinality, which should not be used as labels according to the Loki best practices, because indexing them leads to bad performance.Loki now offers a way to add labels without indexes, which would make using labels with a high cardinality possible.
If this feature is implemented, Loki users could then query based on structured metadata like this:
Where
job
is using the existinglabels
andtrace_id
is an attached structured metadata label.Here is an excerpt from the above-linked Loki Labels Best Practices:
Attempted Solutions
No response
Proposal
Vector's Loki sink should have additionally to
labels
an optionalstructured_metadata
field.Here is what this looks like in Promtail: https://grafana.com/docs/loki/latest/send-data/promtail/stages/structured_metadata/
The Loki API used to send those metadata fields is just an extension of the already implemented push API, but instead of the events looking like this:
it works like this (
trace_id
anduser_id
are the structured metadata fields)References
No response
Version
v0.33.0
The text was updated successfully, but these errors were encountered: