mvisonneau / gitlab-ci-pipelines-exporter

Prometheus / OpenMetrics exporter for GitLab CI pipelines insights
Apache License 2.0
1.21k stars 238 forks source link

Wildcard branch regexp does not work #607

Open OmegaM opened 1 year ago

OmegaM commented 1 year ago

We used k8s for deploy exporter, and want to get metrics of all pipelines on all brunches, but it does not work. Default value for wildcards.pull.refs.branches.regexp is '^main|master$', I was trying to use '', '.', and also 'BRANCH_TYPE.|ANOTHER_BRANCH_TYPE.' and it does not work, only main and master regexp is working

Part of config file:

config: 
  gitlab:
    url: xxx
    enable_health_check: false
    enable_tls_verify: false
  wildcards:
    - owner: 
        name: 'group/subgroup1'
        kind: group
        include_subgroups: true
        pull:
          refs:
            branches:
              enabled: true
              regexp: ".*"
            tags:
              enabled: false
    - owner: 
        name: 'group/subgroup2'
        kind: group
        include_subgroups: true
        pull:
          refs:
            branches:
              enabled: true
              regexp: ".*"
            tags:
              enabled: false

Result: I still getting tags

k logs exporter-gitlab-ci-pipelines-exporter-777759b6bf-9fw7r | grep '"ref-kind":"tag"' | wc -l
   10104

I've got 31 projects in gitlab (I can see them from prometheus)

k logs exporter-gitlab-ci-pipelines-exporter-777759b6bf-9fw7r | grep '"ref-kind":"branch"' | wc -l 
      76
unitrade commented 1 year ago

same problem