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

request help: Datadog plugin config #2264

Open
redhandpl opened this issue Jul 16, 2024 · 2 comments
Open

request help: Datadog plugin config #2264

redhandpl opened this issue Jul 16, 2024 · 2 comments
Labels

Comments

@redhandpl
Copy link

redhandpl commented Jul 16, 2024

Issue description

HI,
I'm using Apisix chart 2.8.1 with Apisix 3.9.1 and cannot create metadata for DataDog plugin.
Following #2125 (comment) I downgraded to Apisix 3.7 and unfortunately it doesn't work either.

In both cases I'm using below code.

apiVersion: apisix.apache.org/v2
kind: ApisixGlobalRule
metadata:
  name: global
spec:
  plugins:
  - name: datadog
    enable: true
    config:
      host: "datadog-agent.datadog.svc.cluster.local"
      port: 8125
      namespace: "apisix"

This adds global rule

❯ curl "http://127.0.0.1:9180/apisix/admin/global_rules/" -H 'X-API-KEY: THEKEY'
{"total":1,"list":[{"key":"/apisix/global_rules/cd935c2f","value":{"id":"cd935c2f","plugins":{"datadog":{"port":8125,"prefer_name":true,"buffer_duration":60,"inactive_timeout":5,"retry_delay":1,"namespace":"apisix","name":"datadog","batch_max_size":1000,"max_retry_count":0,"host":"datadog-agent.datadog.svc.cluster.local"}},"create_time":1720782046,"update_time":1720783721},"modifiedIndex":641,"createdIndex":488}]}

But not the metedata

❯ curl http://127.0.0.1:9180/apisix/admin/plugin_metadata/ -H 'X-API-KEY: THEKEY'
{"total":0,"list":[]}

And in logs I still see

2024/07/12 11:36:22 [error] 51#51: *6297 [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.103.10.44, server: 0.0.0.0:9080

Adding plugin-metadata-config-map, does not make any difference

kind: ConfigMap
metadata:
  name: plugin-metadata-config-map
data:
  config.yaml: |
    - cluster: default
      plugins:
      - name: datadog
        metadata:
          host: "datadog-agent.datadog.svc.cluster.local"
          port: 8125
          namespace: "apisix"

I also tried using ApisixPluginConfig CRD and proper config line in ApisixRoute. This doesn't work as well.

For now I have to manually call API by

❯ curl http://127.0.0.1:9180/apisix/admin/plugin_metadata/datadog -H 'X-API-KEY: THEKEY -X PUT -d '
{
    "host": "datadog-agent.datadog.svc.cluster.local",
    "port": 8125,
    "constant_tags": [
        "source:dev",
        "service:apisix"
    ],
    "namespace": "apisix"
}'

How can I achieve this by using CRD/configmap?

@mfractal
Copy link

mfractal commented Aug 19, 2024

i've run into this exact issue as well.
Also posted in slack

I've zeroed in on the problem here

So far haven't heard back from the team and as i see this issue is also ignored.

Copy link

This issue has been marked as stale due to 90 days of inactivity. It will be closed in 30 days if no further activity occurs. If this issue is still relevant, please simply write any comment. Even if closed, you can still revive the issue at any time or discuss it on the [email protected] list. Thank you for your contributions.

@github-actions github-actions bot added the stale label Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants