You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/11/15 09:05:13 UTC

[GitHub] [apisix] suninuni commented on issue #5092: memory leak when enable prometheus as global

suninuni commented on issue #5092:
URL: https://github.com/apache/apisix/issues/5092#issuecomment-1315000281

   Finally, I solved this problem by removing the node label (balance_ip) for the metrics in [exporter.lua](https://github.com/apache/apisix/blob/master/apisix/plugins/prometheus/exporter.lua#L168).
   
   The root cause is that the key saved in the shared dict contains all labels, such as ` idx=__ngx_prom__key_35279, key=http_status{code="499",route="xxxx",matched_uri="/*",matched_host="xxxxx ",service="",consumer="",node="10.32.47.129"}`. In a k8s cluster, or in a k8s cluster that the deployments are frequently deployed, the information of nodes is always changing, resulting in dict always growing.
   
   Maybe we can change the node label as extra_labels and let the user decide if this label is needed.  


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org