You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "Revolyssup (via GitHub)" <gi...@apache.org> on 2023/07/18 19:59:46 UTC

[GitHub] [apisix] Revolyssup commented on a diff in pull request #9850: fix: loki-logger nil context in batch processor

Revolyssup commented on code in PR #9850:
URL: https://github.com/apache/apisix/pull/9850#discussion_r1267251385


##########
apisix/plugins/loki-logger.lua:
##########
@@ -191,19 +191,16 @@ function _M.log(conf, ctx)
     if batch_processor_manager:add_entry(conf, entry) then
         return
     end
-
+    local labels = conf.log_labels
+    -- parsing possible variables in label value
+    for key, value in pairs(labels) do
+        local new_val, err, n_resolved = core.utils.resolve_var(value, ctx.var)
+        if not err and n_resolved > 0 then
+            labels[key] = new_val
+        end
+    end

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org