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

Is the registered service case-sensitive in Consul? #5707

Closed
chymy opened this issue Apr 25, 2019 · 3 comments
Closed

Is the registered service case-sensitive in Consul? #5707

chymy opened this issue Apr 25, 2019 · 3 comments

Comments

@chymy
Copy link

chymy commented Apr 25, 2019

Is the registered service case-sensitive in Consul please?

@pierresouchay
Copy link
Contributor

Yes and no.

If you register those 2 services on an agent:

redis1.json

{
      "ID": "redis1",
      "Name": "redis",
      "Port": 8000
}

curl --request PUT http://127.0.0.1:8500/v1/agent/service/register -d @redis.json

redis2.json

{
      "ID": "redis2",
      "Name": "Redis",
      "Port": 8000
}

curl --request PUT http://127.0.0.1:8500/v1/agent/service/register -d @redis2.json

You will end up with this in curl localhost:8500/v1/catalog/services:

{
    "Redis": [],
    "consul": [],
    "redis": []
}

But if you query both:
curl localhost:8500/v1/catalog/service/Redis
and
curl localhost:8500/v1/catalog/service/redis

you will end with the same result (same for DNS or /v1/health/service/redis VS /v1/health/service/Redis)... so basically, the catalog list of service is case sensitive, but not the other endpoints.

This is reasonable as DNS is not case-sensitive neither, maybe /v1/catalog/services might not return both (but it might break some code relying on that)

Still you can remark that the case will be preserved in their ServiceName value in each endpoint as well (so Redis for one, redis for the other)

@pearkes
Copy link
Contributor

pearkes commented May 15, 2019

Thanks for the great and thorough answer here @pierresouchay!

@pearkes pearkes closed this as completed May 15, 2019
f41gh7 added a commit to VictoriaMetrics/VictoriaMetrics that referenced this issue Mar 23, 2021
according to prometheus discovery.
 It should mitigate issue with case sensetive services
hashicorp/consul#5707
valyala pushed a commit to VictoriaMetrics/VictoriaMetrics that referenced this issue Mar 23, 2021
according to prometheus discovery.
 It should mitigate issue with case sensetive services
hashicorp/consul#5707
valyala pushed a commit to VictoriaMetrics/VictoriaMetrics that referenced this issue Mar 23, 2021
according to prometheus discovery.
 It should mitigate issue with case sensetive services
hashicorp/consul#5707
@ikimi
Copy link

ikimi commented Aug 27, 2024

After 5 years, met the same problem 😂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants