You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Check Initialization Errors
===========================
mongo (6.2.0)
-------------
instance 0:
could not invoke 'mongo' python check constructor. New constructor API returned:
Traceback (most recent call last):
File "C:\Program Files\Datadog\Datadog Agent\embedded3\Lib\site-packages\datadog_checks\mongo\config.py", line 116, in _get_clean_server_name
return parse_mongo_uri(server, sanitize_username=bool(self.tls_params))[4]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Datadog\Datadog Agent\embedded3\Lib\site-packages\datadog_checks\mongo\utils.py", line 47, in parse_mongo_uri
parsed = pymongo.uri_parser.parse_uri(server)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Datadog\Datadog Agent\embedded3\Lib\site-packages\pymongo\uri_parser.py", line 529, in parse_uri
options.update(split_options(opts, validate, warn, normalize))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Datadog\Datadog Agent\embedded3\Lib\site-packages\pymongo\uri_parser.py", line 363, in split_options
options = cast(_CaseInsensitiveDictionary, validate_options(options, warn))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Datadog\Datadog Agent\embedded3\Lib\site-packages\pymongo\uri_parser.py", line 321, in validate_options
return get_validated_options(opts, warn)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Datadog\Datadog Agent\embedded3\Lib\site-packages\pymongo\common.py", line 860, in get_validated_options
value = validator(opt, value) # noqa: PLW2901
^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Datadog\Datadog Agent\embedded3\Lib\site-packages\pymongo\common.py", line 413, in validate_read_preference_tags
raise ValueError(f"{tag_set!r} not a valid value for {name}") from None
ValueError: '%5B%7B%27nodeType%27%3A+%27ANALYTICS%27%7D%5D' not a valid value for readpreferencetags
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Program Files\Datadog\Datadog Agent\embedded3\Lib\site-packages\datadog_checks\mongo\mongo.py", line 65, in __init__
self._config = MongoConfig(self.instance, self.log)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Datadog\Datadog Agent\embedded3\Lib\site-packages\datadog_checks\mongo\config.py", line 71, in __init__
self.clean_server_name = self._get_clean_server_name()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Datadog\Datadog Agent\embedded3\Lib\site-packages\datadog_checks\mongo\config.py", line 118, in _get_clean_server_name
raise ConfigurationError(
datadog_checks.base.errors.ConfigurationError: Could not build a mongo uri with the given hosts: ['estrelabet.nkw6f.mongodb.net:27017']. Error: ValueError("'%5B%7B%27nodeType%27%3A+%27ANALYTICS%27%7D%5D' not a valid value for readpreferencetags")
Deprecated constructor API returned:
MongoDb.__init__() got an unexpected keyword argument 'agentConfig'
Config Errors
==============
process
-------
Configuration file contains no valid instances
Loading Errors
==============
mongo
-----
Core Check Loader:
Check mongo 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 mongo: could not invoke 'mongo' python check constructor. New constructor API returned:
Traceback (most recent call last):
File "C:\Program Files\Datadog\Datadog Agent\embedded3\Lib\site-packages\datadog_checks\mongo\config.py", line 116, in _get_clean_server_name
return parse_mongo_uri(server, sanitize_username=bool(self.tls_params))[4]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Datadog\Datadog Agent\embedded3\Lib\site-packages\datadog_checks\mongo\utils.py", line 47, in parse_mongo_uri
parsed = pymongo.uri_parser.parse_uri(server)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Datadog\Datadog Agent\embedded3\Lib\site-packages\pymongo\uri_parser.py", line 529, in parse_uri
options.update(split_options(opts, validate, warn, normalize))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Datadog\Datadog Agent\embedded3\Lib\site-packages\pymongo\uri_parser.py", line 363, in split_options
options = cast(_CaseInsensitiveDictionary, validate_options(options, warn))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Datadog\Datadog Agent\embedded3\Lib\site-packages\pymongo\uri_parser.py", line 321, in validate_options
return get_validated_options(opts, warn)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Datadog\Datadog Agent\embedded3\Lib\site-packages\pymongo\common.py", line 860, in get_validated_options
value = validator(opt, value) # noqa: PLW2901
^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Datadog\Datadog Agent\embedded3\Lib\site-packages\pymongo\common.py", line 413, in validate_read_preference_tags
raise ValueError(f"{tag_set!r} not a valid value for {name}") from None
ValueError: '%5B%7B%27nodeType%27%3A+%27ANALYTICS%27%7D%5D' not a valid value for readpreferencetags
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Program Files\Datadog\Datadog Agent\embedded3\Lib\site-packages\datadog_checks\mongo\mongo.py", line 65, in __init__
self._config = MongoConfig(self.instance, self.log)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Datadog\Datadog Agent\embedded3\Lib\site-packages\datadog_checks\mongo\config.py", line 71, in __init__
self.clean_server_name = self._get_clean_server_name()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Datadog\Datadog Agent\embedded3\Lib\site-packages\datadog_checks\mongo\config.py", line 118, in _get_clean_server_name
raise ConfigurationError(
datadog_checks.base.errors.ConfigurationError: Could not build a mongo uri with the given hosts: ['estrelabet.nkw6f.mongodb.net:27017']. Error: ValueError("'%5B%7B%27nodeType%27%3A+%27ANALYTICS%27%7D%5D' not a valid value for readpreferencetags")
Deprecated constructor API returned:
MongoDb.__init__() got an unexpected keyword argument 'agentConfig'
they all gave the same result, "not a valid value for readpreferencetags"
Describe the results you received:
not a valid value for readpreferencetags
The text was updated successfully, but these errors were encountered:
ewertonhm
changed the title
not possible to pass read_preference_tags on mongo integration
"not a valid value for readpreferencetags" on mongo integration
Jun 27, 2024
Maybe am I not doing the correcly sintax in my conf.yaml, but there is no documentation on this topic, if its not a problem on the integration, we should at least fix the documentation about it.
For example, if your MongoDB Atlas cluster has a 3-node replica set and 1 analytics node, you can configure four separate MongoDB integration instances in the conf.yaml, each targeting a specific host. Here’s a sample conf.yaml setup:
Note: If you have a feature request, you should contact support so the request can be properly tracked.
Output of the info page
Additional environment details (Operating System, Cloud provider, etc):
Steps to reproduce the issue:
alto tryed with
and also with:
they all gave the same result, "not a valid value for readpreferencetags"
Describe the results you received:
not a valid value for readpreferencetags
The text was updated successfully, but these errors were encountered: