Skip to content

Commit

Permalink
Merge pull request #786 from openshift-cherrypick-robot/cherry-pick-7…
Browse files Browse the repository at this point in the history
…69-to-release-4.10

[release-4.10] Bug 2083242: IR-253: add prometheus rules for image registry operations metrics
  • Loading branch information
openshift-ci[bot] committed Jun 29, 2022
2 parents 52f268f + 834da35 commit d2df5e8
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/README.md
Expand Up @@ -5,3 +5,4 @@ These documents are intended to be used by the Image Registry Operator developer
* [How the Operator gets credentials for the image registry](credentials-flow.md)
* [How to deploy a development build of the Image Registry Operator](development-build.md)
* [The image registry life cycle](life-cycle.md)
* [Exported metrics](metrics.md)
15 changes: 15 additions & 0 deletions docs/metrics.md
@@ -0,0 +1,15 @@
# Exported metrics

## `imageregistry:operations_count:sum`

| Operation | Resource type |
| --------- | ------------------ |
| `get` | `blob`, `manifest` |
| `create` | `blob`, `manifest` |

## `imageregistry:imagestreamtags_count:sum`

| Source | Location | Description |
| ---------- | -------------------- | ------------------------------------------------------------- |
| `imported` | `openshift`, `other` | Image Stream Tags imported in 'openshift' or other namespaces |
| `pushed` | `openshift`, `other` | Image Stream Tags pushed to 'openshift' or other namespaces |
4 changes: 4 additions & 0 deletions manifests/09-prometheus-rules-imagestreams.yaml
Expand Up @@ -3,6 +3,10 @@ kind: PrometheusRule
metadata:
name: imagestreams-rules
namespace: openshift-image-registry
annotations:
include.release.openshift.io/ibm-cloud-managed: "true"
include.release.openshift.io/self-managed-high-availability: "true"
include.release.openshift.io/single-node-developer: "true"
spec:
groups:
- name: imagestreams.rules
Expand Down
44 changes: 44 additions & 0 deletions manifests/09-prometheus-rules-registry-operations.yaml
@@ -0,0 +1,44 @@
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: image-registry-rules
namespace: openshift-image-registry
annotations:
include.release.openshift.io/ibm-cloud-managed: "true"
include.release.openshift.io/self-managed-high-availability: "true"
include.release.openshift.io/single-node-developer: "true"
spec:
groups:
- name: imageregistry.operations.rules
rules:
- expr: |
label_replace(
label_replace(
sum by (operation) (imageregistry_request_duration_seconds_count{operation="BlobStore.ServeBlob"}), "operation", "get", "operation", "(.+)"
), "resource_type", "blob", "resource_type", ""
)
record: imageregistry:operations_count:sum
- expr: |
label_replace(
label_replace(
sum by (operation) (imageregistry_request_duration_seconds_count{operation="BlobStore.Create"}), "operation", "create", "operation", "(.+)"
), "resource_type", "blob", "resource_type", ""
)
record: imageregistry:operations_count:sum
- expr: |
label_replace(
label_replace(
sum by (operation) (imageregistry_request_duration_seconds_count{operation="ManifestService.Get"}), "operation", "get", "operation", "(.+)"
), "resource_type", "manifest", "resource_type", ""
)
record: imageregistry:operations_count:sum
- expr: |
label_replace(
label_replace(
sum by (operation) (imageregistry_request_duration_seconds_count{operation="ManifestService.Put"}), "operation", "create", "operation", "(.+)"
), "resource_type", "manifest", "resource_type", ""
)
record: imageregistry:operations_count:sum

0 comments on commit d2df5e8

Please sign in to comment.