javier-ruiz-voxsmart opened a new issue, #12747:
URL: https://github.com/apache/apisix/issues/12747

   ### Current Behavior
   
   ### Current Behavior
   Enabling the Datadog plugin and adding it into a route Apisix throws an 
error saying
   ```
   2025/11/10 11:45:12 [error] 51#51: *11761 [lua] batch-processor.lua:91: 
Batch Processor[datadog] failed to process entries [3/3]: error sending 
egress.size: connection refused, context: ngx.timer, client: 10.1.21.187, 
server: 0.0.0.0:9080
   2025/11/10 11:45:11 [error] 51#51: *11740 send() failed (111: Connection 
refused), context: ngx.timer, client: 10.1.21.187, server: 0.0.0.0:9080
   2025/11/10 11:45:11 [error] 51#51: *11740 [lua] datadog.lua:214: 
send_metric_over_udp(): failed to report response body size to dogstatsd 
server: host[127.0.0.1] port[8125] err: connection refused, context: ngx.timer, 
client: 10.1.21.187, server: 0.0.0.0:9080
   ```
   For some reason, batch-processor is not capable of getting route metrics to 
report it back to the datadog plugin.
   
   ### Expected Behavior
   
   See the metric in our Datadog tenant using the protocol DogStatsD.
   
   
   ### Error Logs
   
   ```
   2025/11/10 11:45:12 [error] 51#51: *11761 [lua] batch-processor.lua:91: 
Batch Processor[datadog] failed to process entries [3/3]: error sending 
egress.size: connection refused, context: ngx.timer, client: 10.1.21.187, 
server: 0.0.0.0:9080
   2025/11/10 11:45:12 [error] 50#50: *11759 [lua] batch-processor.lua:91: 
Batch Processor[datadog] failed to process entries [2/2]: error sending 
egress.size: connection refused, context: ngx.timer, client: 10.1.16.108, 
server: 0.0.0.0:9080
   2025/11/10 11:45:11 [error] 51#51: *11740 [lua] batch-processor.lua:91: 
Batch Processor[datadog] failed to process entries [3/3]: error sending 
egress.size: connection refused, context: ngx.timer, client: 10.1.21.187, 
server: 0.0.0.0:9080
   ```
   
   ### Steps to Reproduce
   
   1. Deploy Apisix chart 2.12.2 in EKS cluster 1.34
   2. Create an Apisix route with Datadog plugin enable
   3. Enable Datadog plugin and provide information about Datadog agent
   
   
   **Apisix Route**
   ```
   apiVersion: apisix.apache.org/v2
   kind: ApisixRoute
   metadata:
     creationTimestamp: '2025-11-10T16:30:36Z'
     generation: 3
     name: apisix-status
     resourceVersion: '207267124'
     uid: 3c4d5cae-472c-4ec3-a2a0-1e87b039e92f
   spec:
     http:
       - match:
           paths:
             - /apisix/status
         name: apisix-status
         plugins:
           - enable: true
             name: public-api
           - enable: true
             name: datadog
     ingressClassName: apisix
   status:
     conditions:
       - lastTransitionTime: '2025-11-12T09:10:10Z'
         message: ''
         observedGeneration: 3
         reason: Accepted
         status: 'True'
         type: Accepted
   
   ```
    **Apisix values yaml**
   ```
   apisix:
     enabled: true
     ssl:
       enabled: true
   ....
     deployment:
       # -- Apache APISIX deployment mode
       # Optional: traditional, decoupled, standalone
       #
       # ref: https://apisix.apache.org/docs/apisix/deployment-modes/
       mode: traditional
   
       # -- Deployment role
       # Optional: traditional, data_plane, control_plane
       #
       # ref: https://apisix.apache.org/docs/apisix/deployment-modes/
       role: "traditional"
       role_traditional:
         # enum: etcd, yaml
         config_provider: "etcd"
   ....
     nginx:
       configurationSnippet:
         # Based on
         # - https://blog.adriaan.io/one-nginx-error-page-to-rule-them-all.html
         # - https://gist.github.com/lextoumbourou/d6221deb818da4f342ea
         httpStart: |
           more_clear_headers Server;
   
           map $status $status_text {
             400 'Bad Request';
             401 'Unauthorized';
             402 'Payment Required';
             403 'Forbidden';
             404 'Not Found';
             405 'Method Not Allowed';
             406 'Not Acceptable';
             407 'Proxy Authentication Required';
             408 'Request Timeout';
             409 'Conflict';
             410 'Gone';
             411 'Length Required';
             412 'Precondition Failed';
             413 'Payload Too Large';
             414 'URI Too Long';
             415 'Unsupported Media Type';
             416 'Range Not Satisfiable';
             417 'Expectation Failed';
             418 'I\'m a teapot';
             421 'Misdirected Request';
             422 'Unprocessable Entity';
             423 'Locked';
             424 'Failed Dependency';
             425 'Too Early';
             426 'Upgrade Required';
             428 'Precondition Required';
             429 'Too Many Requests';
             431 'Request Header Fields Too Large';
             451 'Unavailable For Legal Reasons';
             500 'Internal Server Error';
             501 'Not Implemented';
             502 'Bad Gateway';
             503 'Service Unavailable';
             504 'Gateway Timeout';
             505 'HTTP Version Not Supported';
             506 'Variant Also Negotiates';
             507 'Insufficient Storage';
             508 'Loop Detected';
             510 'Not Extended';
             511 'Network Authentication Required';
             default 'Something is wrong';
           }
           map $http_accept $extension {
             default html;
             ~*application/json json;
           }
         httpSrv: |
           error_page 400 401 402 403 404 405 406 407 408 409 410 411 412 413 
414 415 416 417 418 421 422 423 424 425 426 428 429 431 451 500 501 502 503 504 
505 506 507 508 510 511 @error_$extension;
   
           location @error_json {
             types { } default_type "application/json; charset=utf-8";
             echo '{"error_msg": "$status_text"}';
           }
           location @error_html {
             types { } default_type "text/html; charset=utf-8";
             echo '<html><head><title>$status 
$status_text</title></head><body><center><h1>$status 
$status_text</h1></center></html>';
           }
     prometheus:
       # ref: https://apisix.apache.org/docs/apisix/plugins/prometheus/
       enabled: false
       # -- path of the metrics endpoint
       path: /apisix/prometheus/metrics
       # -- prefix of the metrics
       metricPrefix: apisix_
       # -- container port where the metrics are exposed
       containerPort: 9091
     plugins:
       - "openid-connect"
       - "proxy-rewrite"
       - "prometheus"
       - "datadog"
       - "public-api"
       - "response-rewrite"
       - "node-status"
     pluginAttrs:
       prometheus:
         enable_export_server: false
         prefer_name: true
         export_uri: "/apisix/prometheus/metrics"
         metrics:
           http_status:
             extra_labels:
               - upstream_addr: $upstream_addr
               - upstream_status: $upstream_status
           http_latency:
           bandwidth:
         default_buckets:
           - 15
           - 55
           - 105
           - 205
           - 505
         export_addr:
           ip: "127.0.0.1"
           port: 9091
       datadog:
         host: "datadog.monitoring.svc.cluster.local" # Assuming local Datadog 
agent running on the node/pod
         port: 8125 # Default DogStatsD port
         namespace: "apisix" # Prefix for all emitted metrics
         constant_tags: # Static tags for metric enrichment
           - "service:apisix"
           - "source:apisix"
   ```
   
   ### Environment
   
   - APISIX version (run `apisix version`): 3.14.1
   - Operating system (run `uname -a`): `Linux apisix-67fcd54bd8-sdmc9 
6.12.40-64.114.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Aug 26 05:26:24 UTC 
2025 x86_64 x86_64 x86_64 GNU/Linux`
   - OpenResty / Nginx version (run `openresty -V` or `nginx -V`):
   ```
   nginx version: openresty/1.27.1.2
   built by gcc 13.3.0 (Ubuntu 13.3.0-6ubuntu2~24.04)
   built with OpenSSL 3.4.1 11 Feb 2025
   TLS SNI support enabled
   configure arguments: --prefix=/usr/local/openresty/nginx --with-cc-opt='-O2 
-DAPISIX_RUNTIME_VER=1.3.2 -DNGX_LUA_ABORT_AT_PANIC 
-I/usr/local/openresty/zlib/include -I/usr/local/openresty/pcre/include 
-I/usr/local/openresty/openssl3/include' --add-module=../ngx_devel_kit-0.3.3 
--add-module=../echo-nginx-module-0.63 --add-module=../xss-nginx-module-0.06 
--add-module=../ngx_coolkit-0.2 --add-module=../set-misc-nginx-module-0.33 
--add-module=../form-input-nginx-module-0.12 
--add-module=../encrypted-session-nginx-module-0.09 
--add-module=../srcache-nginx-module-0.33 --add-module=../ngx_lua-0.10.28 
--add-module=../ngx_lua_upstream-0.07 
--add-module=../headers-more-nginx-module-0.37 
--add-module=../array-var-nginx-module-0.06 
--add-module=../memc-nginx-module-0.20 --add-module=../redis2-nginx-module-0.15 
--add-module=../redis-nginx-module-0.3.9 --add-module=../ngx_stream_lua-0.0.16 
--with-ld-opt='-Wl,-rpath,/usr/local/openresty/luajit/lib 
-Wl,-rpath,/usr/local/openresty/wasmtime-c-api/li
 b -L/usr/local/openresty/zlib/lib -L/usr/local/openresty/pcre/lib 
-L/usr/local/openresty/openssl3/lib 
-Wl,-rpath,/usr/local/openresty/zlib/lib:/usr/local/openresty/pcre/lib:/usr/local/openresty/openssl3/lib'
 --add-module=/tmp/tmp.iBso3vORdI/openresty-1.27.1.2/../mod_dubbo-1.0.2 
--add-module=/tmp/tmp.iBso3vORdI/openresty-1.27.1.2/../ngx_multi_upstream_module-1.3.2
 
--add-module=/tmp/tmp.iBso3vORdI/openresty-1.27.1.2/../apisix-nginx-module-1.19.2
 
--add-module=/tmp/tmp.iBso3vORdI/openresty-1.27.1.2/../apisix-nginx-module-1.19.2/src/stream
 
--add-module=/tmp/tmp.iBso3vORdI/openresty-1.27.1.2/../apisix-nginx-module-1.19.2/src/meta
 --add-module=/tmp/tmp.iBso3vORdI/openresty-1.27.1.2/../wasm-nginx-module-0.7.0 
--add-module=/tmp/tmp.iBso3vORdI/openresty-1.27.1.2/../lua-var-nginx-module-v0.5.3
 --add-module=/tmp/tmp.iBso3vORdI/openresty-1.27.1.2/../lua-resty-events-0.2.0 
--with-poll_module --with-pcre-jit --with-stream --with-stream_ssl_module 
--with-stream_ssl_preread_module --with-http_v2_mod
 ule --with-http_v3_module --without-mail_pop3_module 
--without-mail_imap_module --without-mail_smtp_module 
--with-http_stub_status_module --with-http_realip_module 
--with-http_addition_module --with-http_auth_request_module 
--with-http_secure_link_module --with-http_random_index_module 
--with-http_gzip_static_module --with-http_sub_module --with-http_dav_module 
--with-http_flv_module --with-http_mp4_module --with-http_gunzip_module 
--with-threads --with-compat --with-stream --with-http_ssl_module
   ```
   - etcd version, if relevant (run `curl 
http://127.0.0.1:9090/v1/server_info`): `3.6.1`
   - APISIX Dashboard version, if relevant:
   - Plugin runner version, for issues related to plugin runners:
   - LuaRocks version, for installation issues (run `luarocks --version`):
   


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