# Observability of Trilio with Openshift Monitoring

## **Prerequisites**

#### Enabling Monitoring for User-Defined Projects

To ensure that monitoring is enabled for user-defined projects in OpenShift, verify the configuration using the following command:

```
oc -n openshift-monitoring get configmap cluster-monitoring-config
```

The output should contain the following configuration to confirm that user workload monitoring is enabled:

```
apiVersion: v1
kind: ConfigMap
metadata:
  name: cluster-monitoring-config
  namespace: openshift-monitoring
data:
  config.yaml: |
    enableUserWorkload: true
```

If `enableUserWorkload` is not set to `true`, update the ConfigMap accordingly to enable monitoring for user-defined projects.

#### Using Alertmanager on OpenShift

For setting up and utilizing Alertmanager on OpenShift, refer to the provided documentation [link](https://docs.openshift.com/container-platform/4.16/observability/monitoring/enabling-alert-routing-for-user-defined-projects.html#enabling-the-platform-alertmanager-instance-for-user-defined-alert-routing_enabling-alert-routing-for-user-defined-projects).

#### Installing the Grafana Operator

To visualize the Trilio dashboard in Grafana, install the Grafana Operator on OpenShift. Follow the installation instructions available in the provided article [link](https://developers.redhat.com/articles/2024/08/19/monitor-openshift-virtualization-using-user-defined-projects-and-grafana).

#### Trilio Dashboard Reference

For information regarding the Trilio Dashboard setup and visualization, refer to the provided reference [link](https://docs.trilio.io/kubernetes/advanced-configuration/observability/logging-monitoring-and-measuring#import-grafana-dashboards).

## **Enable Prometheus Exporter in Openshift**&#x20;

* Enabled ServiceMonitor for Prometheus to export Trilio metrics.

```
   apiVersion: triliovault.trilio.io/v1
   kind: TrilioVaultManager
   metadata:
     labels:
       triliovault: k8s
     name: sample-triliovaultmanager
   spec:
     helmValues:
       urlPath: "/"
     applicationScope: Cluster
     tvkInstanceName: "tvk"
     componentConfiguration:
        exporter:
          serviceMonitor:
            enabled: true

```

<figure><img src="/files/9GmXjAxeKtY2OwbpDxUI" alt=""><figcaption><p>Promethus Target should be there if Service Monitor is enabled for T4K</p></figcaption></figure>

<figure><img src="/files/DEItcmhtgr8Av48srlTR" alt=""><figcaption><p>Trilio Metrics can be find under Metrics</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.trilio.io/kubernetes/5.0.x/advanced-configuration/observability/observability-of-trilio-with-openshift-monitoring.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
