Skip to content

Commit

Permalink
feat: add monitoring-plugin uiplugin
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterYurkovich committed Oct 16, 2024
1 parent a52ed9b commit 83466f1
Show file tree
Hide file tree
Showing 12 changed files with 509 additions and 7 deletions.
35 changes: 35 additions & 0 deletions bundle/manifests/observability.openshift.io_uiplugins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,38 @@ spec:
required:
- lokiStack
type: object
monitoring:
description: Monitoring contains configuration for the monitoring
console plugin.
properties:
alertmanager:
description: Alertmanager points to the alertmanager instance
of which it should create a proxy to.
properties:
url:
description: Url of the Alertmanager to proxy to.
minLength: 1
type: string
required:
- url
type: object
x-kubernetes-map-type: atomic
thanosQuerier:
description: ThanosQuerier points to the thanos-querier service
of which it should create a proxy to.
properties:
url:
description: Url of the ThanosQuerier to proxy to.
minLength: 1
type: string
required:
- url
type: object
x-kubernetes-map-type: atomic
required:
- alertmanager
- thanosQuerier
type: object
troubleshootingPanel:
description: TroubleshootingPanel contains configuration for the troubleshooting
console plugin.
Expand All @@ -165,6 +197,7 @@ spec:
- TroubleshootingPanel
- DistributedTracing
- Logging
- Monitoring
type: string
required:
- type
Expand Down Expand Up @@ -256,6 +289,8 @@ spec:
rule: self.spec.type != 'DistributedTracing' || self.metadata.name == 'distributed-tracing'
- message: UIPlugin name must be 'dashboards' if type is Dashboards
rule: self.spec.type != 'Dashboards' || self.metadata.name == 'dashboards'
- message: UIPlugin name must be 'monitoring' if type is Monitoring
rule: self.spec.type != 'Monitoring' || self.metadata.name == 'monitoring'
served: true
storage: true
subresources:
Expand Down
1 change: 1 addition & 0 deletions cmd/operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ var defaultImages = map[string]string{
"ui-troubleshooting-panel": "quay.io/openshift-observability-ui/troubleshooting-panel-console-plugin:v0.2.0",
"ui-distributed-tracing": "quay.io/openshift-observability-ui/distributed-tracing-console-plugin:v0.2.0",
"ui-logging": "quay.io/openshift-logging/logging-view-plugin:6.0.0",
"ui-monitoring": "quay.io/openshift-observability-ui/monitoring-console-plugin:latest",
"korrel8r": "quay.io/korrel8r/korrel8r:0.7.2",
}

Expand Down
35 changes: 35 additions & 0 deletions deploy/crds/common/observability.openshift.io_uiplugins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,38 @@ spec:
required:
- lokiStack
type: object
monitoring:
description: Monitoring contains configuration for the monitoring
console plugin.
properties:
alertmanager:
description: Alertmanager points to the alertmanager instance
of which it should create a proxy to.
properties:
url:
description: Url of the Alertmanager to proxy to.
minLength: 1
type: string
required:
- url
type: object
x-kubernetes-map-type: atomic
thanosQuerier:
description: ThanosQuerier points to the thanos-querier service
of which it should create a proxy to.
properties:
url:
description: Url of the ThanosQuerier to proxy to.
minLength: 1
type: string
required:
- url
type: object
x-kubernetes-map-type: atomic
required:
- alertmanager
- thanosQuerier
type: object
troubleshootingPanel:
description: TroubleshootingPanel contains configuration for the troubleshooting
console plugin.
Expand All @@ -165,6 +197,7 @@ spec:
- TroubleshootingPanel
- DistributedTracing
- Logging
- Monitoring
type: string
required:
- type
Expand Down Expand Up @@ -256,6 +289,8 @@ spec:
rule: self.spec.type != 'DistributedTracing' || self.metadata.name == 'distributed-tracing'
- message: UIPlugin name must be 'dashboards' if type is Dashboards
rule: self.spec.type != 'Dashboards' || self.metadata.name == 'dashboards'
- message: UIPlugin name must be 'monitoring' if type is Monitoring
rule: self.spec.type != 'Monitoring' || self.metadata.name == 'monitoring'
served: true
storage: true
subresources:
Expand Down
97 changes: 96 additions & 1 deletion docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3170,7 +3170,7 @@ UIPluginSpec is the specification for desired state of UIPlugin.
<td>
Type defines the UI plugin.<br/>
<br/>
<i>Enum</i>: Dashboards, TroubleshootingPanel, DistributedTracing, Logging<br/>
<i>Enum</i>: Dashboards, TroubleshootingPanel, DistributedTracing, Logging, Monitoring<br/>
</td>
<td>true</td>
</tr><tr>
Expand All @@ -3197,6 +3197,13 @@ UIPluginSpec is the specification for desired state of UIPlugin.
It only applies to UIPlugin Type: Logging.<br/>
</td>
<td>false</td>
</tr><tr>
<td><b><a href="#uipluginspecmonitoring">monitoring</a></b></td>
<td>object</td>
<td>
Monitoring contains configuration for the monitoring console plugin.<br/>
</td>
<td>false</td>
</tr><tr>
<td><b><a href="#uipluginspectroubleshootingpanel">troubleshootingPanel</a></b></td>
<td>object</td>
Expand Down Expand Up @@ -3423,6 +3430,94 @@ It always references a LokiStack in the "openshift-logging" namespace.
</table>


### UIPlugin.spec.monitoring
<sup><sup>[↩ Parent](#uipluginspec)</sup></sup>



Monitoring contains configuration for the monitoring console plugin.

<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Required</th>
</tr>
</thead>
<tbody><tr>
<td><b><a href="#uipluginspecmonitoringalertmanager">alertmanager</a></b></td>
<td>object</td>
<td>
Alertmanager points to the alertmanager instance of which it should create a proxy to.<br/>
</td>
<td>true</td>
</tr><tr>
<td><b><a href="#uipluginspecmonitoringthanosquerier">thanosQuerier</a></b></td>
<td>object</td>
<td>
ThanosQuerier points to the thanos-querier service of which it should create a proxy to.<br/>
</td>
<td>true</td>
</tr></tbody>
</table>


### UIPlugin.spec.monitoring.alertmanager
<sup><sup>[↩ Parent](#uipluginspecmonitoring)</sup></sup>



Alertmanager points to the alertmanager instance of which it should create a proxy to.

<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Required</th>
</tr>
</thead>
<tbody><tr>
<td><b>url</b></td>
<td>string</td>
<td>
Url of the Alertmanager to proxy to.<br/>
</td>
<td>true</td>
</tr></tbody>
</table>


### UIPlugin.spec.monitoring.thanosQuerier
<sup><sup>[↩ Parent](#uipluginspecmonitoring)</sup></sup>



ThanosQuerier points to the thanos-querier service of which it should create a proxy to.

<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Required</th>
</tr>
</thead>
<tbody><tr>
<td><b>url</b></td>
<td>string</td>
<td>
Url of the ThanosQuerier to proxy to.<br/>
</td>
<td>true</td>
</tr></tbody>
</table>


### UIPlugin.spec.troubleshootingPanel
<sup><sup>[↩ Parent](#uipluginspec)</sup></sup>

Expand Down
53 changes: 48 additions & 5 deletions docs/user-guides/observability-ui-plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@ Using the Observability UI, you can install and manage plugins that extend the o
- [dashboards](#dashboards): Add enhanced dashboards to the OpenShift web console. This plugin allows you to add other Prometheus datasources present in the cluster, apart from the in-cluster one, to the default dashboards.
- [troubleshooting-panel](#troubleshooting-panel): Add the troubleshooting panel to the OpenShift web console. This plugin adds a troubleshooting panel to the console dashboard, which queries and displays results from [Korrel8r](https://github.com/korrel8r/korrel8r) to help troubleshoot issues.
- [distributed-tracing](#distributed-tracing): Add the Observability > Traces page to the Openshift web console. This plugin allows a user to select a [Tempo](https://docs.openshift.com/container-platform/4.13/observability/distr_tracing/distr_tracing_arch/distr-tracing-architecture.html#distr-tracing-architecture_distributed-tracing-architecture) instance and view trace data from it.
- [monitoring](#monitoring): Add the a number of Observing pages to the Openshift web related to Alerting. This plugin allows a user to view Alerts, Silences, and Alert rules.

| __COO Version__ | __OCP Versions__ | __Dashboards__ | __Distributed Tracing__ | __Logging__ | __Troubleshooting Panel__ |
| --------------- | ------------------- | -------------- | ----------------------- | ----------- | ------------------------- |
| 0.2.0 | 4.11 |||||
| 0.3.0+ | 4.11 - 4.15 |||||
| 0.3.0+ | 4.16+ |||||
| __COO Version__ | __OCP Versions__ | __Dashboards__ | __Distributed Tracing__ | __Logging__ | __Troubleshooting Panel__ | __Monitoring__ |
| --------------- | ------------------- | -------------- | ----------------------- | ----------- | ------------------------- | ---------------|
| 0.2.0 | 4.11 ||||||
| 0.3.0+ | 4.11 - 4.15 ||||||
| 0.3.0 - 0.4.0 | 4.16+ ||||||
| 1.0.0+ | 4.11 - 4.13 ||||||
| 1.0.0+ | 4.14 - 4.15 ||||||
| 1.0.0+ | 4.14+ ||||||

Some plugin offer additional features that are available dependant on the cluster version. COO will always deploy all features available for the cluster it is running on.

Expand Down Expand Up @@ -129,3 +133,42 @@ spec:
logsLimit: 50
timeout: 30s
```

### Monitoring

The plugin adds monitoring related UI features to the OpenShift web console, mostly related to the ACM perspective. A number of new pages and features are enabled through this plugin. Including, but not limited to:
- `ACM > Observe > Alerting`
- `ACM > Observe > Alerting > Silences`
- `ACM > Observe > Alerting > Alert rules`

This plugin is only able to be deployed by COO with the `acm-alerting` configuration enabled. Other pages which are typically distributed with the monitoring-plugin, such as `Admin > Observe > Dashboards`, are only available in the monitoring-plugin when deployed through [CMO](https://github.com/openshift/cluster-monitoring-operator).

#### Plugin Creation

To enable to monitoring console plugin, create a `UIPlugin` CR. The following example shows how to create a CR to enable the monitoring console plugin:

```yaml
apiVersion: observability.openshift.io/v1alpha1
kind: UIPlugin
metadata:
name: monitoring
spec:
type: Monitoring
monitoring:
alertmanager:
url: 'https://alertmanager.open-cluster-management-observability.svc:9095'
thanosQuerier:
url: 'https://rbac-query-proxy.open-cluster-management-observability.svc:8443'
```

#### Feature List

| __Feature__ | __Description__ |
| -------------- | --------------------------------------------------------------------------------------------------------------- |
| `acm-alerting` | Adds alerting UI to multi-cluster view. Configures proxies to connect with any alertmanager and thanos-querier. |

#### Feature Matrix

| __COO Version__ | __OCP Versions__ | __Features__ |
| --------------- | ------------------- | -------------- |
| 1.0.0+ | 4.14+ | `acm-alerting` |
47 changes: 46 additions & 1 deletion pkg/apis/uiplugin/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
// +kubebuilder:validation:XValidation:rule="self.spec.type != 'TroubleshootingPanel' || self.metadata.name == 'troubleshooting-panel'",message="UIPlugin name must be 'troubleshooting-panel' if type is TroubleshootingPanel"
// +kubebuilder:validation:XValidation:rule="self.spec.type != 'DistributedTracing' || self.metadata.name == 'distributed-tracing'",message="UIPlugin name must be 'distributed-tracing' if type is DistributedTracing"
// +kubebuilder:validation:XValidation:rule="self.spec.type != 'Dashboards' || self.metadata.name == 'dashboards'",message="UIPlugin name must be 'dashboards' if type is Dashboards"
// +kubebuilder:validation:XValidation:rule="self.spec.type != 'Monitoring' || self.metadata.name == 'monitoring'",message="UIPlugin name must be 'monitoring' if type is Monitoring"
type UIPlugin struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand All @@ -36,7 +37,7 @@ type UIPluginList struct {
Items []UIPlugin `json:"items"`
}

// +kubebuilder:validation:Enum=Dashboards;TroubleshootingPanel;DistributedTracing;Logging
// +kubebuilder:validation:Enum=Dashboards;TroubleshootingPanel;DistributedTracing;Logging;Monitoring
type UIPluginType string

const (
Expand All @@ -46,6 +47,8 @@ const (
TypeDistributedTracing UIPluginType = "DistributedTracing"
// TroubleshootingPanel deploys the Troubleshooting Panel Dynamic Plugin for the OpenShift Console
TypeTroubleshootingPanel UIPluginType = "TroubleshootingPanel"
// Monitoring deploys the Monitoring Plugin for the OpenShift Console
TypeMonitoring UIPluginType = "Monitoring"

// TypeLogging deploys the Logging View Plugin for OpenShift Console.
TypeLogging UIPluginType = "Logging"
Expand Down Expand Up @@ -132,6 +135,43 @@ type LokiStackReference struct {
Name string `json:"name"`
}

// MonitoringConfig contains options for configuring the monitoring console plugin.
type MonitoringConfig struct {
// Alertmanager points to the alertmanager instance of which it should create a proxy to.
//
// +kubebuilder:validation:Required
Alertmanager AlertmanagerReference `json:"alertmanager"`

// ThanosQuerier points to the thanos-querier service of which it should create a proxy to.
//
// +kubebuilder:validation:Required
ThanosQuerier ThanosQuerierReference `json:"thanosQuerier"`
}

// Alertmanager is used to configure a reference to a alertmanage that should be used
// by the monitoring console plugin.
//
// +structType=atomic
type AlertmanagerReference struct {
// Url of the Alertmanager to proxy to.
//
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinLength:=1
Url string `json:"url"`
}

// ThanosQuerier is used to configure a reference to a thanos-querier service that should be used
// by the monitoring console plugin.
//
// +structType=atomic
type ThanosQuerierReference struct {
// Url of the ThanosQuerier to proxy to.
//
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinLength:=1
Url string `json:"url"`
}

// UIPluginSpec is the specification for desired state of UIPlugin.
//
// +kubebuilder:validation:XValidation:rule="self.type == 'TroubleshootingPanel' || !has(self.troubleshootingPanel)", message="Troubleshooting Panel configuration is only supported with the TroubleshootingPanel type"
Expand Down Expand Up @@ -164,6 +204,11 @@ type UIPluginSpec struct {
//
// +kubebuilder:validation:Optional
Logging *LoggingConfig `json:"logging,omitempty"`

// Monitoring contains configuration for the monitoring console plugin.
//
// +kubebuilder:validation:Optional
Monitoring *MonitoringConfig `json:"monitoring,omitempty"`
}

// UIPluginStatus defines the observed state of UIPlugin.
Expand Down
Loading

0 comments on commit 83466f1

Please sign in to comment.