Skip to content

Commit

Permalink
feat: add monitoring-plugin uiplugin (#575)
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterYurkovich authored Oct 25, 2024
1 parent a74b4a5 commit 48df915
Show file tree
Hide file tree
Showing 18 changed files with 662 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,14 @@ spec:
verbs:
- get
- update
- apiGroups:
- operator.open-cluster-management.io
resources:
- multiclusterhubs
verbs:
- get
- list
- watch
- apiGroups:
- operator.openshift.io
resources:
Expand Down
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 @@ -140,6 +140,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 @@ -160,6 +192,7 @@ spec:
- TroubleshootingPanel
- DistributedTracing
- Logging
- Monitoring
type: string
required:
- type
Expand Down Expand Up @@ -251,6 +284,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 @@ -140,6 +140,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 @@ -160,6 +192,7 @@ spec:
- TroubleshootingPanel
- DistributedTracing
- Logging
- Monitoring
type: string
required:
- type
Expand Down Expand Up @@ -251,6 +284,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
8 changes: 8 additions & 0 deletions deploy/operator/observability-operator-cluster-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,14 @@ rules:
verbs:
- get
- update
- apiGroups:
- operator.open-cluster-management.io
resources:
- multiclusterhubs
verbs:
- get
- list
- watch
- apiGroups:
- operator.openshift.io
resources:
Expand Down
97 changes: 96 additions & 1 deletion docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3896,7 +3896,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 @@ -3922,6 +3922,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 @@ -4144,6 +4151,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` |
5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ go 1.22.7
require (
github.com/go-logr/logr v1.4.2
github.com/google/go-cmp v0.6.0
github.com/openshift/api v0.0.0-20240301093301-ce10821dc999
github.com/openshift/api v0.0.0-20240404200104-96ed2d49b255
github.com/pkg/errors v0.9.1
github.com/prometheus/common v0.60.0
github.com/rhobs/obo-prometheus-operator v0.77.1-rhobs1
github.com/rhobs/obo-prometheus-operator/pkg/apis/monitoring v0.77.1-rhobs1
github.com/stolostron/multiclusterhub-operator v0.0.0-20240626140553-4f1ed6be3b84
go.uber.org/zap v1.27.0
golang.org/x/exp v0.0.0-20240909161429-701f63a606c0
golang.org/x/mod v0.21.0
Expand Down Expand Up @@ -56,7 +57,7 @@ require (
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
Expand Down
10 changes: 6 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I=
github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U=
github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 h1:0VpGH+cDhbDtdcweoyCVsF3fhN8kejK6rFe/2FFX2nU=
github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49/go.mod h1:BkkQ4L1KS1xMt2aWSPStnn55ChGC0DPOn2FQYj+f25M=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
Expand Down Expand Up @@ -186,8 +186,8 @@ github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk=
github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0=
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
github.com/openshift/api v0.0.0-20240301093301-ce10821dc999 h1:+S998xHiJApsJZjRAO8wyedU9GfqFd8mtwWly6LqHDo=
github.com/openshift/api v0.0.0-20240301093301-ce10821dc999/go.mod h1:CxgbWAlvu2iQB0UmKTtRu1YfepRg1/vJ64n2DlIEVz4=
github.com/openshift/api v0.0.0-20240404200104-96ed2d49b255 h1:OPEl/rl/Bt8soLkMUex9PZu9PJB59VPFnaPh/n1Pb3I=
github.com/openshift/api v0.0.0-20240404200104-96ed2d49b255/go.mod h1:CxgbWAlvu2iQB0UmKTtRu1YfepRg1/vJ64n2DlIEVz4=
github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs=
github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ=
Expand Down Expand Up @@ -241,6 +241,8 @@ github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM=
github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stolostron/multiclusterhub-operator v0.0.0-20240626140553-4f1ed6be3b84 h1:kjoi1qzaohRJSzdtZVmLhxJsi9nQmpitjwwp83QcTF8=
github.com/stolostron/multiclusterhub-operator v0.0.0-20240626140553-4f1ed6be3b84/go.mod h1:fVXNVgAb4lcyAurs9qi3UG5bkpRCO2hYmEkj9s9++MY=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
Expand Down
Loading

0 comments on commit 48df915

Please sign in to comment.