Skip to content

Commit

Permalink
fixup! feat(observability): add OpenTelemetry logs
Browse files Browse the repository at this point in the history
  • Loading branch information
samugi committed Jul 5, 2024
1 parent 1ff59b7 commit a06b405
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion kong/observability/logs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ local ngx = ngx
local kong = kong
local table = table
local tostring = tostring
local native_ngx_log = _G.native_ngx_log or ngx.log

local ngx_null = ngx.null
local table_pack = table.pack -- luacheck: ignore
Expand All @@ -42,7 +43,7 @@ local function configured_log_level()
if not ok then
-- This is unexpected outside of the context of unit tests
local level_str = kong.configuration.log_level
_G.native_ngx_log(ngx.WARN,
native_ngx_log(ngx.WARN,
"[observability] OpenTelemetry logs failed reading dynamic log level. " ..
"Using log level: " .. level_str .. " from configuration."
)
Expand Down Expand Up @@ -145,6 +146,9 @@ function _M.maybe_push(stack_level, log_level, ...)

-- return if log buffer is full
if #log_buffer >= max_logs then
native_ngx_log(ngx.NOTICE,
"[observability] OpenTelemetry logs buffer is full: dropping log entry."
)
return
end

Expand Down

0 comments on commit a06b405

Please sign in to comment.