Implement Prometheus instrumentation for Flux resources #54
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR improves the observability capabilities of the operator by exporting Prometheus metrics for Flux instance and Flux custom resources. These metrics can be used to monitor both the Flux installation and the Flux-managed deployments, giving users a holistic status report of the cluster state reconciliation.
In addition, this PR makes the operator conform with OpenShift/OLM “Deep Insights” requirements.
Closes: #53
Flux Instance Metrics
The Flux Operator exports metrics for the FluxInstance resource.
These metrics are refreshed every time the operator reconciles the instance.
Metrics:
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
orUnkown
).reason
: The reason for the readiness status (e.g.Progressing
,BuildFailed
,HealthCheckFailed
, etc.).suspended
: The suspended status of the resource (e.g.True
orFalse
).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...
).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:
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
orUnkown
).reason
: The reason for the readiness status (e.g.Progressing
,BuildFailed
,HealthCheckFailed
, etc.).suspended
: The suspended status of the resource (e.g.True
orFalse
).Specific labels per resource kind:
revision
,source_name
,path
revision
,url
,ref
revision
,url
,ref
revision
,url
,ref
revision
,source_name
revision
,source_name
revision
,url
url
url
source_name
source_name