Skip to content

Conversation

iblancasa
Copy link
Contributor

Follow up for #42256.

Copy link
Contributor

github-actions bot commented Oct 6, 2025

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Oct 6, 2025
@iblancasa iblancasa force-pushed the 42256 branch 7 times, most recently from d33d815 to 677e024 Compare October 6, 2025 14:34
@github-actions github-actions bot removed the Stale label Oct 7, 2025
Copy link
Contributor

@evan-bradley evan-bradley left a comment

Choose a reason for hiding this comment

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

Sorry for the long delay with a review. The overall approach here looks okay to me.

@atoulme atoulme marked this pull request as draft October 8, 2025 06:24
@iblancasa iblancasa force-pushed the 42256 branch 3 times, most recently from 1316790 to 4f59c0b Compare October 8, 2025 16:40
Copy link
Contributor

@evan-bradley evan-bradley left a comment

Choose a reason for hiding this comment

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

Thanks again @iblancasa. Looking a bit more closely, I think we have some opportunities to simplify how we do this a little. Let me know what you think.

Comment on lines +71 to +76
### Feature Gate: `extension.healthcheck.useCompatibilityWrapper`

- **Default**: Enabled (true)
- **Purpose**: Preserves v1 Ready/NotReady behavior when using the shared healthcheck implementation
- **When enabled**: Ready/NotReady calls directly control health endpoint status (original behavior)
- **When disabled**: Health status is determined by component status events (v2 behavior)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
### Feature Gate: `extension.healthcheck.useCompatibilityWrapper`
- **Default**: Enabled (true)
- **Purpose**: Preserves v1 Ready/NotReady behavior when using the shared healthcheck implementation
- **When enabled**: Ready/NotReady calls directly control health endpoint status (original behavior)
- **When disabled**: Health status is determined by component status events (v2 behavior)
### Feature Gate: `extension.healthcheck.disableCompatibilityWrapper`
- **Default**: Disabled (false)
- **Purpose**: Transitions v1 Ready/NotReady behavior when using the shared healthcheck implementation
- **When enabled**: Health status is determined by component status events (v2 behavior)
- **When disabled**: Ready/NotReady calls directly control health endpoint status (original behavior)


const defaultPort = 13133

// Feature gate to enable the compatibility wrapper that preserves v1 Ready/NotReady behavior
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Feature gate to enable the compatibility wrapper that preserves v1 Ready/NotReady behavior
// Feature gate to disable the compatibility wrapper that preserves v1 Ready/NotReady behavior

Comment on lines +26 to +27
featuregate.WithRegisterFromVersion("v0.137.0"),
featuregate.WithRegisterToVersion("v0.142.0"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
featuregate.WithRegisterFromVersion("v0.137.0"),
featuregate.WithRegisterToVersion("v0.142.0"),
featuregate.WithRegisterFromVersion("v0.138.0"),
featuregate.WithRegisterToVersion("v0.143.0"),


1. **Current**: Compatibility wrapper enabled by default - no breaking changes.
2. **Future**: Feature gate will be removed, compatibility wrapper will be permanently disabled.
3. **Recommended**: Test your setup with the feature gate disabled to prepare for future versions.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
3. **Recommended**: Test your setup with the feature gate disabled to prepare for future versions.
3. **Recommended**: Test your setup with the feature gate enabled to prepare for future versions.

Interval: "5m",
ExporterFailureThreshold: 5,
},
UseV2: false,
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel like there's a lot of overlap between the intent of the UseV2 option and the feature gate we're adding in this PR. I think we should look at using the feature gate as a way of removing this legacy config section by doing something like the following:

  1. Create an aliased config struct in this package like in the v2 extension
  2. Implement a Validate function that throws an error if any legacy config option is set while the feature gate is set.
  3. If the feature gate isn't set, ensure UseV2 is false, and use the compatibility wrapper.

I think the UseV2 option essentially becomes pointless, but I suppose it could allow users to directly swap-in their v2 configs if they use it.

ln, err := hc.config.ToListener(ctx)
if err != nil {
return fmt.Errorf("failed to bind to address %s: %w", hc.config.Endpoint, err)
func newCompatibilityWrapper(sharedExt *healthcheck.HealthCheckExtension) *compatibilityWrapper {
Copy link
Contributor

Choose a reason for hiding this comment

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

Looking at this again, instead of the wrapper, couldn't we just keep the existing implementation when the feature gate is disabled and use the internal library when it's enabled? I think we will need to bridge the config and we could leave it as-is without worrying about mapping functionality between the two.

Comment on lines +72 to +77
// Then trigger a component status change to make the health endpoint report OK
// This bridges the old Ready() behavior to the new event-driven system
w.ComponentStatusChanged(
w.internalComponentID,
componentstatus.NewEvent(componentstatus.StatusOK),
)
Copy link
Contributor

@evan-bradley evan-bradley Oct 8, 2025

Choose a reason for hiding this comment

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

How does this work with the internal aggregation? If another component reports it encountered an error, that will trump this behavior and cause the extension to report the Collector is unhealthy, right?

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.

4 participants