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] Datadog agent fails check with Portworx + Prometheus #22267

Open
aneesh-joshi-px opened this issue Jan 23, 2024 · 0 comments
Open

[BUG] Datadog agent fails check with Portworx + Prometheus #22267

aneesh-joshi-px opened this issue Jan 23, 2024 · 0 comments

Comments

@aneesh-joshi-px
Copy link

Agent Environment

$ datadog-agent version
Agent 7.50.3 - Commit: abce0cb - Serialization version: v5.0.100 - Go version: go1.20.12

Describe what happened:
Tried setting up Datadog with Portworx integration with Prometheus.

I didn't see any of the Portworx stats on the Datadog website.

When I checked the status, I saw the following error:

$ datadog-agent status
....
....
....
  Check Initialization Errors
  ===========================


      portworx (1.1.0)
      ----------------

      instance 0:

        could not invoke 'portworx' python check constructor. New constructor API returned:
Traceback (most recent call last):
  File "/opt/datadog-agent/embedded/lib/python3.9/site-packages/datadog_checks/portworx/portworx.py", line 13, in __init__
    super(PortworxCheck, self).__init__(name, init_config, instances)
  File "/opt/datadog-agent/embedded/lib/python3.9/site-packages/datadog_checks/base/checks/prometheus/prometheus_base.py", line 31, in __init__
    super(PrometheusCheck, self).__init__(name, init_config, agentConfig, instances)
  File "/opt/datadog-agent/embedded/lib/python3.9/site-packages/datadog_checks/base/checks/prometheus/mixins.py", line 58, in __init__
    super(PrometheusScraperMixin, self).__init__(*args, **kwargs)
  File "/opt/datadog-agent/embedded/lib/python3.9/site-packages/datadog_checks/base/checks/base.py", line 243, in __init__
    self.proxies = self._get_requests_proxy()
  File "/opt/datadog-agent/embedded/lib/python3.9/site-packages/datadog_checks/base/checks/base.py", line 1126, in _get_requests_proxy
    proxies = self.agentConfig.get('proxy', datadog_agent.get_config('proxy'))
AttributeError: 'tuple' object has no attribute 'get'
Deprecated constructor API returned:
__init__() got an unexpected keyword argument 'agentConfig'
  Loading Errors
  ==============
    portworx
    --------
      Core Check Loader:
        Check portworx not found in Catalog

      JMX Check Loader:
        check is not a jmx check, or unable to determine if it's so

      Python Check Loader:
        could not configure check instance for python check portworx: could not invoke 'portworx' python check constructor. New constructor API returned:
Traceback (most recent call last):
  File "/opt/datadog-agent/embedded/lib/python3.9/site-packages/datadog_checks/portworx/portworx.py", line 13, in __init__
    super(PortworxCheck, self).__init__(name, init_config, instances)
  File "/opt/datadog-agent/embedded/lib/python3.9/site-packages/datadog_checks/base/checks/prometheus/prometheus_base.py", line 31, in __init__
    super(PrometheusCheck, self).__init__(name, init_config, agentConfig, instances)
  File "/opt/datadog-agent/embedded/lib/python3.9/site-packages/datadog_checks/base/checks/prometheus/mixins.py", line 58, in __init__
    super(PrometheusScraperMixin, self).__init__(*args, **kwargs)
  File "/opt/datadog-agent/embedded/lib/python3.9/site-packages/datadog_checks/base/checks/base.py", line 243, in __init__
    self.proxies = self._get_requests_proxy()
  File "/opt/datadog-agent/embedded/lib/python3.9/site-packages/datadog_checks/base/checks/base.py", line 1126, in _get_requests_proxy
    proxies = self.agentConfig.get('proxy', datadog_agent.get_config('proxy'))
AttributeError: 'tuple' object has no attribute 'get'
Deprecated constructor API returned:
__init__() got an unexpected keyword argument 'agentConfig'

I followed the code and it looks like there is some incorrect expectations in the check where a get call in made on a tuple.

Describe what you expected:
Portworx data to be seen on Datadog.

Steps to reproduce the issue:
Install Portworx and run its datadog agent

Additional environment details (Operating System, Cloud provider, etc):

[root@anjoshi-41-0 ~]# uname -a
Linux  3.10.0-1160.80.1.el7.x86_64 #1 SMP Tue Nov 8 15:48:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants