Gerrard-YNWA commented on issue #2042:
URL: https://github.com/apache/apisix/issues/2042#issuecomment-766719348


   > > we could get hostname from `vars`. but prometheus can store only numbers 
as value.
   > 
   > hi, @nic-chen
   > I don’t quite understand what you said `prometheus can store only numbers 
as value`
   > But we can add a label named host for each metric, such as this
   > 
   > ```lua
   > -- Take metrics.status as an example
   > ...
   > metrics.status = prometheus:counter("http_status",
   >         "HTTP status codes per service in APISIX",
   >         {"code", "service", "node", "host"})
   > ...
   > metrics.status:inc(1, vars.status, service_name, balancer_ip, host_name)
   > ...
   > ```
   
   Hello, any progress in this issue?  
   We have a similar  for collecting different apisix instance's metrics in a 
separate grafana panel, like `apisix_nginx_http_current_connections`.
   However, metrics from the `/apisix/prometheus/metrics` outputs without any 
label about instance infomation, which is quite inconvenient to find the data 
comes from which instance.
   If `apisix` can add a label like `host_name` to every metrics, I think it 
will be helpful.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to