p404 opened a new issue, #10584:
URL: https://github.com/apache/apisix/issues/10584

   ### Current Behavior
   
   When setting up the DataDog plugin globally with this configuration:
   ``` code json
   {
     "_meta": {
       "disable": false
     },
     "constant_tags": [
       "source:apisix",
       "service:custom"
     ],
     "host": "10.26.0.21",
     "namespace": "ingress-apisix",
     "port": 8125
   }
   ```
   The plugin still attempts to send data to 127.0.0.1, as indicated by this 
error message:
   
   ```log
   apisix-66f8859c6b-mnsdc apisix 2023-12-01T17:40:43.927546706-07:00 
2023/12/02 00:40:43 [error] 50#50: *732097 [lua] datadog.lua:172: 
send_metric_over_udp(): failed to report req body size to dogstatsd server: 
host[127.0.0.1] port[8125] err: connection refused, context: ngx.timer, client: 
10.24.0.5, server: 0.0.0.0:9443
   ```
   
   Despite the specified host being "10.26.0.21", the plugin incorrectly 
targets "127.0.0.1".
   
   
   ### Expected Behavior
   
   Despite being configured to target the host "10.26.0.21", the DataDog plugin 
incorrectly attempts to send data to "127.0.0.1"
   
   ### Error Logs
   
   ```log
   apisix-66f8859c6b-mnsdc apisix 2023-12-01T17:40:43.927546706-07:00 
2023/12/02 00:40:43 [error] 50#50: *732097 [lua] datadog.lua:172: 
send_metric_over_udp(): failed to report req body size to dogstatsd server: 
host[127.0.0.1] port[8125] err: connection refused, context: ngx.timer, client: 
10.24.0.5, server: 0.0.0.0:9443
   ```
   
   ### Steps to Reproduce
   
   1. Configure the DataDog Plugin globally.
   2. Send a request to a route.
   3. Inspect error logs to check whether ApiSix is trying to connect to 
127.0.0.1 for sending metrics to DataDog.
   
   ### Environment
   
   - APISIX version (run `apisix version`): 3.6.0
   - Operating system (run `uname -a`): apisix:3.6.0-debian (container) / 
Kubernetes
   - OpenResty / Nginx version (run `openresty -V` or `nginx -V`): 
openresty/1.21.4.2
   - etcd version, if relevant (run `curl 
http://127.0.0.1:9090/v1/server_info`): etcd:3.5.7-debian-11-r14
   - APISIX Dashboard version, if relevant: apisix-dashboard:3.0.0-alpine
   - Helm Chart:  1.7.0/apisix


-- 
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: [email protected]

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

Reply via email to