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

Tempo can't connect to memcached: err="lookup _._tcp.memcached:11211: no such host" #4346

Open
Defozo opened this issue Nov 19, 2024 · 1 comment
Labels
good first issue Good for newcomers

Comments

@Defozo
Copy link

Defozo commented Nov 19, 2024

Describe the bug
After running the example docker-compose.yml, the tempo can't connect to Memcached:
2024-11-19 17:29:33 level=warn ts=2024-11-19T16:29:33.631013695Z caller=memcached_client.go:259 msg="error updating memcache servers" err="lookup _._tcp.memcached:11211: no such host"

To Reproduce
Steps to reproduce the behavior:

  1. Start Tempo using docker-compose.yml from the examples
  2. Check the logs

Expected behavior
I'd expect Tempo to connect to Memcached and properly store the traces.

Environment:

  • Infrastructure: docker-compose, Windows, PC
  • Deployment tool: docker-compose

Additional Context
I've tried connecting to Memcached from the tempo docker container and this worked.

@javiermolinar
Copy link
Contributor

javiermolinar commented Nov 20, 2024

Hi, good catch!

The problem is this DNS SRV record lookup:

_, addrs, err := net.LookupSRV(c.service, "tcp", c.hostname)

This doesn't work when Memcached runs in docker-compose because, as far as I know, Docker’s DNS does not create SRV service records. Instead, it only creates basic A records (IP address mappings).

We have a workaround by setting addresses instead of host in the tempo.yaml when configuring memcached

https://grafana.com/docs/tempo/latest/configuration/#cache

Using this mode, it won't do a DNS SRV lookup; instead, it will connect directly using the Memcached client.

If you fancy a PR with this change, that would be great!

@javiermolinar javiermolinar added the good first issue Good for newcomers label Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants