Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

As a use, I want to add URI label to http_requests_total metric in prometheus plugin #11888

Open
evle opened this issue Jan 6, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@evle
Copy link

evle commented Jan 6, 2025

Description

The current prometheus plugin provides http_requests_total metric to track the total number of client requests. However, it lacks the ability to track requests by URI, which is crucial for monitoring traffic patterns and identifying potential bottlenecks at the endpoint level.

Why

Currently, http_requests_total is defined as a simple gauge without labels:

metrics.requests = prometheus:gauge("http_requests_total"

This would allow users to:

  • Track request counts per endpoint
  • Set up alerts based on endpoint-specific traffic patterns
  • Better understand traffic distribution across different APIs

In addition, it will be consistent with other metrics like http_status which already includes URI information

@github-project-automation github-project-automation bot moved this to 📋 Backlog in Apache APISIX backlog Jan 6, 2025
@dosubot dosubot bot added the enhancement New feature or request label Jan 6, 2025
@evle
Copy link
Author

evle commented Jan 6, 2025

Breaking Changes Reminder:

  • Current query: apisix_http_requests_total (returns single total value)
  • After adding labels: Would require sum(apisix_http_requests_total) to get the same total
  • This would break existing dashboards, alerts, and monitoring setups

Proposed Solution:
Add a new metric apisix_http_route_requests_total with route labels instead of modifying the existing one. This ensures backward compatibility is maintained

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant