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

loadbalancer-experimental: thread lbDescription into the LoadBalancerObserver #2936

Conversation

bryce-anderson
Copy link
Contributor

Motivation:

We already have a standard resource identifier for use when logging load balancer concerns: lbDescrption. However, we don't use that for the LoadBalancerObserver type because we don't know it on construction.

Modifications:

  • Change the LoadBalancerBuilder to take a factory of LoadBalancerObservers which will consume the lbDescription during load balancer construction.
  • Deprecate the older API for a release cycle.

Result:

Better logging.

…Observer

Motivation:

We already have a standard resource identifier for use when logging
load balancer concerns: lbDescrption. However, we don't use that for
the LoadBalancerObserver type because we don't know it on construction.

Modifications:

- Change the LoadBalancerBuilder to take a factory of LoadBalancerObservers
  which will consume the lbDescription during load balancer construction.
- Deprecate the older API for a release cycle.

Result:

Better logging.
/**
* Factory of {@link LoadBalancerObserver} instances.
*/
public interface LoadBalancerObserverFactory {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its worth debating on whether we want to create a real type here or just use Fuction<String, LoadBalancerObserver>. I like the interface because it gives a place to document what the parameter will be, but we could arguably do that in the loadBalancerObserver(Fuction<String, LoadBalancerObserver>) method. Opinions welcome.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either way works for me, in this case it's likely gonna be a lambda anyways.
Consider adding @FunctionalInterface annotation

/**
* Factory of {@link LoadBalancerObserver} instances.
*/
public interface LoadBalancerObserverFactory {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either way works for me, in this case it's likely gonna be a lambda anyways.
Consider adding @FunctionalInterface annotation

@bryce-anderson bryce-anderson merged commit 54ec680 into apple:main May 16, 2024
15 checks passed
@bryce-anderson bryce-anderson deleted the bl_anderson/LbObserverUsesLbDescription branch May 16, 2024 22:39
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

2 participants