Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COO-169: feat: add troubleshooting panel and distributed tracing ui-plugin #480

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Makefile.tools
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ $(SHELLCHECK) shellcheck: $(TOOLS_DIR)
set -ex ;\
[[ -f $(SHELLCHECK) ]] && exit 0 ;\
cd $$(mktemp -d) ;\
curl -sSLo shellcheck-stable.tar.xz "https://github.com/koalaman/shellcheck/releases/download/stable/shellcheck-stable.linux.x86_64.tar.xz";\
OS=$(shell go env GOOS) && ARCH=$(shell go env GOARCH) && \
curl -sSLo shellcheck-stable.tar.xz "https://github.com/koalaman/shellcheck/releases/download/stable/shellcheck-stable.$$(OS).$$(ARCH).tar.xz";\
tar -xJf shellcheck-stable.tar.xz ;\
cp shellcheck-stable/shellcheck $(SHELLCHECK) ;\
version=$(SHELLCHECK_VERSION) ;\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,12 @@ spec:
- securitycontextconstraints
verbs:
- use
- apiGroups:
- tempo.grafana.com
resources:
- tempostacks
verbs:
- list
serviceAccountName: observability-operator-sa
deployments:
- label:
Expand Down
41 changes: 41 additions & 0 deletions bundle/manifests/observability.openshift.io_uiplugins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,51 @@ spec:
spec:
description: UIPluginSpec is the specification for desired state of UIPlugin.
properties:
distributedTracing:
description: DistributedTracing contains configuration for the distributed
tracing console plugin.
properties:
timeout:
description: |-
Timeout is the maximum duration before a query timeout.


The value is expected to be a sequence of digits followed by a unit suffix, which can be 's' (seconds)
or 'm' (minutes).
pattern: ^([0-9]+)([sm]{1})$
type: string
type: object
troubleshootingPanel:
description: TroubleshootingPanel contains configuration for the troubleshooting
console plugin.
properties:
korrel8r:
description: korrel8r defines the Korrel8r instance that the troubleshooting
panel plugin will connect to
properties:
name:
description: Name of the korrel8r instance
type: string
namespace:
description: Namespace of the korrel8r instance
type: string
type: object
timeout:
description: |-
Timeout is the maximum duration before a query timeout.


The value is expected to be a sequence of digits followed by a unit suffix, which can be 's' (seconds)
or 'm' (minutes).
pattern: ^([0-9]+)([sm]{1})$
type: string
type: object
type:
description: Type defines the UI plugin.
enum:
- Dashboards
- TroubleshootingPanel
- DistributedTracing
type: string
required:
- type
Expand Down
10 changes: 6 additions & 4 deletions cmd/operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,12 @@ import (
// prometheus-operator. For thanos we use the default version from
// prometheus-operator.
var defaultImages = map[string]string{
"prometheus": "",
"alertmanager": "",
"thanos": obopo.DefaultThanosImage,
"ui-dashboards": "quay.io/openshift-observability-ui/console-dashboards-plugin:v0.1.0",
"prometheus": "",
"alertmanager": "",
"thanos": obopo.DefaultThanosImage,
"ui-dashboards": "quay.io/openshift-observability-ui/console-dashboards-plugin:v0.1.0",
"ui-troubleshooting-panel": "quay.io/openshift-observability-ui/troubleshooting-panel-console-plugin:v0.1.0",
"ui-distributed-tracing": "quay.io/openshift-observability-ui/distributed-tracing-console-plugin:v0.1.0",
jgbernalp marked this conversation as resolved.
Show resolved Hide resolved
}

func imagesUsed() []string {
Expand Down
41 changes: 41 additions & 0 deletions deploy/crds/common/observability.openshift.io_uiplugins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,51 @@ spec:
spec:
description: UIPluginSpec is the specification for desired state of UIPlugin.
properties:
distributedTracing:
description: DistributedTracing contains configuration for the distributed
tracing console plugin.
properties:
timeout:
description: |-
Timeout is the maximum duration before a query timeout.


The value is expected to be a sequence of digits followed by a unit suffix, which can be 's' (seconds)
or 'm' (minutes).
pattern: ^([0-9]+)([sm]{1})$
type: string
type: object
troubleshootingPanel:
description: TroubleshootingPanel contains configuration for the troubleshooting
console plugin.
properties:
korrel8r:
description: korrel8r defines the Korrel8r instance that the troubleshooting
panel plugin will connect to
properties:
name:
description: Name of the korrel8r instance
type: string
namespace:
description: Namespace of the korrel8r instance
type: string
type: object
timeout:
description: |-
Timeout is the maximum duration before a query timeout.


The value is expected to be a sequence of digits followed by a unit suffix, which can be 's' (seconds)
or 'm' (minutes).
pattern: ^([0-9]+)([sm]{1})$
type: string
type: object
type:
description: Type defines the UI plugin.
enum:
- Dashboards
- TroubleshootingPanel
- DistributedTracing
type: string
required:
- type
Expand Down
6 changes: 6 additions & 0 deletions deploy/operator/observability-operator-cluster-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -249,3 +249,9 @@ rules:
- securitycontextconstraints
verbs:
- use
- apiGroups:
- tempo.grafana.com
resources:
- tempostacks
verbs:
- list
119 changes: 118 additions & 1 deletion docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2854,9 +2854,126 @@ UIPluginSpec is the specification for desired state of UIPlugin.
<td>
Type defines the UI plugin.<br/>
<br/>
<i>Enum</i>: Dashboards<br/>
<i>Enum</i>: Dashboards, TroubleshootingPanel, DistributedTracing<br/>
</td>
<td>true</td>
</tr><tr>
<td><b><a href="#uipluginspecdistributedtracing">distributedTracing</a></b></td>
<td>object</td>
<td>
DistributedTracing contains configuration for the distributed tracing console plugin.<br/>
</td>
<td>false</td>
</tr><tr>
<td><b><a href="#uipluginspectroubleshootingpanel">troubleshootingPanel</a></b></td>
<td>object</td>
<td>
TroubleshootingPanel contains configuration for the troubleshooting console plugin.<br/>
</td>
<td>false</td>
</tr></tbody>
</table>


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



DistributedTracing contains configuration for the distributed tracing console plugin.

<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Required</th>
</tr>
</thead>
<tbody><tr>
<td><b>timeout</b></td>
<td>string</td>
<td>
Timeout is the maximum duration before a query timeout.


The value is expected to be a sequence of digits followed by a unit suffix, which can be 's' (seconds)
or 'm' (minutes).<br/>
</td>
<td>false</td>
</tr></tbody>
</table>


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



TroubleshootingPanel contains configuration for the troubleshooting 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="#uipluginspectroubleshootingpanelkorrel8r">korrel8r</a></b></td>
<td>object</td>
<td>
korrel8r defines the Korrel8r instance that the troubleshooting panel plugin will connect to<br/>
</td>
<td>false</td>
</tr><tr>
<td><b>timeout</b></td>
<td>string</td>
<td>
Timeout is the maximum duration before a query timeout.


The value is expected to be a sequence of digits followed by a unit suffix, which can be 's' (seconds)
or 'm' (minutes).<br/>
</td>
<td>false</td>
</tr></tbody>
</table>


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



korrel8r defines the Korrel8r instance that the troubleshooting panel plugin will connect to

<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Required</th>
</tr>
</thead>
<tbody><tr>
<td><b>name</b></td>
<td>string</td>
<td>
Name of the korrel8r instance<br/>
</td>
<td>false</td>
</tr><tr>
<td><b>namespace</b></td>
<td>string</td>
<td>
Namespace of the korrel8r instance<br/>
</td>
<td>false</td>
</tr></tbody>
</table>

Expand Down
32 changes: 32 additions & 0 deletions docs/user-guides/observability-ui-plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ Using the Observability UI, you can install and manage plugins that extend the o
## Plugins

- [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 [TempoStack](https://docs.openshift.com/container-platform/4.15/observability/distr_tracing/distr_tracing_rn/distr-tracing-rn-3-1-1.html) instance and view trace data from it.

### Dashboards

Expand All @@ -20,3 +22,33 @@ metadata:
spec:
type: Dashboards
```

### Troubleshooting Panel

The plugin will connect to a Korrel8r instance named `korrel8r` in the `korrel8r` namespace. A "Troubleshooting Panel" button is added to the alerts page, which will convert the current alert into a Korrel8r query, then retrieve related neighbors and display them in a topology view.
Copy link

Choose a reason for hiding this comment

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

This is not accurate but can be changed with #497 by @shwetaap

Copy link
Contributor

Choose a reason for hiding this comment

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

Changed it in the PR #497


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

```yaml
apiVersion: observability.openshift.io/v1alpha1
kind: UIPlugin
metadata:
name: troubleshooting-panel-console-plugin
spec:
type: TroubleshootingPanel
```

### Distributed Tracing

The plugin allows a user to select a TempoStack instance and query traces from it to display them as a table and a scatter plot.

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

```yaml
apiVersion: observability.openshift.io/v1alpha1
kind: UIPlugin
metadata:
name: distributed-tracing-console-plugin
spec:
type: DistributedTracing
```
Loading
Loading