The Number of Instance Statistics pipelines is always zero

Summary

The number of Instance Statistics pipelines is always zero

Steps to reproduce

there are lots of projects in the respostory and amonst every project has the .gitlab-ci.yml to define the pipeline. In the runner reports i can see a lots of pipeline runned successfully. But in the instanc statistics, the number of pipelines is always zero

Example Project

this is the project's .gitlab-ci.yml

image: docker:stable

variables:
  MAVEN_OPTS: " -Xms1g -Xmx1g -Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=/root/.m2/repository    -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true    -Djava.awt.headless=true"
  MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true"
  DOCKER_DRIVER: overlay2
  DOCKER_HOST: tcp://localhost:2375
  # 镜像命名: 项目命名空间/项目名称/分支名称:提交SHA前8位
  IMAGE_NAME: $DOCKER_PRI_REGISTRY/$CI_PROJECT_PATH/$CI_COMMIT_REF_SLUG:$CI_COMMIT_SHORT_SHA


### !!!使用注意!!!
### 这里暂时无法使用$DOCKER_PRI_REGISTRY传递私有docker仓库域名,需要手工修改下
services:
  - name: docker:dind
    command: ["--insecure-registry=****:30005"]

stages:
  # 由于maven或者gradle中test任务依赖于build,且gitlab-docker-ruuner为每个任务单独建立一个docker环境。为了避免不必要的任务资源传递,直接使用test任务合并build和test
  # - build
  - test
  - image
  - deploy
#  - auto-test

#k8s部署脚本模板
.k8s-deploy-template: &k8s_deploy_definition
  image: lachlanevenson/k8s-kubectl:latest
  script: |
    if [ "${BUILD_ENV}" != "node" ]; then export port=8080; else export port=80; fi

    cat >> deployment.yaml <<EOF
    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: $CI_ENVIRONMENT_SLUG
      namespace: gitlab-managed-apps
    spec:
      replicas: 1
      selector:
        matchLabels:
          name: $CI_ENVIRONMENT_SLUG
      template:
        metadata:
          labels:
            name: $CI_ENVIRONMENT_SLUG
        spec:
          nodeSelector:
            hanlin.arch: review
          containers:
            - name: $CI_ENVIRONMENT_SLUG
              image: $IMAGE_NAME
    EOF

    if [ "${BUILD_ENV}" != "node" ]; then
    cat >> deployment.yaml <<EOF
              args:
                - "-Djava.security.egd=file:/dev/./urandom"
                - "-Xms512m -Xmx512m"
                - "-server"
                - "-jar"
                - "/app.jar"
                - "--server.port=${port}"
                - "--spring.profiles.active=test"
    EOF
    fi
      cat >> deployment.yaml <<EOF
              ports:
                - name: http
                  containerPort: ${port}
    ---
    apiVersion: v1
    kind: Service
    metadata:
      name: $CI_ENVIRONMENT_SLUG-service
      namespace: gitlab-managed-apps
    spec:
      selector:
        name: $CI_ENVIRONMENT_SLUG
      ports:
        - name: http
          port: ${port}
          targetPort: ${port}
          protocol: TCP
    ---
    apiVersion:  networking.k8s.io/v1beta1
    kind: Ingress
    metadata:
      name: $CI_ENVIRONMENT_SLUG-ingress
      namespace: gitlab-managed-apps
      annotations:
        kubernetes.io/ingress.class: nginx
    spec:
      rules:
        - host: $CI_ENVIRONMENT_SLUG.*.*
          http:
            paths:
              - path: /
                backend:
                  serviceName: $CI_ENVIRONMENT_SLUG-service
                  servicePort: ${port}
      tls:
        - hosts:
            - $CI_ENVIRONMENT_SLUG.*.*
          secretName: *
    EOF

    cat >> deployment.sh <<EOF
    if [ $(kubectl --insecure-skip-tls-verify get deploy ${CI_ENVIRONMENT_SLUG} -n gitlab-managed-apps --no-headers=true -o custom-columns=replicas:.status.replicas || echo 0) -gt 0 ]
    then
    	echo 'the deployment is already exists, do image update ...'
    	kubectl --insecure-skip-tls-verify set image deployment/${CI_ENVIRONMENT_SLUG} ${CI_ENVIRONMENT_SLUG}=${IMAGE_NAME} -n gitlab-managed-apps
    else
    	echo 'the deployment has not been deployed, do create with record...'
    	kubectl --insecure-skip-tls-verify create -f deployment.yaml --record
    fi
    EOF

    sh ./deployment.sh

    echo "the environment url is https://${CI_ENVIRONMENT_SLUG}.*.*"

.k8s-clean-template: &k8s_clean_definition
  image: lachlanevenson/k8s-kubectl:latest
  script:
    - kubectl --insecure-skip-tls-verify delete deployment $CI_ENVIRONMENT_SLUG -n gitlab-managed-apps
    - kubectl --insecure-skip-tls-verify delete service $CI_ENVIRONMENT_SLUG-service -n gitlab-managed-apps
    - kubectl --insecure-skip-tls-verify delete ingress $CI_ENVIRONMENT_SLUG-ingress -n gitlab-managed-apps

maven-test-pkg:
  image: maven:latest
  stage: test
  script:
    - 'mvn $MAVEN_CLI_OPTS test'
    # 打包
    - "mvn $MAVEN_CLI_OPTS package -U"
  only:
    variables:
      - $BUILD_ENV == "maven"
  artifacts:
    name: "$CI_PROJECT_NAME-$CI_COMMIT_REF_SLUG"
    #    untracked: true
    paths:
      - $BUILD_PATH
    reports:
      junit: $JUNIT_REPORTS
  tags:
    - k8s

gradle-test-pkg:
  image: openjdk:11
  stage: test
  script:
    - 'chmod +x ./gradlew'
    - './gradlew test bootJar'
  only:
    variables:
      - $BUILD_ENV == "gradle"
  artifacts:
    name: "$CI_PROJECT_NAME-$CI_COMMIT_REF_SLUG"
    #    untracked: true
    paths:
      - $BUILD_PATH
      - $JUNIT_REPORTS
    reports:
      junit: $JUNIT_REPORTS

# 支持前端编译打包
node-test-pkg:
  image: node:8
  stage: test
  script:
    - 'npm install'
    - 'npm run build:stage'
  only:
    variables:
      - $BUILD_ENV == "node"
  artifacts:
    name: "$CI_PROJECT_NAME-$CI_COMMIT_REF_SLUG"
    paths:
      - $BUILD_PATH

build-push:
  stage: image
  script:
    # 登录
    - "docker login -u $REGISTRY_USER -p $REGISTRY_PWD $DOCKER_PRI_REGISTRY"
    # 编译镜像
    - "docker image build --build-arg BUILD_PATH=${BUILD_PATH} -t $IMAGE_NAME ."
    # 推送镜像到仓库
    - "docker push $IMAGE_NAME"

# 部署特性测试环境
# 针对非review开头的且非主干分支
deploy-feature-to-k8s:
  stage: deploy
  environment:
    name: feature/$CI_PROJECT_NAME-$CI_COMMIT_REF_NAME
    url: https://$CI_ENVIRONMENT_SLUG.***.***/
    on_stop: stop_feature_app
  <<: *k8s_deploy_definition
  # 取消从上一个任务中下载artifacts,提升执行效率
  dependencies: []
  only:
    - branches
  except:
    - /^review-.*$/
    - master

# 部署预览环境
# 仅对review开头的分支
deploy-review-to-k8s:
  stage: deploy
  environment:
    name: review/$CI_PROJECT_NAME-$CI_COMMIT_REF_NAME
    url: https://$CI_ENVIRONMENT_SLUG.*.*/
    on_stop: stop_review_app
  <<: *k8s_deploy_definition
  # 取消从上一个任务中下载artifacts,提升执行效率
  dependencies: []
  only:
    - /^review-.*$/
  except:
    - branches

# 部署社区环境
# 仅对master分支
deploy-community-to-k8s:
  stage: deploy
  environment:
    name: $CI_PROJECT_NAME
    url: https://$CI_ENVIRONMENT_SLUG.*.*/
    on_stop: stop_community_app
  <<: *k8s_deploy_definition
  # 取消从上一个任务中下载artifacts,提升执行效率
  dependencies: []
  only:
    - master

stop_community_app:
  stage: deploy
  variables:
    GIT_STRATEGY: none
  <<: *k8s_clean_definition
  when: manual
  environment:
    name: $CI_PROJECT_NAME
    action: stop
  only:
    - master

stop_review_app:
  stage: deploy
  variables:
    GIT_STRATEGY: none
  <<: *k8s_clean_definition
  when: manual
  environment:
    name: review/$CI_PROJECT_NAME-$CI_COMMIT_REF_NAME
    action: stop
  only:
    - /^review-.*$/
  except:
    - branches

stop_feature_app:
  stage: deploy
  variables:
    GIT_STRATEGY: none
  <<: *k8s_clean_definition
  when: manual
  environment:
    name: feature/$CI_PROJECT_NAME-$CI_COMMIT_REF_NAME
    action: stop
  only:
    - branches
  except:
    - /^review-.*$/
    - master

What is the current bug behavior?

The number of Instance Statistics pipelines is always zero

Assignee Loading
Time tracking Loading