Open millad90s opened 2 years ago
I fixed this by changing annotations fromad.datadoghq.com/redis.check_name
to ad.datadoghq.com/redis.check_names
but there is another issue now: datado agent is not able to get variable env_REDIS_PASSWORD !
n Datadog Agent run: agent configcheck -v output: === Resolve warnings === redisdb
* error resolving template redisdb for service docker://6a05409fb4cfb8376b9ee3ae36576c7114f1cc66076faea7d899fefe97a67118: ignoring config from file:/etc/datadog-agent/conf.d/redisdb.d/auto_conf.yaml: another config is defined for the check redisdb
* Can't resolve the template for redisdb at this moment.
* error resolving template redisdb for service docker://6a05409fb4cfb8376b9ee3ae36576c7114f1cc66076faea7d899fefe97a67118: failed to retrieve envvar REDIS_PASSWORD, skipping service docker://6a05409fb4cfb8376b9ee3ae36576c7114f1cc66076faea7d899fefe97a67118
* Can't resolve the template for redisdb at this moment.
I @millad90s
Does the envvar is present in the datadog pod container agent
or in your redis instance pod container?
The env var should be in the agent container.
If for security reason you don't want to expose it in the agent env var. The agent and the helm chart provide a new option to store the password in a kubernetes secret: https://docs.datadoghq.com/agent/guide/secrets-management/
Please let us know if it solve the issue. Regards
I have the same issue with ECS deployment. The error is the folowing: 2022-02-21 20:03:48 UTC | CORE | WARN | (pkg/autodiscovery/autoconfig.go:544 in resolveTemplateForService) | error resolving template redisdb for service docker://***a1e81-1539673652: ignoring config from file:/etc/datadog-agent/conf.d/redisdb.d/auto_conf.yaml: another config is defined for the check redisdb
Labels from app container are: DockerLabels: com.datadoghq.ad.check_names: '["redisdb"]' com.datadoghq.ad.init_configs: '[{}]' com.datadoghq.ad.instances: "[{\"host\":\"%%host%%\",\"port\":\"6379\"}]"
Hi @nshakhat
It doesn't seems to be the same issue, because in the initial issue the problem was able resolving and envvar in the check configuration.
Could you share the output of the agent status
and agent configcheck
.
Also maybe it is just a typo in you com.datadoghq.ad.instances
label, but is should be
com.datadoghq.ad.instances: '[{"host":"%%host%%","port":"6379"}]'
instead of com.datadoghq.ad.instances: "[{"host":"%%host%%","port":"6379"}]"
Regards
following this page , I enabled auto discovery on Datadog then I installed redis via helm chart on kubernetes and added podlabels and podAnnotations into the helm values. Datadog Agent get labels perfectly and also get annotations except
ad.datadoghq.com/redis.instances: '[{"ad_identifiers": "redis","host": "%%host%%","port":"6378","password":"%%env_REDIS_PASSWORD%%"}]', }
I also tried ignoreAutoConfig: [ "redisdb" ], but Datadog Agent totally ignored redisdb check.Describe what you expected: Datadog Agent is supposed to get redis check config from Annotations and connect to it.
But
Datadog Agent still reading it's own default config for redisdb (conf.d/redisdb.d/auto_conf.yaml) and tries to connect to port 6379. while my redis is running on port 6378.
Steps to reproduce the issue:
add below lines into your values.yaml file. ` podLabels: { tags.datadoghq.com/redis.env: "prod", tags.datadoghq.com/redis.service: "my-redis", tags.datadoghq.com/redis.version: "6.0.3" }
podAnnotations: { ad.datadoghq.com/redis.check_name: '["redisdb"]', ad.datadoghq.com/redis.init_configs: '[{}]', ad.datadoghq.com/redis.logs: '[{"source":"redis"}]', ad.datadoghq.com/redis.instances: '[{"ad_identifiers": "redis","host": "%%host%%","port":"6378","password":"%%env_REDIS_PASSWORD%%"}]', }`
also run this command to check services: agent status
redis-test/redis-master-0/redis
` redisdb (4.2.0)
Additional environment details (Operating System, Cloud provider, etc): I tested this issue on both EKS and GKE. I enabled auto discovery on Datadog then I installed redis via helm chart on kubernetes and added podlabels and podAnnotations into the helm values. Datadog Agent get labels perfectly and also get annotations except
ad.datadoghq.com/redis.instances: '[{"ad_identifiers": "redis","host": "%%host%%","port":"6378","password":"%%env_REDIS_PASSWORD%%"}]', }
I also tried ignoreAutoConfig: [ "redisdb" ], but Datadog Agent totally ignored redisdb check.Describe what you expected: Datadog Agent is supposed to get redis check config from Annotations and connect to it.
But
Datadog Agent still reading it's own default config for redisdb (conf.d/redisdb.d/auto_conf.yaml) and tries to connect to port 6379. while my redis is running on port 6378.
Steps to reproduce the issue:
podAnnotations: { ad.datadoghq.com/redis.check_name: '["redisdb"]', ad.datadoghq.com/redis.init_configs: '[{}]', ad.datadoghq.com/redis.logs: '[{"source":"redis"}]', ad.datadoghq.com/redis.instances: '[{"ad_identifiers": "redis","host": "%%host%%","port":"6378","password":"%%env_REDIS_PASSWORD%%"}]', }`
param port - integer - required