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

Add metrics from NGINX Plus API version 9 #530

Merged
merged 1 commit into from
Nov 13, 2023
Merged

Conversation

haywoodsh
Copy link
Contributor

@haywoodsh haywoodsh commented Oct 23, 2023

˜### Proposed changes

Add metrics for NGINX worker data, connection accepted, dropped, current active, current idle, http request total and current.

Example NGINX Plus API response /workers/

[
    {
        "id": 0,
        "pid": 970577,
        "connections": {
            "accepted": 12364048,
            "dropped": 0,
            "active": 1,
            "idle": 80
        },
        "http": {
            "requests": {
                "total": 21726744,
                "current": 0
            }
        }
    },
    {
        "id": 1,
        "pid": 970578,
        "connections": {
            "accepted": 13538199,
            "dropped": 0,
            "active": 2,
            "idle": 66
        },
        "http": {
            "requests": {
                "total": 22635133,
                "current": 1
            }
        }
    }
]

Prometheus metrics for workers

# HELP nginxplus_worker_connection_accepted The total number of accepted client connections
# TYPE nginxplus_worker_connection_accepted counter
nginxplus_worker_connection_accepted{id="0",pid="970577"} 1.2363957e+07
nginxplus_worker_connection_accepted{id="1",pid="970578"} 1.3538027e+07
# HELP nginxplus_worker_connection_active The current number of active client connections
# TYPE nginxplus_worker_connection_active gauge
nginxplus_worker_connection_active{id="0",pid="970577"} 2
nginxplus_worker_connection_active{id="1",pid="970578"} 1
# HELP nginxplus_worker_connection_dropped The total number of dropped client connections
# TYPE nginxplus_worker_connection_dropped counter
nginxplus_worker_connection_dropped{id="0",pid="970577"} 0
nginxplus_worker_connection_dropped{id="1",pid="970578"} 0
# HELP nginxplus_worker_connection_idle The current number of idle client connections
# TYPE nginxplus_worker_connection_idle gauge
nginxplus_worker_connection_idle{id="0",pid="970577"} 77
nginxplus_worker_connection_idle{id="1",pid="970578"} 63
# HELP nginxplus_worker_http_requests_current The current number of client requests that are currently being processed by the worker process
# TYPE nginxplus_worker_http_requests_current gauge
nginxplus_worker_http_requests_current{id="0",pid="970577"} 1
nginxplus_worker_http_requests_current{id="1",pid="970578"} 0
# HELP nginxplus_worker_http_requests_total The total number of client requests received by the worker process
# TYPE nginxplus_worker_http_requests_total counter
nginxplus_worker_http_requests_total{id="0",pid="970577"} 2.1726533e+07
nginxplus_worker_http_requests_total{id="1",pid="970578"} 2.2634942e+07

Checklist

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

  • I have read the CONTRIBUTING
    guide
  • I have proven my fix is effective or that my feature works
  • I have checked that all unit tests pass after adding my changes
  • I have ensured the README is up to date
  • I have rebased my branch onto main
  • I will ensure my PR is targeting the main branch and pulling from my branch on my own fork

@github-actions github-actions bot added the enhancement Pull requests for new features/feature enhancements label Oct 23, 2023
@haywoodsh haywoodsh linked an issue Oct 24, 2023 that may be closed by this pull request
@haywoodsh haywoodsh force-pushed the feat/api-v9-metrics branch 2 times, most recently from eec5216 to 111dcfd Compare October 26, 2023 13:28
@github-actions github-actions bot added the documentation Pull requests/issues for documentation label Oct 26, 2023
@haywoodsh haywoodsh marked this pull request as ready for review October 26, 2023 13:41
@haywoodsh haywoodsh requested a review from a team as a code owner October 26, 2023 13:41
Copy link
Contributor

@jjngx jjngx left a comment

Choose a reason for hiding this comment

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

👍🏻

Signed-off-by: Haywood Shannon <5781935+haywoodsh@users.noreply.github.com>
@haywoodsh haywoodsh merged commit ff32460 into main Nov 13, 2023
12 checks passed
@haywoodsh haywoodsh deleted the feat/api-v9-metrics branch November 13, 2023 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Pull requests/issues for documentation enhancement Pull requests for new features/feature enhancements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add metrics form NGINX Plus API version 9
3 participants