> ## Documentation Index
> Fetch the complete documentation index at: https://docs.jedify.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Monitoring

> Scrape the operator's metrics, turn on its alerts, and add its dashboard, in Google Cloud Managed Service for Prometheus or your own Prometheus.

The operator exports what each check finds as Prometheus metrics, on port 8080 of the `jedify-operator-metrics` Service, in plain HTTP inside the cluster. Nothing in them is a secret.

## Scrape them and turn on the alerts

Scraping, alerts and the dashboard are off until you turn them on, in your copy of `values/jedify-operator.yaml`. With Google Cloud Managed Service for Prometheus, which GKE runs by default:

```yaml theme={null}
metrics:
  podMonitoring: { enabled: true }   # scrape
  gmpRules: { enabled: true }        # alerts
```

With the Prometheus Operator instead:

```yaml theme={null}
metrics:
  serviceMonitor: { enabled: true }  # scrape
  prometheusRule: { enabled: true }  # alerts
```

Then upgrade the operator chart with that file, as in [Upgrades](https://docs.jedify.com/self-hosted/gcp/operate/upgrades.md#3-upgrade-the-operator).

Turn the alerts on together with scraping. Otherwise `JedifyOperatorAbsent` fires, for want of metrics.

## Alerts

| Alert | Fires when | Severity |
| - | - | - |
| `JedifyNotReady` | `Ready` has not been `True` for 15 minutes | warning |
| `JedifyModelGatewayFailing` | The model gateway failed the operator's calls for 10 minutes | critical |
| `JedifyInstallFailed` | The operator could not install or upgrade for 5 minutes | critical |
| `JedifyChecksStale` | No check for 30 minutes | warning |
| `JedifyOperatorAbsent` | No operator metrics for 15 minutes | warning |

## Metrics

| Series | Value |
| - | - |
| `jedify_condition{namespace,name,type,status}` | 1 for each condition's current status (`true`, `false` or `unknown`), 0 for the others |
| `jedify_model_answered{namespace,name,model,kind}` | 1 when the gateway answered the operator's last call for that model |
| `jedify_last_check_timestamp_seconds{namespace,name}` | When the operator last ran the checks |
| `jedify_release_info{namespace,name,release,chart,revision}` | 1 for each Helm release installed |

## A dashboard

With Grafana's dashboard sidecar, this creates a ConfigMap it picks up:

```yaml theme={null}
metrics:
  grafanaDashboard: { enabled: true }
```

## Argo CD

If Argo CD manages your Jedify resource, give it a health check, and the resource shows `Healthy`, `Degraded` or `Progressing` with the `Ready` condition's message. Add this to `argocd-cm`:

```yaml theme={null}
data:
  resource.customizations.health.jedify.com_Jedify: |
    hs = {}
    if obj.status ~= nil and obj.status.observedGeneration ~= nil and obj.metadata.generation ~= nil
        and obj.status.observedGeneration < obj.metadata.generation then
      hs.status = "Progressing"
      hs.message = "The operator has not checked this spec yet"
      return hs
    end
    if obj.status ~= nil and obj.status.conditions ~= nil then
      for _, c in ipairs(obj.status.conditions) do
        if c.type == "Ready" then
          if c.status == "True" then
            hs.status = "Healthy"
          elseif c.status == "False" then
            hs.status = "Degraded"
          else
            hs.status = "Progressing"
          end
          hs.message = c.message
          return hs
        end
      end
    end
    hs.status = "Progressing"
    hs.message = "Waiting for the operator's first check"
    return hs
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.