Use a unix socket instead udp for reception of metrics (#2652)
This commit is contained in:
parent
cd7625b72f
commit
c4ec773966
5 changed files with 57 additions and 94 deletions
|
|
@ -1,4 +1,4 @@
|
|||
local socket = ngx.socket.udp
|
||||
local socket = ngx.socket.tcp
|
||||
local cjson = require('cjson')
|
||||
local defer = require('defer')
|
||||
local assert = assert
|
||||
|
|
@ -7,7 +7,7 @@ local _M = {}
|
|||
|
||||
local function send_data(jsonData)
|
||||
local s = assert(socket())
|
||||
assert(s:setpeername("127.0.0.1", 8000))
|
||||
assert(s:connect('unix:/tmp/prometheus-nginx.socket'))
|
||||
assert(s:send(jsonData))
|
||||
assert(s:close())
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue