diff --git a/kong/plugins/circuit-breaker/helpers.lua b/kong/plugins/circuit-breaker/helpers.lua index 9ed2401..4e5a611 100644 --- a/kong/plugins/circuit-breaker/helpers.lua +++ b/kong/plugins/circuit-breaker/helpers.lua @@ -27,15 +27,19 @@ local function set_logger_metrics(api_identifier, new_state) kong.ctx.shared.logger_metrics = {} end -- kong.ctx.shared object is specific to the lifecycle of a request and is used to share data between plugins - kong.ctx.shared.logger_metrics.circuit_breaker = { - "upstream:" .. upstream_host, - "circuit_breaker:" .. api_identifier, - "cb_state:" .. new_state - } + table.insert(kong.ctx.shared.logger_metrics, { + type = "circuit_breaker", + tags = { + "upstream:" .. upstream_host, + "circuit_breaker:" .. api_identifier, + "cb_state:" .. new_state + } + }) + end return { get_excluded_apis = get_excluded_apis, get_api_identifier = get_api_identifier, set_logger_metrics = set_logger_metrics, -} \ No newline at end of file +}