Skip to content

Commit 464fee3

Browse files
committed
refactor(opentelemetry): replace plugin attribute with plugin metadata
1 parent 61f20b6 commit 464fee3

File tree

1 file changed

+2
-18
lines changed

1 file changed

+2
-18
lines changed

apisix/plugins/opentelemetry.lua

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -219,23 +219,6 @@ function _M.init()
219219
trace_id_ratio = trace_id_ratio_sampler_new,
220220
}
221221
hostname = core.utils.gethostname()
222-
223-
-- plugin_info = plugin.plugin_attr(plugin_name) or {}
224-
-- local check = {"collector.address"}
225-
-- core.utils.check_https(check, plugin_info, plugin_name)
226-
-- local ok, err = core.schema.check(attr_schema, plugin_info)
227-
-- if not ok then
228-
-- core.log.error("failed to check the plugin_attr[", plugin_name, "]",
229-
-- ": ", err)
230-
-- return
231-
-- end
232-
233-
-- if plugin_info.trace_id_source == "x-request-id" then
234-
-- id_generator.new_ids = function()
235-
-- local trace_id = core.request.headers()["x-request-id"] or ngx_var.request_id
236-
-- return trace_id, id_generator.new_span_id()
237-
-- end
238-
-- end
239222
end
240223

241224

@@ -247,7 +230,8 @@ local function create_tracer_obj(conf)
247230
end
248231
core.log.info("metadata: ", core.json.delay_encode(metadata))
249232
local plugin_info = metadata.value
250-
233+
local check = {"collector.address"}
234+
core.utils.check_https(check, plugin_info, plugin_name)
251235
if plugin_info.trace_id_source == "x-request-id" then
252236
id_generator.new_ids = function()
253237
local trace_id = core.request.headers()["x-request-id"] or ngx_var.request_id

0 commit comments

Comments
 (0)