Skip to content

Conversation

@jrhee17
Copy link
Contributor

@jrhee17 jrhee17 commented Nov 11, 2025

Motivation:

This PR introduces ConfigSourceLifecycleObserver which observes a ConfigSourceClient.
This may be useful when users would like to monitor the client which fetches xDS resources and can be as an equivalent of subscription statistics in envoy
ref: https://www.envoyproxy.io/docs/envoy/latest/configuration/overview/mgmt_server#xds-subscription-statistics

In order to allow users to select the MeterRegistry/MeterIdPrefix a XdsBootstrapBuilder is introduced. While it is trivial to allow users to customize the ConfigSourceLifecycleObserver, I don't think it's necessary at this stage and could be easily done later on if there is need for it.

Modifications:

  • Added a ConfigSourceLifecycleObserver and a default implementation DefaultConfigSourceLifecycleObserver
    • ConfigSourceLifecycleObserver callback methods are called from SotwXdsStream
  • Added a XdsBootstrapBuilder which allows users to customize the MeterRegistry, MeterIdPrefix
    • Modified so that the default EventExecutor used is dedicated for pushing xDS updates.

Result:

  • Users can observe the behavior of ConfigSourceClient via metrics

@jrhee17 jrhee17 added this to the 1.34.0 milestone Nov 11, 2025
@jrhee17 jrhee17 marked this pull request as ready for review November 12, 2025 00:32
Copy link
Contributor

@ikhoon ikhoon left a comment

Choose a reason for hiding this comment

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

👍👍

Copy link
Contributor

@minwoox minwoox left a comment

Choose a reason for hiding this comment

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

👍 👍 👍

"Only envoyGrpc is supported for '%s'", configSource);
final EnvoyGrpc envoyGrpc = firstGrpcService.getEnvoyGrpc();

final boolean ads = configSource.hasAds();
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: we can move this to line 85.


private MeterRegistry meterRegistry = Flags.meterRegistry();
private MeterIdPrefix meterIdPrefix = DEFAULT_METER_ID_PREFIX;
private EventExecutor eventExecutor = DEFAULT_GROUP.next();
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: what do you think ok creating DEFAULT_GROUP only when eventExecutor is not specified in the build method?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants