Hello,
I followed the official Doc of the Prometheus
and I tried http://localhost:8001/metrics but have something wrong with a response. I’m not sure if it’s a Prometheus plugin issue or something I’m doing wrong. Thank you for reading
Kong Version 1.0.0rc2
localhost:8001/plugins
{ next: null, data: [ { created_at: 1544434246, config: { }, id: "020666d3-0f39-4fc2-80e6-6b8a9534d1c4", service: { id: "de838225-be9c-4e5c-99e1-f21b47970e03" }, name: "prometheus", api: null, consumer: null, route: null, enabled: true }, { created_at: 1544497752, config: { }, id: "302d6c16-e4ba-4574-b589-c27ed3bb6829", service: null, name: "prometheus", api: null, consumer: null, route: null, enabled: true } ] }
localhost:8001/metrics
# HELP kong_datastore_reachable Datastore reachable from Kong, 0 is unreachable # TYPE kong_datastore_reachable gauge kong_datastore_reachable 1 # HELP kong_nginx_http_current_connections Number of HTTP connections # TYPE kong_nginx_http_current_connections gauge kong_nginx_http_current_connections{state="accepted"} 19 kong_nginx_http_current_connections{state="active"} 1 kong_nginx_http_current_connections{state="handled"} 19 kong_nginx_http_current_connections{state="reading"} 0 kong_nginx_http_current_connections{state="total"} 131 kong_nginx_http_current_connections{state="waiting"} 0 kong_nginx_http_current_connections{state="writing"} 1 # HELP kong_nginx_metric_errors_total Number of nginx-lua-prometheus errors # TYPE kong_nginx_metric_errors_total counter kong_nginx_metric_errors_total 0 {"message":"An unexpected error occurred"}error.log of Kong2018/12/11 11:12:03 [error] 2303#0: *8748 [lua] init.lua:143: handle_error(): /usr/local/share/lua/5.1/lapis/application.lua:397: /usr/local/share/lua/5.1/kong/plugins/prometheus/api.lua:20: headers have already been sent stack traceback: [C]: in function 'error' /usr/local/share/lua/5.1/kong/pdk/response.lua:553: in function 'collect' /usr/local/share/lua/5.1/kong/plugins/prometheus/api.lua:20: in function stack traceback: [C]: in function 'error' /usr/local/share/lua/5.1/lapis/application.lua:397: in function 'handler' /usr/local/share/lua/5.1/lapis/application.lua:130: in function 'resolve' /usr/local/share/lua/5.1/lapis/application.lua:161: in function [C]: in function 'xpcall' /usr/local/share/lua/5.1/lapis/application.lua:159: in function 'dispatch' /usr/local/share/lua/5.1/lapis/nginx.lua:215: in function 'serve_admin_api' content_by_lua(nginx-kong.conf:175):2: in function , client: 223.104.5.223, server: kong_admin, request: "GET /metrics HTTP/1.1", host: "115.159.34.56:8001" 2018/12/11 11:12:03 [error] 2303#0: *8748 attempt to set ngx.status after sending out response headers, client: 223.104.5.223, server: kong_admin, request: "GET /metrics HTTP/1.1", host: "115.159.34.56:8001" 2018/12/11 11:12:03 [error] 2303#0: *8748 attempt to set ngx.header.HEADER after sending out response headers, client: 223.104.5.223, server: kong_admin, request: "GET /metrics HTTP/1.1", host: "115.159.34.56:8001" 2018/12/11 11:12:03 [error] 2303#0: *8748 attempt to set ngx.header.HEADER after sending out response headers, client: 223.104.5.223, server: kong_admin, request: "GET /metrics HTTP/1.1", host: "115.159.34.56:8001" 2018/12/11 11:12:03 [error] 2303#0: *8748 attempt to set ngx.header.HEADER after sending out response headers, client: 223.104.5.223, server: kong_admin, request: "GET /metrics HTTP/1.1", host: "115.159.34.56:8001" 2018/12/11 11:12:03 [error] 2303#0: *8748 attempt to set status 500 via ngx.exit after sending out the response status 200, client: 223.104.5.223, server: kong_admin, request: "GET /metrics HTTP/1.1",