Bug 1850237 - subscription_sync_total metric potentially not getting removed
Summary: subscription_sync_total metric potentially not getting removed
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: OLM
Version: 4.5
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.5.z
Assignee: Anik
QA Contact: kuiwang
URL:
Whiteboard:
Depends On: 1822396
Blocks: 1851095
TreeView+ depends on / blocked
 
Reported: 2020-06-23 19:14 UTC by Anik
Modified: 2020-08-17 20:05 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1822396
: 1851095 (view as bug list)
Environment:
Last Closed: 2020-08-17 20:05:19 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Github operator-framework operator-lifecycle-manager pull 1591 None closed Bug 1850237: Delete subscription metric when an operator is uninstalled 2020-09-14 02:47:05 UTC
Red Hat Product Errata RHBA-2020:3330 None None None 2020-08-17 20:05:40 UTC

Comment 6 kuiwang 2020-08-07 06:28:05 UTC
verify it on 4.5. LGTM

--
kuiwang@Kuis-MacBook-Pro 1850237 % oc get clusterversion
NAME      VERSION                             AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.5.0-0.nightly-2020-08-06-215703   True        False         2m59s   Cluster version is 4.5.0-0.nightly-2020-08-06-215703
kuiwang@Kuis-MacBook-Pro 1850237 % oc get pod -n openshift-operator-lifecycle-manager
NAME                               READY   STATUS    RESTARTS   AGE
catalog-operator-9bc6764d5-pl6ql   1/1     Running   0          33m
olm-operator-7fb5f54968-gs9b2      1/1     Running   0          33m
packageserver-68c968cc7c-kvzrx     1/1     Running   0          18m
packageserver-68c968cc7c-rmvtk     1/1     Running   0          18m
kuiwang@Kuis-MacBook-Pro 1850237 % oc exec olm-operator-7fb5f54968-gs9b2 -n openshift-operator-lifecycle-manager -- olm --version
OLM version: 0.15.1
git commit: 56976b6ce26de6b0685784a28f7947e37c0870c9


kuiwang@Kuis-MacBook-Pro 1850237 % cat og.yaml 
kind: OperatorGroup
apiVersion: operators.coreos.com/v1
metadata:
  name: og-single
  namespace: default
spec:
  targetNamespaces:
  - default

kuiwang@Kuis-MacBook-Pro 1850237 % oc apply -f og.yaml
operatorgroup.operators.coreos.com/og-single created


kuiwang@Kuis-MacBook-Pro 1850237 % cat sub-etcd-092.yaml 
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: etcd
  namespace: default
spec:
  channel: singlenamespace-alpha
  installPlanApproval: Manual
  name: etcd
  source: community-operators
  sourceNamespace: openshift-marketplace
  startingCSV: etcdoperator.v0.9.2
kuiwang@Kuis-MacBook-Pro 1850237 % oc apply -f sub-etcd-092.yaml 
subscription.operators.coreos.com/etcd created
kuiwang@Kuis-MacBook-Pro 1850237 % oc get ip
NAME            CSV                   APPROVAL   APPROVED
install-z8mdv   etcdoperator.v0.9.2   Manual     false
kuiwang@Kuis-MacBook-Pro 1850237 % oc edit ip install-z8mdv
installplan.operators.coreos.com/install-z8mdv edited
kuiwang@Kuis-MacBook-Pro 1850237 % oc get ip
NAME            CSV                   APPROVAL   APPROVED
install-5hm9k   etcdoperator.v0.9.4   Manual     false
install-z8mdv   etcdoperator.v0.9.2   Manual     true

kuiwang@Kuis-MacBook-Pro 1850237 % oc get csv
NAME                  DISPLAY   VERSION   REPLACES   PHASE
etcdoperator.v0.9.2   etcd      0.9.2                Succeeded
kuiwang@Kuis-MacBook-Pro 1850237 % oc get pods  -n openshift-operator-lifecycle-manager
NAME                               READY   STATUS    RESTARTS   AGE
catalog-operator-9bc6764d5-pl6ql   1/1     Running   0          37m
olm-operator-7fb5f54968-gs9b2      1/1     Running   0          37m
packageserver-68c968cc7c-kvzrx     1/1     Running   0          22m
packageserver-68c968cc7c-rmvtk     1/1     Running   0          22m
kuiwang@Kuis-MacBook-Pro 1850237 % oc get pods catalog-operator-9bc6764d5-pl6ql -n openshift-operator-lifecycle-manager -o=yaml
apiVersion: v1
kind: Pod
metadata:
...
  hostIP: 10.0.211.165
  phase: Running
  podIP: 10.128.0.15
  podIPs:
  - ip: 10.128.0.15
  qosClass: Burstable
  startTime: "2020-08-07T05:51:09Z"
kuiwang@Kuis-MacBook-Pro 1850237 % oc exec -c catalog-operator  catalog-operator-9bc6764d5-pl6ql -n openshift-operator-lifecycle-manager -- curl -s -k -H "Authorization: Bearer $(oc sa get-token prometheus-k8s -n openshift-monitoring)" https://10.128.0.15:8081/metrics| grep subscription_sync_total
# HELP subscription_sync_total Monotonic count of subscription syncs
# TYPE subscription_sync_total counter
subscription_sync_total{channel="singlenamespace-alpha",installed="etcdoperator.v0.9.2",name="etcd",package="etcd"} 13

kuiwang@Kuis-MacBook-Pro 1850237 % oc get ip 
NAME            CSV                   APPROVAL   APPROVED
install-5hm9k   etcdoperator.v0.9.4   Manual     false
install-z8mdv   etcdoperator.v0.9.2   Manual     true
kuiwang@Kuis-MacBook-Pro 1850237 % oc edit ip install-5hm9k
installplan.operators.coreos.com/install-5hm9k edited
kuiwang@Kuis-MacBook-Pro 1850237 % oc get ip
NAME            CSV                   APPROVAL   APPROVED
install-5hm9k   etcdoperator.v0.9.4   Manual     true
install-z8mdv   etcdoperator.v0.9.2   Manual     true
kuiwang@Kuis-MacBook-Pro 1850237 % oc get csv
NAME                  DISPLAY   VERSION   REPLACES              PHASE
etcdoperator.v0.9.4   etcd      0.9.4     etcdoperator.v0.9.2   Succeeded

kuiwang@Kuis-MacBook-Pro 1850237 % oc exec -c catalog-operator  catalog-operator-9bc6764d5-pl6ql -n openshift-operator-lifecycle-manager -- curl -s -k -H "Authorization: Bearer $(oc sa get-token prometheus-k8s -n openshift-monitoring)" https://10.128.0.15:8081/metrics| grep subscription_sync_total
# HELP subscription_sync_total Monotonic count of subscription syncs
# TYPE subscription_sync_total counter
subscription_sync_total{channel="singlenamespace-alpha",installed="etcdoperator.v0.9.4",name="etcd",package="etcd"} 11
kuiwang@Kuis-MacBook-Pro 1850237 % oc delete sub etcd
subscription.operators.coreos.com "etcd" deleted
kuiwang@Kuis-MacBook-Pro 1850237 % oc delete csv etcdoperator.v0.9.4
clusterserviceversion.operators.coreos.com "etcdoperator.v0.9.4" deleted
kuiwang@Kuis-MacBook-Pro 1850237 % oc exec -c catalog-operator  catalog-operator-9bc6764d5-pl6ql -n openshift-operator-lifecycle-manager -- curl -s -k -H "Authorization: Bearer $(oc sa get-token prometheus-k8s -n openshift-monitoring)" https://10.128.0.15:8081/metrics| grep subscription_sync_total
kuiwang@Kuis-MacBook-Pro 1850237 % 


--

Comment 8 errata-xmlrpc 2020-08-17 20:05:19 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (OpenShift Container Platform 4.5.6 bug fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:3330


Note You need to log in before you can comment on or make changes to this bug.