Skip to content
Discussion options

You must be logged in to vote

Variables registered by core.ctx.register_var() are scoped per request—their values are computed based on the current request context and are not shared globally across requests. This makes them suitable for logging dynamic, request-specific data in plugins like loki-logger, especially when used in log_format fields reference.

However, there is a known bug in the loki-logger plugin: if log_labels are configured globally or the same config table is reused across requests, label values can leak between requests due to in-place mutation. To avoid this, configure loki-logger per route or service and avoid sharing mutable config tables. The log_format fields themselves are built per request a…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by renshunhang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant