Skip to content

Fix naming of HTTP Metrics and add request & response count metrics #1041

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

Merged
merged 7 commits into from
Apr 17, 2025

Conversation

aphralG
Copy link
Contributor

@aphralG aphralG commented Apr 7, 2025

Proposed changes

NGINX OSS:

  • Renamed nginx.http.response.status to nginx.http.response.count as it represents the The total number of HTTP responses, grouped by status code range, since the last collection interval. not the total count.
  • Added nginx.http.request.count - The total number of client requests received, since the last collection interval.

NGINX Plus:

  • Added nginx.http.response.count - The total number of HTTP responses sent to clients, grouped by status code range, since the last collection interval.

Other:

  • Updated Grafana to show the above metrics

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING document
  • I have run make install-tools and have attached any dependency changes to this pull request
  • If applicable, I have added tests that prove my fix is effective or that my feature works
  • If applicable, I have checked that any relevant tests pass after adding my changes
  • If applicable, I have updated any relevant documentation (README.md)
  • If applicable, I have tested my cross-platform changes on Ubuntu 22, Redhat 8, SUSE 15 and FreeBSD 13

@aphralG aphralG self-assigned this Apr 7, 2025
@aphralG aphralG requested a review from a team as a code owner April 7, 2025 14:42
@github-actions github-actions bot added bug Something isn't working chore Pull requests for routine tasks documentation Improvements or additions to documentation labels Apr 7, 2025
@dhurley dhurley changed the title Fix naming of HTTP Metrics and Add request & response count Fix naming of HTTP Metrics and add request & response count metrics Apr 8, 2025
@oCHRISo oCHRISo added the v3.x Issues and Pull Requests related to the major version v3 label Apr 15, 2025

stats, err := s.client.GetStubStats()
if err != nil {
s.settings.Logger.Error("fetch nginx stats", zap.Error(err))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
s.settings.Logger.Error("fetch nginx stats", zap.Error(err))
s.settings.Logger.Error("Failed to get stats from stub status API", zap.Error(err))

nps.init.Do(func() {
stats, err := nps.plusClient.GetStats(ctx)
if err != nil {
nps.logger.Warn("Failed to get stats", zap.Error(err))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
nps.logger.Warn("Failed to get stats", zap.Error(err))
nps.logger.Error("Failed to get stats from plus API", zap.Error(err))

@aphralG aphralG merged commit 266632a into v3 Apr 17, 2025
20 checks passed
@aphralG aphralG deleted the fix-http-metrics branch April 17, 2025 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working chore Pull requests for routine tasks documentation Improvements or additions to documentation v3.x Issues and Pull Requests related to the major version v3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants