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

fixing duplicate services that are seperate only by casing #321

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

flipyap
Copy link

@flipyap flipyap commented Jul 19, 2024

One problem we've experienced is that when you register a service in consul it is case sensitive. so for example, registering
redis and REDIS will register 2 services. However the "gotcha" is that instances of EITHER service will tie to BOTH services.

example:

redis service
-------------
instance-1-redis
instance 2-redis
instance-1-REDIS
instance-2-REDIS

REDIS service
-------------
instance-1-REDIS
instance-2-REDIS
instance-1-redis
instance 2-redis

This creates duplicate metric entries for consul_service_tag and consul_node_healthy metrics when in reality it shouldn't fail on this. I do say i mostly blame consul for the way its done, but from what i know it was done like that on purpose because that is how the DNS is going to work with consul (case INSENSITIVE).

This simple check looks to make sure the entry/instance (instance-2-REDIS) and its service name matches the service that we are looking up (REDIS service) aka /v1/health/service/REDIS. if the instance doesn't match (instance 2-redis) we skip it.

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

Successfully merging this pull request may close these issues.

None yet

1 participant