Skip to content

Commit

Permalink
Document Prometheus metrics
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
  • Loading branch information
stefanprodan committed Jun 23, 2024
1 parent be643c1 commit 7904904
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
22 changes: 22 additions & 0 deletions docs/api/v1/fluxinstance.md
Original file line number Diff line number Diff line change
Expand Up @@ -659,3 +659,25 @@ Status:
Last Applied Revision: v2.3.0@sha256:4cc5babdb1279ad0177bf513292deadbfa3f7b7c3da0be7fa53b39ab434f7219
Last Attempted Revision: v2.3.0@sha256:4cc5babdb1279ad0177bf513292deadbfa3f7b7c3da0be7fa53b39ab434f7219
```

## FluxInstance Metrics

The Flux Operator exports metrics for the FluxInstance resource.
These metrics are refreshed every time the operator reconciles the instance.

Metrics:

```text
flux_instance_info{uid, kind, name, exported_namespace, ready, suspended, registry, revision}
```

Labels:

- `uid`: The Kubernetes unique identifier of the resource.
- `kind`: The kind of the resource (e.g. `FluxInstance`).
- `name`: The name of the resource (e.g. `flux`).
- `exported_namespace`: The namespace where the resource is deployed (e.g. `flux-system`).
- `ready`: The readiness status of the resource (e.g. `True`, `False` or `Unkown`).
- `suspended`: The suspended status of the resource (e.g. `True` or `False`).
- `registry`: The container registry used by the instance (e.g. `ghcr.io/fluxcd`).
- `revision`: The Flux revision installed by the instance (e.g. `v2.3.0@sha256:75aa209c6a...`).
36 changes: 36 additions & 0 deletions docs/api/v1/fluxreport.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,3 +264,39 @@ The reconciliation behaviour can be configured using the following annotations:

- `fluxcd.controlplane.io/reconcile`: Enable or disable the reconciliation loop. Default is `enabled`, set to `disabled` to pause the reconciliation.
- `fluxcd.controlplane.io/reconcileEvery`: Set the reconciliation interval. Default is `10m`.

## Flux Resource Metrics

The Flux Operator exports metrics for all Flux resources found in the cluster.
These metrics are refreshed at the same time with the update of the FluxReport.

Metrics:

```text
flux_resource_info{uid, kind, name, exported_namespace, ready, suspended, ...}
```

Common labels:

- `uid`: The Kubernetes unique identifier of the resource.
- `kind`: The kind of the resource (e.g. `GitRepository`, `Kustomization`, etc.).
- `name`: The name of the resource (e.g. `flux-system`).
- `exported_namespace`: The namespace of the resource (e.g. `flux-system`).
- `ready`: The readiness status of the resource (e.g. `True`, `False` or `Unkown`).
- `suspended`: The suspended status of the resource (e.g. `True` or `False`).

Specific labels per resource kind:

| Resource Kind | Labels |
|-----------------------|-----------------------------------|
| Kustomization | `revision`, `source_name`, `path` |
| GitRepository | `revision`, `url`, `ref` |
| OCIRepository | `revision`, `url`, `ref` |
| Bucket | `revision`, `url`, `ref` |
| HelmRelease | `revision`, `source_name` |
| HelmChart | `revision`, `source_name` |
| HelmRepository | `revision`, `url` |
| Receiver | `url` |
| ImageRepository | `url` |
| ImagePolicy | `source_name` |
| ImageUpdateAutomation | `source_name` |

0 comments on commit 7904904

Please sign in to comment.