Skip to content

Commit

Permalink
Add distributed tracing console plugin
Browse files Browse the repository at this point in the history
Change feature gate log name

Fix service account namespace

Add korrel8r name and namespace as UIPlugin configuration variables
  • Loading branch information
PeterYurkovich committed May 21, 2024
1 parent 4b023d2 commit 8e8c731
Show file tree
Hide file tree
Showing 17 changed files with 677 additions and 113 deletions.
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
30 changes: 30 additions & 0 deletions bundle/manifests/observability.openshift.io_uiplugins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,41 @@ 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 max duration before a query timeout
pattern: ^([0-9]+)([smhd]{0,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 max duration before a query timeout
pattern: ^([0-9]+)([smhd]{0,1})$
type: string
type: object
type:
description: Type defines the UI plugin.
enum:
- Dashboards
- TroubleshootingPanel
- DistributedTracing
type: string
required:
- type
Expand Down
1 change: 1 addition & 0 deletions cmd/operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ var defaultImages = map[string]string{
"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",
}

func imagesUsed() []string {
Expand Down
30 changes: 30 additions & 0 deletions deploy/crds/common/observability.openshift.io_uiplugins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,41 @@ 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 max duration before a query timeout
pattern: ^([0-9]+)([smhd]{0,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 max duration before a query timeout
pattern: ^([0-9]+)([smhd]{0,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
111 changes: 110 additions & 1 deletion docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2854,9 +2854,118 @@ UIPluginSpec is the specification for desired state of UIPlugin.
<td>
Type defines the UI plugin.<br/>
<br/>
<i>Enum</i>: Dashboards, TroubleshootingPanel<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 max duration before a query timeout<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 max duration before a query timeout<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
18 changes: 17 additions & 1 deletion docs/user-guides/observability-ui-plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +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](#dashboards): 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.
- [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 Down Expand Up @@ -36,3 +37,18 @@ metadata:
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
```
56 changes: 54 additions & 2 deletions pkg/apis/uiplugin/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,73 @@ type UIPluginList struct {
Items []UIPlugin `json:"items"`
}

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

const (
// Dashboards deploys the Dashboards Dynamic Plugin for OpenShift Console.
TypeDashboards UIPluginType = "Dashboards"
TypeDashboards UIPluginType = "Dashboards"
// DistributedTracing deploys the Distributed Tracing Dynamic Plugin for the OpenShift Console
TypeDistributedTracing UIPluginType = "DistributedTracing"
// TroubleshootingPanel deploys the Troubleshooting Panel Dynamic Plugin for the OpenShift Console
TypeTroubleshootingPanel UIPluginType = "TroubleshootingPanel"
)

// TroubleshootingPanelConfig contains options for configuring the Troubleshooting Panel plugin
type TroubleshootingPanelConfig struct {
// Timeout is the max duration before a query timeout
//
// +optional
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="OCP Console Query Timeout",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:ocpConsoleTimeout"}
// +kubebuilder:validation:Pattern:="^([0-9]+)([smhd]{0,1})$"
Timeout string `json:"timeout,omitempty"`
// korrel8r defines the Korrel8r instance that the troubleshooting panel plugin will connect to
//
// +optional
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Korrel8r Instance"
Korrel8r TroubleshootingPanelKorrel8rConfig `json:"korrel8r,omitempty"`
}

type TroubleshootingPanelKorrel8rConfig struct {
// Name of the korrel8r instance
//
// +optional
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Korrel8r Instance Name"
Name string `json:"name,omitempty"`

// Namespace of the korrel8r instance
//
// +optional
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Korrel8r Instance Namespace"
Namespace string `json:"namespace,omitempty"`
}

// DistributedTracingConfig contains options for configuring the Distributed Tracing plugin
type DistributedTracingConfig struct {
// Timeout is the max duration before a query timeout
//
// +optional
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="OCP Console Query Timeout",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:ocpConsoleTimeout"}
// +kubebuilder:validation:Pattern:="^([0-9]+)([smhd]{0,1})$"
Timeout string `json:"timeout,omitempty"`
}

// UIPluginSpec is the specification for desired state of UIPlugin.
type UIPluginSpec struct {
// Type defines the UI plugin.
// +required
// +kubebuilder:validation:Required
Type UIPluginType `json:"type"`

// TroubleshootingPanel contains configuration for the troubleshooting console plugin.
//
// +kubebuilder:validation:Optional
TroubleshootingPanel *TroubleshootingPanelConfig `json:"troubleshootingPanel,omitempty"`

// DistributedTracing contains configuration for the distributed tracing console plugin.
//
// +kubebuilder:validation:Optional
DistributedTracing *DistributedTracingConfig `json:"distributedTracing,omitempty"`
}

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

0 comments on commit 8e8c731

Please sign in to comment.