Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: The DataDog plugin isn't following the set configuration #10584

Closed
p404 opened this issue Dec 2, 2023 · 3 comments
Closed

bug: The DataDog plugin isn't following the set configuration #10584

p404 opened this issue Dec 2, 2023 · 3 comments

Comments

@p404
Copy link

p404 commented Dec 2, 2023

Current Behavior

When setting up the DataDog plugin globally with this configuration:

{
  "_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:

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

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
@kayx23
Copy link
Member

kayx23 commented Dec 2, 2023

Hi @p404, are you configuring the host, port, namespace, and such, on Plugin Metadata?

curl http://127.0.0.1:9180/apisix/admin/plugin_metadata/datadog -X PUT -d '
{
  "constant_tags": [
    "source:apisix",
    "service:custom"
  ],
  "host": "10.26.0.21",
  "namespace": "ingress-apisix",
  "port": 8125
}'

Suspecting you might have configured it in the wrong place because I noticed the _meta.disable, which is a config option for plugin instance.

@kayx23 kayx23 added the wait for update wait for the author's response in this issue/PR label Dec 8, 2023
@shreemaan-abhishek shreemaan-abhishek moved this to 🏗 In progress in Apache APISIX backlog Dec 12, 2023
@kayx23
Copy link
Member

kayx23 commented Dec 21, 2023

Any update?

@p404
Copy link
Author

p404 commented Jan 9, 2024

Hey @kayx23 you were right about using the metadata API for configuration. I was hoping the dashboard could do that, but it's all good. The plugin's working now, thanks for your help!

@p404 p404 closed this as completed Jan 9, 2024
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in Apache APISIX backlog Jan 9, 2024
@github-actions github-actions bot added user responded and removed wait for update wait for the author's response in this issue/PR labels Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

2 participants