-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat: decoupled prometheus exporter's calculation and output #12383
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
base: master
Are you sure you want to change the base?
feat: decoupled prometheus exporter's calculation and output #12383
Conversation
…heus-exporter-concurrency
{name = "waiting", var = "ngx_stat_waiting"}, | ||
} | ||
|
||
-- Use FFI to get nginx status directly from global variables | ||
local function nginx_status() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Underhood: The ngx.var
is related to the request context, which is inaccessible; nginx subrequests are also not available. Hence the rewrite to FFI.
@@ -454,10 +458,11 @@ local function collect(ctx, stream_only) | |||
local config = core.config.new() | |||
|
|||
-- config server status | |||
local vars = ngx.var or {} | |||
local hostname = vars.hostname or "" | |||
local hostname = core.utils.gethostname() or "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because API disabled in the context of ngx.timer, context: ngx.timer
.
Description
Which issue(s) this PR fixes:
Fixes #
Checklist