diff --git a/changelog/unreleased/kong/add-ai-proxy-telemetry.yml b/changelog/unreleased/kong/add-ai-proxy-telemetry.yml new file mode 100644 index 000000000000..829bb8e4958a --- /dev/null +++ b/changelog/unreleased/kong/add-ai-proxy-telemetry.yml @@ -0,0 +1,3 @@ +message: Adds telemetry collection for AI Proxy, AI Request Transformer, and AI Response Transformer, pertaining to model and provider usage. +type: feature +scope: Core diff --git a/kong/api/routes/plugins.lua b/kong/api/routes/plugins.lua index 0336e85eac41..bf8be078b079 100644 --- a/kong/api/routes/plugins.lua +++ b/kong/api/routes/plugins.lua @@ -38,6 +38,27 @@ local function reports_timer(premature, data) r_data.e = "c" end + if data.name == "ai-proxy" then + r_data.config = { + llm = { + model = {} + } + } + + r_data.config.llm.model.name = data.config.model.name + r_data.config.llm.model.provider = data.config.model.provider + + elseif data.name == "ai-request-transformer" or data.name == "ai-response-transformer" then + r_data.config = { + llm = { + model = {} + } + } + + r_data.config.llm.model.name = data.config.llm.model.name + r_data.config.llm.model.provider = data.config.llm.model.provider + end + reports.send("api", r_data) end