Bug 1851095 - 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: unspecified
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.4.z
Assignee: Anik
QA Contact: kuiwang
URL:
Whiteboard:
Depends On: 1850237
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-06-25 15:25 UTC by Anik
Modified: 2020-09-22 06:59 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1850237
Environment:
Last Closed: 2020-09-22 06:58:40 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Github operator-framework operator-lifecycle-manager pull 1746 None open Bug 1851095: Delete subscription metric when an operator is uninstalled 2020-09-11 17:41:47 UTC
Red Hat Product Errata RHBA-2020:3715 None None None 2020-09-22 06:59:00 UTC

Comment 7 kuiwang 2020-09-14 02:56:55 UTC
verify it on 4.4. LGTM


--
kuiwang@Kuis-MacBook-Pro 1851095 % oc get clusterversion
NAME      VERSION                             AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.4.0-0.nightly-2020-09-12-143345   True        False         53m     Cluster version is 4.4.0-0.nightly-2020-09-12-143345
kuiwang@Kuis-MacBook-Pro 1851095 % oc get pod -n openshift-operator-lifecycle-manager
NAME                                READY   STATUS    RESTARTS   AGE
catalog-operator-57967d8c74-wbfbl   1/1     Running   0          79m
olm-operator-5889747db6-rsgnm       1/1     Running   0          79m
packageserver-f4748bcbb-dr2f9       1/1     Running   0          72m
packageserver-f4748bcbb-vkwlf       1/1     Running   0          72m
kuiwang@Kuis-MacBook-Pro 1851095 % oc exec olm-operator-5889747db6-rsgnm -n openshift-operator-lifecycle-manager -- olm --version
OLM version: 0.14.2
git commit: 6307c54ea472e772de9d421201ce5a1ef1f74134
kuiwang@Kuis-MacBook-Pro 1851095 % cat og.yaml
kind: OperatorGroup
apiVersion: operators.coreos.com/v1
metadata:
  name: og-single
  namespace: default
spec:
  targetNamespaces:
  - default

kuiwang@Kuis-MacBook-Pro 1851095 % oc apply -f og.yaml
operatorgroup.operators.coreos.com/og-single created
kuiwang@Kuis-MacBook-Pro 1851095 % 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 1851095 % oc apply -f sub-etcd-092.yaml
subscription.operators.coreos.com/etcd created
kuiwang@Kuis-MacBook-Pro 1851095 % oc get ip
NAME            CSV                   APPROVAL   APPROVED
install-mvn6r   etcdoperator.v0.9.2   Manual     false
kuiwang@Kuis-MacBook-Pro 1851095 % oc edit ip install-mvn6r
Edit cancelled, no changes made.
kuiwang@Kuis-MacBook-Pro 1851095 % oc edit ip install-mvn6r
installplan.operators.coreos.com/install-mvn6r edited
kuiwang@Kuis-MacBook-Pro 1851095 % oc get ip
NAME            CSV                   APPROVAL   APPROVED
install-mmtnd   etcdoperator.v0.9.4   Manual     false
install-mvn6r   etcdoperator.v0.9.2   Manual     true
kuiwang@Kuis-MacBook-Pro 1851095 % oc get csv
NAME                  DISPLAY   VERSION   REPLACES   PHASE
etcdoperator.v0.9.2   etcd      0.9.2                Succeeded

kuiwang@Kuis-MacBook-Pro 1851095 % oc get pods catalog-operator-57967d8c74-wbfbl -n openshift-operator-lifecycle-manager -o=yaml 
apiVersion: v1
kind: Pod
...
  hostIP: 10.0.142.216
  phase: Running
  podIP: 10.128.0.15
  podIPs:
  - ip: 10.128.0.15
  qosClass: Burstable
  startTime: "2020-09-14T01:36:43Z"
kuiwang@Kuis-MacBook-Pro 1851095 % oc exec -c catalog-operator  catalog-operator-57967d8c74-wbfbl -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"} 19
kuiwang@Kuis-MacBook-Pro 1851095 % oc get ip
NAME            CSV                   APPROVAL   APPROVED
install-mmtnd   etcdoperator.v0.9.4   Manual     false
install-mvn6r   etcdoperator.v0.9.2   Manual     true
kuiwang@Kuis-MacBook-Pro 1851095 % oc edit ip install-mmtnd
installplan.operators.coreos.com/install-mmtnd edited
kuiwang@Kuis-MacBook-Pro 1851095 % oc get ip
NAME            CSV                   APPROVAL   APPROVED
install-mmtnd   etcdoperator.v0.9.4   Manual     true
install-mvn6r   etcdoperator.v0.9.2   Manual     true
kuiwang@Kuis-MacBook-Pro 1851095 % 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 1851095 % oc exec -c catalog-operator  catalog-operator-57967d8c74-wbfbl -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"} 6
kuiwang@Kuis-MacBook-Pro 1851095 % oc delete sub etcd
subscription.operators.coreos.com "etcd" deleted
kuiwang@Kuis-MacBook-Pro 1851095 % oc delete csv etcdoperator.v0.9.4
clusterserviceversion.operators.coreos.com "etcdoperator.v0.9.4" deleted
kuiwang@Kuis-MacBook-Pro 1851095 % oc exec -c catalog-operator  catalog-operator-57967d8c74-wbfbl -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 1851095 % 

--

Comment 10 errata-xmlrpc 2020-09-22 06:58:40 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.4.23 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:3715


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