Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ metadata:
categories: Monitoring
certified: "false"
containerImage: observability-operator:1.1.0
createdAt: "2025-04-03T07:29:49Z"
createdAt: "2025-05-09T09:01:23Z"
description: A Go based Kubernetes operator to setup and manage highly available
Monitoring Stack using Prometheus, Alertmanager and Thanos Querier.
operatorframework.io/cluster-monitoring: "true"
Expand Down
10 changes: 10 additions & 0 deletions bundle/manifests/observability.openshift.io_uiplugins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,16 @@ spec:
type: string
type: object
x-kubernetes-map-type: atomic
schema:
description: |-
Schema is the schema to use for logs querying and display.

Defatults to "viaq" if not specified.
enum:
- viaq
- otel
- select
type: string
timeout:
description: |-
Timeout is the maximum duration before a query timeout.
Expand Down
10 changes: 10 additions & 0 deletions deploy/crds/common/observability.openshift.io_uiplugins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,16 @@ spec:
type: string
type: object
x-kubernetes-map-type: atomic
schema:
description: |-
Schema is the schema to use for logs querying and display.

Defatults to "viaq" if not specified.
enum:
- viaq
- otel
- select
type: string
timeout:
description: |-
Timeout is the maximum duration before a query timeout.
Expand Down
11 changes: 11 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4279,6 +4279,17 @@ It only applies to UIPlugin Type: Logging.
It always references a LokiStack in the "openshift-logging" namespace.<br/>
</td>
<td>false</td>
</tr><tr>
<td><b>schema</b></td>
<td>enum</td>
<td>
Schema is the schema to use for logs querying and display.

Defatults to "viaq" if not specified.<br/>
<br/>
<i>Enum</i>: viaq, otel, select<br/>
</td>
<td>false</td>
</tr><tr>
<td><b>timeout</b></td>
<td>string</td>
Expand Down
9 changes: 9 additions & 0 deletions pkg/apis/uiplugin/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,15 @@ type LoggingConfig struct {
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="OCP Console Query Timeout",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:ocpConsoleTimeout"}
// +kubebuilder:validation:Pattern:="^([0-9]+)([sm]{0,1})$"
Timeout string `json:"timeout,omitempty"`

// Schema is the schema to use for logs querying and display.
//
// Defatults to "viaq" if not specified.
//
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="OCP Console Logs Schema",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:ocpConsoleLogsSchema"}
// +kubebuilder:validation:Optional
// +kubebuilder:validation:Enum=viaq;otel;select
Schema string `json:"schema,omitempty"`
}

// LokiStackReference is used to configure a reference to a LokiStack that should be used
Expand Down
4 changes: 3 additions & 1 deletion pkg/controllers/uiplugin/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
type loggingConfig struct {
LogsLimit int32 `yaml:"logsLimit,omitempty"`
Timeout time.Duration `yaml:"timeout,omitempty"`
Schema string `yaml:"schema,omitempty"`
}

func createLoggingPluginInfo(plugin *uiv1alpha1.UIPlugin, namespace, name, image string, features []string, ctx context.Context, dk dynamic.Interface) (*UIPluginInfo, error) {
Expand Down Expand Up @@ -133,7 +134,7 @@ func marshalLoggingPluginConfig(cfg *uiv1alpha1.LoggingConfig) (string, error) {
return "", nil
}

if cfg.LogsLimit == 0 && cfg.Timeout == "" {
if cfg.LogsLimit == 0 && cfg.Timeout == "" && cfg.Schema == "" {
return "", nil
}

Expand All @@ -149,6 +150,7 @@ func marshalLoggingPluginConfig(cfg *uiv1alpha1.LoggingConfig) (string, error) {
pluginCfg := loggingConfig{
LogsLimit: cfg.LogsLimit,
Timeout: timeout,
Schema: cfg.Schema,
}

buf := &bytes.Buffer{}
Expand Down
Loading