Skip to content

fix: remove llm related metrics for non llm requests#13088

Open
shreemaan-abhishek wants to merge 5 commits intoapache:masterfrom
shreemaan-abhishek:fix/remove-llm-related-metrics-from-normal-request
Open

fix: remove llm related metrics for non llm requests#13088
shreemaan-abhishek wants to merge 5 commits intoapache:masterfrom
shreemaan-abhishek:fix/remove-llm-related-metrics-from-normal-request

Conversation

@shreemaan-abhishek
Copy link
Copy Markdown
Contributor

Description

Which issue(s) this PR fixes:

Fixes #12953

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

Signed-off-by: Abhishek Choudhary <shreemaan.abhishek@gmail.com>
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. bug Something isn't working labels Mar 13, 2026
Copy link
Copy Markdown
Member

@moonming moonming left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @shreemaan-abhishek, thank you for fixing the LLM metrics for non-LLM requests (#12953)!

Removing LLM-related metrics (token counts, etc.) from non-LLM requests is the correct behavior — these metrics should only be populated for AI/LLM plugin routes. I'll review the code in detail shortly.

moonming
moonming previously approved these changes Mar 16, 2026
Baoyuantop
Baoyuantop previously approved these changes Mar 17, 2026
local body = metric_resp.body
local has_error = false
for line in string.gmatch(body, "[^\r\n]+") do
ngx.log(ngx.WARN, "dibag: ", line)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a temporary debug code line that should be removed.

@Baoyuantop Baoyuantop added the wait for update wait for the author's response in this issue/PR label Mar 18, 2026
Signed-off-by: Abhishek Choudhary <shreemaan.abhishek@gmail.com>
@shreemaan-abhishek shreemaan-abhishek dismissed stale reviews from Baoyuantop and moonming via ea141c9 March 31, 2026 02:51
Signed-off-by: Abhishek Choudhary <shreemaan.abhishek@gmail.com>
f
Signed-off-by: Abhishek Choudhary <shreemaan.abhishek@gmail.com>
Signed-off-by: Abhishek Choudhary <shreemaan.abhishek@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:L This PR changes 100-499 lines, ignoring generated files. wait for update wait for the author's response in this issue/PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Prometheus reports LLM metrics even when LLM plugin is not enabled

4 participants