Skip to content

Commit

Permalink
Implemented locality weighted load balancing (added locality log)
Browse files Browse the repository at this point in the history
  • Loading branch information
nastassia-dailidava committed Jan 22, 2024
1 parent 4785a11 commit 017413d
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,15 @@ class EnvoyEndpointsFactory(
)
}
val calcLocality = if (priority == 0) Locality.LOCAL.name else locality.name
if (serviceName == "service-mesh-service-first" ||
serviceName == "service-mesh-service-second"
) {
logger.info(
"Resolved metadata locality to $calcLocality with " +
"currentZone=$currentZone, locality: $locality priority $priority " +
"props=${properties.loadBalancing.priorities.zonePriorities}, serviceName: $serviceName"
)
}
lbMetadataKeys.putFields(
properties.loadBalancing.localityMetadataKey,
Value.newBuilder().setStringValue(calcLocality).build()
Expand Down

0 comments on commit 017413d

Please sign in to comment.