dora-metrics / pelorus

Automate the measurement of organizational behavior
https://pelorus.readthedocs.io/
Apache License 2.0
245 stars 83 forks source link

Lead Time to Change does not reflect on grafana with two type of committime-exporter enabled #1111

Open pacopeng opened 1 year ago

pacopeng commented 1 year ago

OpenShift version

4.10

Problem description

two deployment , go-hello-pipeline and mongo-db. none of them reflect the lead time to change from commit-exporter (both providers image and container image)

go-hello-pipeline image build from tekton with label and annotation with task and transferred from internal registry to standalone quay.

[root@lb-2 ~]#  podman inspect quay.apps.test.lab.local/paco/go-pipeline-hello| jq -r '.[0].Config.Labels'
{
  "architecture": "x86_64",
  "build-date": "2022-10-26T01:47:08",
  "com.redhat.component": "go-toolset-container",
  "com.redhat.license_terms": "https://www.redhat.com/agreements",
  "description": "Go Toolset available as a container is a base platform for building and running various Go applications and frameworks. Go is an easy to learn, powerful, statically typed language in the C/C++ tradition with garbage collection, concurrent programming support, and memory safety features.",
  "distribution-scope": "public",
  "io.buildah.version": "1.23.1",
  "io.k8s.description": "Go Toolset available as a container is a base platform for building and running various Go applications and frameworks. Go is an easy to learn, powerful, statically typed language in the C/C++ tradition with garbage collection, concurrent programming support, and memory safety features.",
  "io.k8s.display-name": "Go 1.17.12",
  "io.openshift.s2i.build.image": "image-registry.openshift-image-registry.svc:5000/openshift/golang:1.17-ubi7",
  "io.openshift.s2i.build.source-location": ".",
  "io.openshift.s2i.scripts-url": "image:///usr/libexec/s2i",
  "io.openshift.tags": "builder,golang,golang117,rh-golang117,go",
  "io.s2i.scripts-url": "image:///usr/libexec/s2i",
  "name": "devtools/go-toolset-rhel7",
  "release": "2.1666745579",
  "summary": "Platform for building and running Go applications",
  "url": "https://access.redhat.com/containers/#/registry.access.redhat.com/devtools/go-toolset-rhel7/images/1.17.12-2.1666745579",
  "vcs-ref": "f408ea11d446fcf044d4f8ffab35b958e6e8131d",
  "vcs-type": "git",
  "vendor": "Red Hat, Inc.",
  "version": "1.17.12"
}

mongo-db image build from Build Config with label automatically attached and transferred from internal registry to standalone quay.

podman inspect quay.apps.test.lab.local/paco/todolist-mongo-go| jq -r '.[0].Config.Labels'
{
  "io.buildah.version": "1.26.4",
  "io.openshift.build.commit.author": "PacoPeng <you@example.com>",
  "io.openshift.build.commit.date": "Fri Nov 3 07:53:12 2023 -0400",
  "io.openshift.build.commit.id": "8ede72c8f8fdb5724563cae0961d91351e59eef0",
  "io.openshift.build.commit.message": "Bug fix 20",
  "io.openshift.build.commit.ref": "master",
  "io.openshift.build.name": "todolist-128",
  "io.openshift.build.namespace": "mongo-persistent",
  "io.openshift.build.source-location": "http://10.73.69.214:7010/root/mig-demo-apps.git"
}

Steps to reproduce

  1. deploy pelorus 0.0.8 with operator in openshift 4.10.60
  2. configure pelorus instance with deployment-exporter and two committer-exporter
  3. upload prepared images from dev env which build by Build configure and Tekton to quay.
  4. created two deployment one is using the image build by Build config and another one use the image build by pipeline.
  5. check grafana dashboard

Pelorus configuration:

spec:
prometheus_storage: true
thanos_bucket_name: pelorus-f8a6ec8f-07bc-491d-bd15-f92d4f959661
openshift_prometheus_basic_auth_pass: changeme
prometheus_retention: 1y
bucket_access_point: >-
ocs-storagecluster-cephobjectstore-https-openshift-storage.apps.ocp2.rd.paas.pek2.redhat.com
custom_ca: true
federate_openshift_monitoring:
enabled: false
openshift_prometheus_htpasswd_auth: 'internal:{SHA}+pvrmeQCmtWmYVOZ57uuITVghrM='
exporters:
instances:
- app_name: deploytime-exporter
enabled: true
exporter_type: deploytime
extraEnv:
- name: LOG_LEVEL
value: DEBUG
- name: NAMESPACES
value: paco-demo
- app_name: committime-exporter
enabled: true
exporter_type: committime
extraEnv:
- name: LOG_LEVEL
value: DEBUG
- name: NAMESPACES
value: paco-demo
- name: PROVIDER
value: image
- app_name: committime-exporter4
enabled: true
exporter_type: committime
extraEnv:
- name: NAMESPACES
value: paco-demo
- name: PROVIDER
value: containerimage
prometheus_storage_pvc_capacity: 2Gi
prometheus_retention_size: 1GB
prometheus_storage_pvc_storageclass: managed-nfs-storage
bucket_access_key: <key>
bucket_secret_access_key:  <secret>

deployment -prod-go-pipeline-hello

kind: Deployment
apiVersion: apps/v1
metadata:
annotations:
deployment.kubernetes.io/revision: '1'
resourceVersion: '1859944991'
name: prod-go-pipeline-hello
namespace: paco-demo
labels:
app: go-pipeline-hello
app.kubernetes.io/component: go-pipeline-hello
app.kubernetes.io/instance: go-pipeline-hello
app.kubernetes.io/name: go-pipeline-hello
app.kubernetes.io/part-of: go-pipeline-hello
app.openshift.io/runtime: golang
app.openshift.io/runtime-version: 1.17-ubi7
spec:
replicas: 1
selector:
matchLabels:
app: go-pipeline-hello
template:
metadata:
creationTimestamp: null
labels:
app: go-pipeline-hello
app.kubernetes.io/name: go-pipeline-hello
deployment: go-pipeline-hello
spec:
containers:
- name: go-pipeline-hello
image: 'quay.apps.test.lab.local/paco/go-pipeline-hello:latest'
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
imagePullPolicy: Always
restartPolicy: Always
terminationGracePeriodSeconds: 30
dnsPolicy: ClusterFirst
securityContext: {}
schedulerName: default-scheduler
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 25%
maxSurge: 25%
revisionHistoryLimit: 10
progressDeadlineSeconds: 600

deployment -mongo

kind: Deployment
apiVersion: apps/v1
metadata:
annotations:
deployment.kubernetes.io/revision: '3'
resourceVersion: '1859975783'
name: mongo
namespace: paco-demo
labels:
app.kubernetes.io/name: prod-mongo
e2e-app: 'true'
spec:
replicas: 1
selector:
matchLabels:
app: mongo
template:
metadata:
creationTimestamp: null
labels:
app: mongo
app.kubernetes.io/name: prod-mongo
e2e-app: 'true'
spec:
restartPolicy: Always
serviceAccountName: default
schedulerName: default-scheduler
terminationGracePeriodSeconds: 30
securityContext: {}
containers:
- resources:
limits:
memory: 512Mi
terminationMessagePath: /dev/termination-log
name: mongo
env:
- name: MONGO_INITDB_ROOT_USERNAME
value: changeme
- name: MONGO_INITDB_ROOT_PASSWORD
value: changeme
- name: MONGO_INITDB_DATABASE
value: todolist
securityContext:
privileged: true
ports:
- name: mongo
containerPort: 27017
protocol: TCP
imagePullPolicy: Always
volumeMounts:
- name: mongo-data
mountPath: /data/db
terminationMessagePolicy: File
image: 'quay.apps.test.lab.local/paco/todolist-mongo-go:latest'
serviceAccount: default
volumes:
- name: mongo-data
emptyDir: {}
dnsPolicy: ClusterFirst
strategy:
type: Recreate
revisionHistoryLimit: 10
progressDeadlineSeconds: 600

Current behavior

no lead time to change

image image

Expected behavior

There should be a lead time to change metrics appeared in the dashboard. as two committer-exporter(image and container image) configured.

Code of Conduct

pacopeng commented 1 year ago

committime-exporter-2-8lccf-committime-exporter.log

committime-exporter4-2-m4r7s-committime-exporter4.log