feat: loki-logger support for structured metadata
- Dominant language
- Lua
- Stars
- 17.1k
- Forks
- 2.9k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 63
Description
### Description
As recommended in loki documentation, labels should be used for fields with limited cardinality - a good example would be http request method, which can have one of few values. Labels should not be used for indexing fields with high value cardinality, like IP address or request id. For this case, loki has a feature called "structured metadata" - it can and should be used to index searchable fields.
At the moment, loki-logger plugin allows defining loki labels, but does not provide an option to specify structured metadata. This makes the plugin hardly usable in real-world, high-traffic scenarios where we need to index fields with high cardinality.
Contributor guide
Research direction
Start by locating the loki-logger plugin and reviewing how it currently defines Loki labels. Add an option for structured metadata for high-cardinality searchable fields, and verify that the plugin can send this metadata separately from labels.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- observability
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100