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

Merged
merged 2 commits into from
Jul 31, 2024

Conversation

flipyap
Copy link
Contributor

@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.

@flipyap flipyap force-pushed the fix_case_sensitive_services branch from 051d90e to f7d5323 Compare July 22, 2024 16:16
@flipyap
Copy link
Contributor Author

flipyap commented Jul 22, 2024

@simonpasquier let me know what you think or if there is anything else i can do thanks!

@flipyap flipyap force-pushed the fix_case_sensitive_services branch from d412a75 to f9f745e Compare July 30, 2024 15:39
@SuperQ SuperQ merged commit 55ecea7 into prometheus:master Jul 31, 2024
7 checks passed
SuperQ added a commit that referenced this pull request Jul 31, 2024
* [BUGFIX] Fix duplicate services that differ only by casing #321

Signed-off-by: SuperQ <[email protected]>
@SuperQ SuperQ mentioned this pull request Jul 31, 2024
SuperQ added a commit that referenced this pull request Jul 31, 2024
* [BUGFIX] Fix duplicate services that differ only by casing #321

Signed-off-by: SuperQ <[email protected]>
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.

2 participants