Skip to content

DRAFT: Add Perses feature flag for the monitoring-console-plugin#655

Closed
zhuje wants to merge 14 commits intorhobs:mainfrom
zhuje:OU-571-perses-feature-flag
Closed

DRAFT: Add Perses feature flag for the monitoring-console-plugin#655
zhuje wants to merge 14 commits intorhobs:mainfrom
zhuje:OU-571-perses-feature-flag

Conversation

@zhuje
Copy link
Contributor

@zhuje zhuje commented Jan 9, 2025

/hold

Hold for COO 1.1.0, NOT to be released with COO 1.0.0

JIRA Issue

https://issues.redhat.com/browse/OU-571

Description

  1. . Remove required properties of thanosQuerier and Alertmanager (because we want Perses to be able to be used without ACM)
  • bundle/manifests/observability.openshift.io_uiplugins.yam and
  • deploy/crds/common/observability.openshift.io_uiplugins.yaml
  1. Add Perses-dashboards to the compatibility-matrix, which enables feature flags based on the conditions of the cluster. Perses-dashboards will only be available in OCP 4.19+.
  • pkg/controllers/uiplugin/compatibility_matrix.go
  • pkg/controllers/uiplugin/compatibility_matrix_test.go
  1. Adjust Proxies to include Perses-dashboards.
  • pkg/controllers/uiplugin/monitoring.go
  • pkg/controllers/uiplugin/monitoring_test.go

Other supporting files

  • pkg/apis/uiplugin/v1alpha1/types.go
  • pkg/controllers/uiplugin/utils.go

OPEN QUESTIONS:

  1. Where are we getting the perses-dashboard service endpoint? I need this for monitoring.go
if persesDashboardsFeatureEnabled && config.PersesDashboards.Url == "" {
		return nil, fmt.Errorf("PersesDashboards location can not be empty for plugin type %s", plugin.Spec.Type)
}
...
pluginInfo.ExtraArgs = append(pluginInfo.ExtraArgs, fmt.Sprintf("-perses-dashboards=%s", config.PersesDashboards.Url))

zhuje added 3 commits January 7, 2025 15:54
…rtManager. This is because we want to be able to have the options of creating a Perses proxy only and not include thanosQuerier and the alertManager.
QUESTION : where is the perses dashboard proxy URL coming from, we may need to adjust the code because right now it assumes it is in plugin.Spec.Montioring
@zhuje zhuje requested a review from a team as a code owner January 9, 2025 23:48
@zhuje zhuje requested review from jan--f and sthaha and removed request for a team January 9, 2025 23:48
@openshift-ci-robot
Copy link
Collaborator

openshift-ci-robot commented Jan 9, 2025

@zhuje: This pull request references OU-571 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.19.0" version, but no target version was set.

Details

In response to this:

JIRA Issue

https://issues.redhat.com/browse/OU-571

Description

  1. . Remove required properties of thanosQuerier and Alertmanager (because we want Perses to be able to be used without ACM)
  1. Add Perses-dashboards to the compatibility-matrix, which enables feature flags based on the conditions of the cluster. Perses-dashboards will only be available in OCP 4.19+.
  • pkg/controllers/uiplugin/compatibility_matrix.go
  • pkg/controllers/uiplugin/compatibility_matrix_test.go
  1. Adjust Proxies to include Perses-dashboards.
  • pkg/controllers/uiplugin/monitoring.go
  • pkg/controllers/uiplugin/monitoring_test.go

OPEN QUESTIONS:

  1. Where are we getting the perses-dashboard service endpoint? I need this for monitoring.go
if persesDashboardsFeatureEnabled && config.PersesDashboards.Url == "" {
  	return nil, fmt.Errorf("PersesDashboards location can not be empty for plugin type %s", plugin.Spec.Type)
}
...
pluginInfo.ExtraArgs = append(pluginInfo.ExtraArgs, fmt.Sprintf("-perses-dashboards=%s", config.PersesDashboards.Url))

Other supporting files

  • pkg/apis/uiplugin/v1alpha1/types.go
  • pkg/controllers/uiplugin/utils.go

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot requested review from jgbernalp and marioferh January 9, 2025 23:48
@zhuje zhuje marked this pull request as draft January 9, 2025 23:48
@openshift-ci
Copy link

openshift-ci bot commented Jan 9, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: zhuje
Once this PR has been reviewed and has the lgtm label, please assign jan--f for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot
Copy link
Collaborator

openshift-ci-robot commented Jan 9, 2025

@zhuje: This pull request references OU-571 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.19.0" version, but no target version was set.

Details

In response to this:

/hold

Hold for COO 1.1.0, NOT to be released with COO 1.0.0

JIRA Issue

https://issues.redhat.com/browse/OU-571

Description

  1. . Remove required properties of thanosQuerier and Alertmanager (because we want Perses to be able to be used without ACM)
  1. Add Perses-dashboards to the compatibility-matrix, which enables feature flags based on the conditions of the cluster. Perses-dashboards will only be available in OCP 4.19+.
  • pkg/controllers/uiplugin/compatibility_matrix.go
  • pkg/controllers/uiplugin/compatibility_matrix_test.go
  1. Adjust Proxies to include Perses-dashboards.
  • pkg/controllers/uiplugin/monitoring.go
  • pkg/controllers/uiplugin/monitoring_test.go

OPEN QUESTIONS:

  1. Where are we getting the perses-dashboard service endpoint? I need this for monitoring.go
if persesDashboardsFeatureEnabled && config.PersesDashboards.Url == "" {
  	return nil, fmt.Errorf("PersesDashboards location can not be empty for plugin type %s", plugin.Spec.Type)
}
...
pluginInfo.ExtraArgs = append(pluginInfo.ExtraArgs, fmt.Sprintf("-perses-dashboards=%s", config.PersesDashboards.Url))

Other supporting files

  • pkg/apis/uiplugin/v1alpha1/types.go
  • pkg/controllers/uiplugin/utils.go

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot
Copy link
Collaborator

openshift-ci-robot commented Jan 9, 2025

@zhuje: This pull request references OU-571 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.19.0" version, but no target version was set.

Details

In response to this:

/hold

Hold for COO 1.1.0, NOT to be released with COO 1.0.0

JIRA Issue

https://issues.redhat.com/browse/OU-571

Description

  1. . Remove required properties of thanosQuerier and Alertmanager (because we want Perses to be able to be used without ACM)
  1. Add Perses-dashboards to the compatibility-matrix, which enables feature flags based on the conditions of the cluster. Perses-dashboards will only be available in OCP 4.19+.
  • pkg/controllers/uiplugin/compatibility_matrix.go
  • pkg/controllers/uiplugin/compatibility_matrix_test.go
  1. Adjust Proxies to include Perses-dashboards.
  • pkg/controllers/uiplugin/monitoring.go
  • pkg/controllers/uiplugin/monitoring_test.go

Other supporting files

  • pkg/apis/uiplugin/v1alpha1/types.go
  • pkg/controllers/uiplugin/utils.go

OPEN QUESTIONS:

  1. Where are we getting the perses-dashboard service endpoint? I need this for monitoring.go
if persesDashboardsFeatureEnabled && config.PersesDashboards.Url == "" {
  	return nil, fmt.Errorf("PersesDashboards location can not be empty for plugin type %s", plugin.Spec.Type)
}
...
pluginInfo.ExtraArgs = append(pluginInfo.ExtraArgs, fmt.Sprintf("-perses-dashboards=%s", config.PersesDashboards.Url))

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot
Copy link
Collaborator

openshift-ci-robot commented Jan 9, 2025

@zhuje: This pull request references OU-571 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.19.0" version, but no target version was set.

Details

In response to this:

/hold

Hold for COO 1.1.0, NOT to be released with COO 1.0.0

JIRA Issue

https://issues.redhat.com/browse/OU-571

Description

  1. . Remove required properties of thanosQuerier and Alertmanager (because we want Perses to be able to be used without ACM)
  • bundle/manifests/observability.openshift.io_uiplugins.yam and
  • deploy/crds/common/observability.openshift.io_uiplugins.yaml
  1. Add Perses-dashboards to the compatibility-matrix, which enables feature flags based on the conditions of the cluster. Perses-dashboards will only be available in OCP 4.19+.
  • pkg/controllers/uiplugin/compatibility_matrix.go
  • pkg/controllers/uiplugin/compatibility_matrix_test.go
  1. Adjust Proxies to include Perses-dashboards.
  • pkg/controllers/uiplugin/monitoring.go
  • pkg/controllers/uiplugin/monitoring_test.go

Other supporting files

  • pkg/apis/uiplugin/v1alpha1/types.go
  • pkg/controllers/uiplugin/utils.go

OPEN QUESTIONS:

  1. Where are we getting the perses-dashboard service endpoint? I need this for monitoring.go
if persesDashboardsFeatureEnabled && config.PersesDashboards.Url == "" {
  	return nil, fmt.Errorf("PersesDashboards location can not be empty for plugin type %s", plugin.Spec.Type)
}
...
pluginInfo.ExtraArgs = append(pluginInfo.ExtraArgs, fmt.Sprintf("-perses-dashboards=%s", config.PersesDashboards.Url))

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.


// PersesDashboards points to the perses-dashboards service of which it should create a proxy to.
//
// +kubebuilder:validation:Required
Copy link
Member

Choose a reason for hiding this comment

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

In general when working with kubebuilder configs you should try to make adjustments in the the go file and then run the make generate command to create the yaml for you. Here you will need to remove the required validations in this file for the monitoring options.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated to // +kubebuilder:validation:Optional then ran make generate and make bundle to update the uiplugin CRDs

if persesDashboardsFeatureEnabled {
// JZ OPEN QUESTION: Need to align on PORT number, name, and namespace...with Perses Operator?
proxy := osv1.ConsolePluginProxy{
Alias: "perses-dashboards-proxy",
Copy link
Member

Choose a reason for hiding this comment

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

Proxy name should just be perses based on how the monitoring-plugin links are structured (link)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the Alias: "perses" instead of "perses-dashboard-proxy".

},
}
pluginInfo.ExtraArgs = append(pluginInfo.ExtraArgs, fmt.Sprintf("-perses-dashboards=%s", config.PersesDashboards.Url))
pluginInfo.Proxies = append(pluginInfo.Proxies, proxy)
Copy link
Member

Choose a reason for hiding this comment

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

NIT: Rather than assigning to a variable can we just directly put the definition in the append call.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What do you mean? Can you write an example?

Copy link
Member

@PeterYurkovich PeterYurkovich Jan 13, 2025

Choose a reason for hiding this comment

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

		pluginInfo.ExtraArgs = append(pluginInfo.ExtraArgs, fmt.Sprintf("-perses-dashboards=%s", config.PersesDashboards.Url))
		pluginInfo.Proxies = append(pluginInfo.Proxies, osv1.ConsolePluginProxy{
			Alias:         "perses-dashboards-proxy",
			Authorization: "UserToken",
			Endpoint: osv1.ConsolePluginProxyEndpoint{
				Type: osv1.ProxyTypeService,
				Service: &osv1.ConsolePluginProxyServiceConfig{
					Name:      name,
					Namespace: namespace,
					Port:      9446,
				},
			},
		})
		pluginInfo.LegacyProxies = append(pluginInfo.LegacyProxies, osv1alpha1.ConsolePluginProxy{
			Type:      "Service",
			Alias:     "perses-dashboards-proxy",
			Authorize: true,
			Service: osv1alpha1.ConsolePluginProxyServiceConfig{
				Name:      name,
				Namespace: namespace,
				Port:      9446,
			},
		})

Copy link
Contributor Author

@zhuje zhuje Jan 13, 2025

Choose a reason for hiding this comment

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

Makes sense, ty! Updated created the objects directly in the append() call

@@ -0,0 +1,10 @@
package uiplugin

func contains(array []string, value string) bool {
Copy link
Member

Choose a reason for hiding this comment

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

As of version 1.18, go now contains a slices.contains method so we no longer need to write one ourselves

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ty, updated!

zhuje added 6 commits January 13, 2025 11:10
…ersesDashboards are not required attributes. Then run `make generate` to update CRDs (rather than manual editing).
… rather than a URL. This because COO controls Perses Operator so COO just needs the ServiceName and Namespace to fetch the Perses Service. Requiring the exact endpoint is less flexible.
…d the name, namespace, and port to connect to the Perses Service.
Endpoint: osv1.ConsolePluginProxyEndpoint{
Type: osv1.ProxyTypeService,
Service: &osv1.ConsolePluginProxyServiceConfig{
Name: name,
Copy link
Contributor Author

@zhuje zhuje Jan 13, 2025

Choose a reason for hiding this comment

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

@jgbernalp @PeterYurkovich Is it necessary to require the PersesDashboardsReference > serviceName in the types.go? I think Service name and namespace are already passed in the props here...

Copy link
Member

Choose a reason for hiding this comment

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

Those are the name and namespace of the monitoring-plugin, not the perses service

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahhhh okay.

zhuje added 4 commits January 13, 2025 16:28
…viceName instead of PersesDashboards.Url should be present in UIPlugin CR
…urce.

Update createMonitoringPluginInfo to include name (of service)  and namespace.
Update CRD (custom resource defintiion) to reflect this too.
@zhuje zhuje changed the title DRAFT: OU-571: Add Perses feature flag for the monitoring-console-plugin DRAFT: Add Perses feature flag for the monitoring-console-plugin Jan 30, 2025
@openshift-ci-robot
Copy link
Collaborator

@zhuje: No Jira issue is referenced in the title of this pull request.
To reference a jira issue, add 'XYZ-NNN:' to the title of this pull request and request another refresh with /jira refresh.

Details

In response to this:

/hold

Hold for COO 1.1.0, NOT to be released with COO 1.0.0

JIRA Issue

https://issues.redhat.com/browse/OU-571

Description

  1. . Remove required properties of thanosQuerier and Alertmanager (because we want Perses to be able to be used without ACM)
  • bundle/manifests/observability.openshift.io_uiplugins.yam and
  • deploy/crds/common/observability.openshift.io_uiplugins.yaml
  1. Add Perses-dashboards to the compatibility-matrix, which enables feature flags based on the conditions of the cluster. Perses-dashboards will only be available in OCP 4.19+.
  • pkg/controllers/uiplugin/compatibility_matrix.go
  • pkg/controllers/uiplugin/compatibility_matrix_test.go
  1. Adjust Proxies to include Perses-dashboards.
  • pkg/controllers/uiplugin/monitoring.go
  • pkg/controllers/uiplugin/monitoring_test.go

Other supporting files

  • pkg/apis/uiplugin/v1alpha1/types.go
  • pkg/controllers/uiplugin/utils.go

OPEN QUESTIONS:

  1. Where are we getting the perses-dashboard service endpoint? I need this for monitoring.go
if persesDashboardsFeatureEnabled && config.PersesDashboards.Url == "" {
  	return nil, fmt.Errorf("PersesDashboards location can not be empty for plugin type %s", plugin.Spec.Type)
}
...
pluginInfo.ExtraArgs = append(pluginInfo.ExtraArgs, fmt.Sprintf("-perses-dashboards=%s", config.PersesDashboards.Url))

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@zhuje
Copy link
Contributor Author

zhuje commented Jan 30, 2025

Closed because moved to new PR : #664

@zhuje zhuje closed this Jan 30, 2025
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