1
1
Fork 0
mirror of https://gitlab.archlinux.org/archlinux/infrastructure.git synced 2024-05-19 16:36:03 +02:00

Merge branch 'gitlab-exporter' into 'master'

gitlab-exporter: add gitlab-exporter to monitoring

See merge request archlinux/infrastructure!566
This commit is contained in:
Leonidas Spyropoulos 2022-05-09 16:02:36 +00:00
commit bfd7bffc43
5 changed files with 168 additions and 94 deletions

View File

@ -1,95 +1,98 @@
$ANSIBLE_VAULT;1.1;AES256
66653164396334363362323335316361623365313330623461386536326232383964393137363137
3037313436373363653836383331323031303535363234320a386333326437323934653134343630
39653931323030616632626336623966643439353763383536643435343139616531333434623437
3235363735326635660a323138303836623437343761623465303862613237396430343964663739
65306235306463653163633634626537353766383464623362343163303533383039653766633032
62373730333430303237303832386266323839653839333738346237613565396333323135626135
64363534396462343937333833643138363766333163396466323934326565353131363833626663
31353863306164303532333037373666636536626162666463636535356532343661663931616438
61313039663232333836316439313163623937326231636630636566613431303530643466336538
66616535316465616462616365306338666130626237313863356461666635386139346661393965
66663531383263313939663432383835383764386230336232613632656464356234343364316535
38333139363732393564626338323065633734613564653036323763623038636337383866396564
39303563373233623839396461393863633031353130343731333233623530346134626235396638
62333635343332326535643063303635306638386431356637313839323861366331326233363434
37613037363533373161326265656634633734316134633435663161613132393538373030323737
32393966333738633638343239643839643562343265346537613239626531353564646566333138
61396465363838333937393761376534663362613832346638653336306338376237323733633439
32346566623264383836663030336139316530353937353930633130376661363138636138316665
33383934393332393639313832653139613138366361633833663465663338623264326235623561
32366663643966386436303437363839383935643135376364366333396331363630653763663262
66636239386361316234313662613237653961666438346363393062623632333866646438393630
34393261646530333939356363353761646665666664386432303031306665363730613766363332
32313734303839393039623632633266346238643763376432366335643963323037323037666161
33656262333561626166626534383530323461373636356362313136643564306538373039363733
33343065303561353433633436316234626465633631393632356435363937376261623435623634
39336266633133643731653235363562306162343638326464626565393265373463623831366162
37376261613839323538623733356266626239663066336634363335303934336332376461306632
65303536363738393464646336343036373463636535373261653133643162663464613134313466
38633162396332666261633565316636636635653662633837386361633031363464303331313964
38663432336364383163306365646438666563386564363464376635303833326539336638366661
39356435366133303334323034613661626261373638666435613563666237656263623635366161
34343865303562643163393235313932303165626462636163653864353764366136663763333730
31623831333139616638323532613632623736613432663134353631343438353064316666643934
35346433646630613138313066383938383139313632663361653762656436313765383265616434
38666265326336663137663538383835633561383732383931663162653166333531626138333232
64313363643731643362393035336234633864643236633965373536363830393163633832393861
61636566623662353764303837636364666563646262316366336263623162363639396631323265
32316633663534346166346365326661636632343739323331326162653035363462313035383562
64313438646339366664666635336566313435663464346337383732666438303832386636353739
33386238666665393962373866396331386462313062376665343731336636616461366465353466
37366434633939363135656439316638363666383234383338646332336535396136616332613837
63316631336238636462396233316164363462663336623231653961386132646438626630326338
30393461393231316634333438336130313633663966626262613031396131623236666630373235
33376163303733343934643831663930393038626535323134306163663937303366386163383038
37633130623635306236353936666163333664306663343661323030363861666239373930393531
62336166376536616164343030363939623739366537353861356164653530646135666164393032
62363030393034336137646138393566316234393365336439653936363033666633643138636665
38313237356165306533303233363761636431373937376633383837396564333362343766313961
36343263366463333261623664643061636535313163356233353365656138373036623730323634
38333931666136633130656132636235353133376139613662313039323461633936613564353630
30373832373337303563313939343937643130323766626530383730343332346564393436373635
34396632336330623763343761616639353933613339313730316230666666323538643732373361
35323130313536356635396664303865613665643838316165306237663735313461343530313834
65336662316566623162383463356264653632326166353061306439326334383132626165643265
32323166396137376339346232613836353339343938663961383434656130303030626139386534
30636634363033646162653532653837383436613534633737323861653463373433393566613632
62333766396561666165383233616131656364373038663363656632666336366232653933393066
31306238633661336431333366613039626537353463333630333436393034376439383331323434
63303234353334313538363361633066376131303139613964333937326335653730303232303930
35356661313133616130313538643637393032383434663230356538653439326534613462653333
62653330333332336663323832316365396464376237626434396535333932363336623666663034
35303734353363656166363035343263373664393561326563653631663738663734613463613066
38386535613837386238346232636661303938626431383739333036633734373437656634303539
62386162393335326238623237373537653338346537306534656538663366616265386332383765
30653064656562633137653332383432346538363033343237396335313732316630353962643136
65643238653332373662313035366535326438653866393632643362316631323462623634386133
33613765343864653533353363333263323562626634356237393463306631363863663837376330
39636237373738653335626261333066666330333932356635393766656532623365666361323865
64393634343039366632343233646539316163376564303831326134343065363838326231653637
62393631383166353837656335333338613734643431323463633132343431326130373339633961
38613131646237393232613562363462383130303064623638356565663435323831616533656530
39623637366431623938306563313763333937373866356230386333303962663336383664396531
61633466393439303433343734303266373361653731616234366235303666646264333965346564
35356466623635383232363565306563613035663264646331613162363830396365396161336366
33613330633462383332656263646136366566326335613032653461316266636535336139356635
33393531636538623061383863366266613466326535336461656464636138393333613338613137
31633037346162313236656636303965656336663062633930633032313062306662663361363139
39393165353530616538346430616435373333333434383261666430383231393432333561623863
38336330393530373766636534343033306261326337636139333863306539356538356336333831
36663130343735303966313737363863306365366230303831613165643266343439376139386135
35663238613637633432643161666661636263363265303361316261636661346362383131393239
37613937613936336231666264623238323965336532336661383635633763663638393833363966
61633864353162343436333539333761333533316139333732643462313233313537623364323265
34383831616630633236306536663131666133616533323563333665633934663264343464383862
37373336316136623066613864353866386261373561386165653334313435613161383166356239
36653139303265633466303838656535343735316432326430643138376165303431363331636163
65613631366363363839643636626537343835316139666331623266303165373661643633303438
62636264323463623462313433313935316430613132376462393133616564326634383339383434
37666336613537636139306538363336316332383636306131653964333736643734386536663866
64643961633964613137363561313430616564643361396133323131326366323033363239376433
34366630616463303933323930363033343735613037646432376539303966333034333938313832
62343839653364613361633930646430336432613538353161643164613337373133653630323230
63636132346331653263663865393732653834343430396165376165613861303336646434336131
3361313365663134383430303235326139353564333562643938
61313964326230393161393363326532363431626164613436383834346161663634356431396137
3931323534333534393235643333646638333237663133610a646436336464393034393361313535
33623135353665386134373432313033393063343238623630363134633133656639643733643630
3662616664323936320a376239633463613934623135313033333839383462343838313938306564
31373339376131383336613031323739393833663562343963303666383861383966383836373036
39346230643765383932623333306533356633623966373838653330666238393435633236326564
31643632343635666566623264313962386231346639386633616166656138386434643837363135
66326430663266343139343738333039613436316132623064323034303165313435383666623962
37353861633361383832656533336131346132633361373563363766386637613637373333633934
62396130643936623531373031613563373539396432636564386133376639393631313263316631
61616636313835613232313434623831323066633332656638346365353131313064383564373063
35626535653932393561336530373432623663613366663933626239366666343836323362633938
37393431373533343364356165383434633566623964303230333033333330623665323662656164
34623362363330326536383733616134323037646239343635663834333739346230363836326533
65636339363765656565636230313336303635636435343739306464393330303635616431393837
64313665643962663066636462663431363238306365303438373864626462386364373731383063
62343239626534386339633235366430336661363261393862303433313031306539316139336166
37653433303362336331333763646165666235633635363331346262303064613137333030613365
32326339393033616561626630306235306331383530323436383661303064393038373238626631
30386561346562336466323139386263656162636266386135373136363830313933646466333137
63666136363739643239356161323637626437646662653331356563383235613636633666376331
31643537663030383632323861646562383939346633636638373064363361643063643632326234
31306663663863613831396233363464383166356537396463333861353264393134623338626132
30636163653434633463316334653263636439353530663836343363633635353530306230356363
38333833333561363365386363353434363661333937313335653630303933653763303732343632
34303639383665353238386637653766613332383232643365633961303332356563316238333139
32666231643464336132636635313639343634323833323834643563666366623661303066303630
65336130633236636536393635323363376536313065373637353535643931323831326339303431
64326632373933383437323139323361613636316337643263653233366139366537653034623237
31323263653833663339613730366566336633663438633537616466373365383931316338393163
34613264393238663163306361663037346265303638356663343338363431646265646161633661
65303261323739656435333061363931373131623462646237333733663834663839623431363461
61343262636136663331633266373039326531613965636130303532636535626362343035386262
64303434643633343234313834626438373362636561363663303263333730623265626234346431
63633537353262633931323661633765366138643034323639623363613431633065643563303831
36353163626233333366623639666238323962313333343235366365386662663361616564356435
32333165346564623930383438383434313366353537363239656635323932383831386237383931
36656635376432646133313934326464323866363838333135346661306133343262333064386138
38346636646664323232326238356530363534366465386531316139316435626432633864353232
63633034343065323236383232343965326639316334663136623533336536656337376364323435
33313730343637653864353337616539333236643461313762366532333035386564643133393761
38653931316236383839366531306637303036616265373433323762613439666562333933623766
31646236306463653631616337353865376233636237646636666665653933666433613331353339
30653834313432333232666361383935636436633234346265306166356565303633376338383966
62623933343139643466653734363061326330356263366432626265313666396664633033306664
35346462303961663839623762366438323837326135656162636564616363653963356336623535
31653761356333316163636665306566626537386236666336313639653839383536346332396232
31646639346135623237313239623038303065643763626431333566383561366263393338376665
33323466346566643433326331393763643237656431373866353762376132643665316530393930
34356337626134373336653862626434356465303465363964656664366433636163323862376263
66343234333737383636643662383831363163376561376534383264626436396332666566303264
37363164323233363463363066306539656339386334393238613762376663316536653361353464
33333461616139616565313737343630663031633737613336353838636436326537353137366337
30313234643734623038363563356232633166333231336530646662393037646333636466353237
33353432306464343864643366666535356536313133333537333832303831613564626530386432
63646631316236323138303437626338616232353762626466303862333538666131366131316336
32626232633064653163313930333835643166313332653034626236656266353932653236353562
61373565663466373361613964383231613139333038313063326464643532303666323234306430
66656539303462643031393838323064663231363366333762393433663533386438623739383836
32326531353130363336313338396430333563666531363765363737616331386261643064313130
35366639376266653866323639383832303765376135376634363931666230333766653039303132
39633532333965366333633363366532316539306531316364663866393137626562643462386137
33306132346263333330653463653138363965613262633634663134333336646633663664633133
30626164303139323732613039626130636261623038373734326135656533633966323031313930
36663136363437643061356164323131386335313333633139336532613163333162643732653036
65656331633637303532336461363237373032356632343635643730663433323137643535343437
62393731393663313539353731363531643866363462646463316337623433386264333433306134
66303333366238396466353331343430303339653337383031303433653435313965323433363165
66656232323139313732326338313738326434613961313434326338396466383231633230306135
31643534306362366530326638636632626366613438663936646261366361343665616336646266
62303136653738333662323933323664323863356434636236633865323465313136363831643835
33663963333364623333643864303436383736313235666632376332333639393733616564663465
36626636316531313662393332636132326365666637323230366436343665393264356630666636
62393964613661666337393265346164636134363733633236313366626666643663666235653966
31306564666433366637626531643333323063653561313739663030373161386331306539633163
64313862323234633065363839646166653835373232366266333734353838373835383962353262
62633564393637383835653438383961353333306331356231373437333737336230386362646433
36316334383939376561666332643664646132643761373064303830333638626531346362313935
63333738396133663265396135346135393662343839646261643765313833326431326462623863
37363432653063383761306231366561383665663837336462303135303336653338306235356362
64306566376537303364633136376461303066383134343861336435626132373761386630626235
39663464656461363237613765316537373439313665363861646263633465366566626338396163
38633637336339383738393033313130333139663039353364623034366634613064616637353735
64666561613733636130656631396439343838653264653266633866323439336537303631656563
36663063393837323264666664623963393066373436316661633962353333656136393166323933
65326334663231346436616338626537366330656562336465373866663231666231393639616432
34663766623165303637633334623833323239363235613335626664326536336330623036633831
39383230366438663563336165646462346231333530643936343332626333373231396534623632
66313334323134653739383663396631616131613932653837336633356661316332363136323335
61656230333832313964383366643733376531633035636538346235353864323839623563336336
30376536666338373066333838376236663231653865666565346561656665666435306631363332
61656264323137336138393733383763633939643664623564333837643033326264653962383138
34653365376132663733666531666231353066306434336564336333613765323634326366636432
38343238383766323762633932373635343762613838633536386134346133623563613431626536
65323839323632373033356538333839353631393864643865613062633536653963623833633831
61643438623563636264346136326166653034636134343261613636376434643837353934383830
39656263646665666231656238333964613731623464376333636534306264666334

View File

@ -0,0 +1,10 @@
[Unit]
Description=Gitlab Exporter Timer
[Timer]
OnUnitActiveSec=10min
OnBootSec=5min
RandomizedDelaySec=1min
[Install]
WantedBy=timers.target

View File

@ -114,6 +114,25 @@
systemd: name=prometheus-hetzner-textcollector.timer enabled=yes daemon_reload=yes state=started
when: "inventory_hostname == 'monitoring.archlinux.org'"
- name: install gitlab-exporter
pacman: name=gitlab-exporter state=present
when: "inventory_hostname == 'gitlab.archlinux.org'"
- name: install gitlab-exporter service and configuration
template: src="{{ item.src }}" dest="{{ item.dest }}" owner=root group=root mode="{{ item.mode }}"
with_items:
- { src: 'gitlab-exporter.conf.j2', dest: '/etc/conf.d/gitlab-exporter', mode: '0600' }
- { src: 'gitlab-exporter.service.j2', dest: '/etc/systemd/system/gitlab-exporter.service', mode: '0644' }
when: "inventory_hostname == 'gitlab.archlinux.org'"
- name: install gitlab-exporter timer
copy: src=gitlab-exporter.timer dest="/etc/systemd/system/gitlab-exporter.timer" owner=root group=root mode=0644
when: "inventory_hostname == 'gitlab.archlinux.org'"
- name: enable and start gitlab-exporter timer
systemd: name=gitlab-exporter.timer enabled=yes daemon_reload=yes state=started
when: "inventory_hostname == 'gitlab.archlinux.org'"
- name: install fail2ban textcollector service
template: src=prometheus-fail2ban-textcollector.service.j2 dest=/etc/systemd/system/prometheus-fail2ban-textcollector.service owner=root group=root mode=644

View File

@ -0,0 +1,2 @@
GITLAB_EXPORTER_GITLAB_TOKEN={{ vault_gitlab_gitlab_exporter_token }}
GITLAB_EXPORTER_GITLAB_API_URL=https://gitlab.archlinux.org/api/graphql

View File

@ -0,0 +1,40 @@
[Unit]
Description=Gitlab Exporter
Wants=network-online.target
After=network-online.target
[Service]
Type=oneshot
StandardOutput=journal+console
EnvironmentFile=-/etc/conf.d/gitlab-exporter
User=node_exporter
ExecStart=/usr/bin/gitlab-exporter -o {{ prometheus_textfile_dir }}/gitlab-exporter.prom cli
NoNewPrivileges=true
LockPersonality=true
CapabilityBoundingSet=
UMask=077
PrivateDevices=true
PrivateTmp=true
ProtectSystem=strict
ProtectHome=true
ReadWritePaths={{ prometheus_textfile_dir }}
MemoryDenyWriteExecute=true
RemoveIPC=true
RestrictRealtime=true
RestrictNamespaces=true
RestrictSUIDSGID=true
RestrictAddressFamilies=~AF_NETLINK
RestrictAddressFamilies=~AF_PACKET
ProtectHostname=true
ProtectControlGroups=true
ProtectKernelLogs=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectClock=true
SystemCallArchitectures=native