gitlab-ci-pipelines-exporter: Jobs not working with webhook

Hey @mvisonneau,

First, thank you for this great project ๐Ÿ˜ƒ

Iโ€™m currently facing an issue with a configuration with Gitlab sending webhooks to the exporter, hosted in AKS Pipeline events are correctly,exported, though iโ€™m not sure whether they are pushed or pulled : {"environments-count":0,"level":"info","msg":"scheduling metrics pull","refs-count":60,"time":"2020-11-20T16:16:05Z"}

Regarding the Job events, I have these errors in the logs, and no metrics showing in Grafana {"event-type":"*gitlab.JobEvent","ip-address":"10.1.0.67:43490","level":"warning","msg":"received a non supported event type as a webhook","time":"2020-11-20T16:15:37Z","user-agent":""}

Here is the conf I used :

  gitlab:
    url: https://gitlab.blablabla

    token: "{{ gitlab__token }}"
  wildcards:
      owner:
        name: me
        kind: user
        include_subgroups: true
      pull:
      refs:
        regexp: ".*"
      pipeline:
        jobs:
          enabled: true

Could you help me on this part please ? And could you confirm the โ€œpullโ€ section in configuration file also apply to webhook ?

Thanks a lot Regards Igor

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 19 (19 by maintainers)

Most upvoted comments

yep that is expected, I took a shortcut here, this not very optimized ๐Ÿ˜…

Ah, it seems setting on_init: true for projects + refs fixes something. Now the webhook seems to work after lots of discovering ๐Ÿ˜‰

gitlab-ci-exporter_1  | time="2021-01-28T10:46:56Z" level=info msg="starting 'metrics' garbage collection"
gitlab-ci-exporter_1  | time="2021-01-28T10:46:56Z" level=info msg="ending 'metrics' garbage collection"
gitlab-ci-exporter_1  | time="2021-01-28T10:47:08Z" level=debug msg="webhook request" ip-address="192.168.48.1:63330" user-agent=GitLab/13.8.1-ee
gitlab-ci-exporter_1  | time="2021-01-28T10:47:08Z" level=info msg="received a pipeline webhook from GitLab for a ref, triggering metrics pull" project-name=sys/runbook ref=master ref-kind=branch
gitlab-ci-exporter_1  | time="2021-01-28T10:47:08Z" level=debug msg="listing project pipelines" project-name=sys/runbook ref=master

Havenโ€™t looked into the code so far, but maybe there is an empty var so nothing to compare to, when using the webhook?

pull:
  projects_from_wildcards:
    on_init: true
    scheduled: false

  environments_from_projects:
    on_init: false
    scheduled: false

  refs_from_projects:
    on_init: true
    scheduled: false

  metrics:
    on_init: false
    scheduled: false

I updated the examples/webhooks to make it clearer btw ๐Ÿ‘