diff --git a/galaxy-requirements.yml b/galaxy-requirements.yml index ab0b206..828e6db 100644 --- a/galaxy-requirements.yml +++ b/galaxy-requirements.yml @@ -1,4 +1,9 @@ --- +roles: +- name: geerlingguy.redis + version: 1.7.0 +- name: idealista.prometheus_redis_exporter_role + version: 2.1.0 collections: - name: hetzner.hcloud version: 1.6.0 diff --git a/group_vars/redis/plain.yml b/group_vars/redis/plain.yml new file mode 100644 index 0000000..b2cc017 --- /dev/null +++ b/group_vars/redis/plain.yml @@ -0,0 +1,13 @@ +--- +hetzner_server_type: cx11 +hetzner_server_labels: "stage={{ stage }} service=redis" + +docker_enabled: false +traefik_enabled: false +filebeat_enabled: true +node_exporter_enabled: true + +redis_bind_interface: 0.0.0.0 +redis_maxmemory: '{{ ansible_memtotal_mb * 0.8 | int }}' + +redis_exporter_ip: "{{ ansible_ens10.ipv4.address | default('127.0.0.1') }}" diff --git a/group_vars/stage_dev/plain.yml b/group_vars/stage_dev/plain.yml index 0a45ace..4e8cbcb 100644 --- a/group_vars/stage_dev/plain.yml +++ b/group_vars/stage_dev/plain.yml @@ -82,6 +82,12 @@ shared_service_gitea_ip: "{{ stage_server_infos | list | first | default('-') }}" +shared_service_redis_ip: "{{ stage_server_infos + | selectattr('name', 'match', stage + '-redis-01' ) + | map(attribute='private_ip') + | list + | first + | default('-') }}" shared_service_kube_master_01: "{{ stage_server_infos | selectattr('name', 'match', stage + '-kube-master-01' ) | map(attribute='private_ip') @@ -136,6 +142,7 @@ kube_node_03_hostname: "{{ stage }}-kube-node-03.{{ domain }}" shared_service_iam_hostname: "{{ stage }}-iam-01.{{ domain }}" shared_service_mail_hostname: "{{ stage }}-mail-01.{{ domain }}" shared_service_gitea_hostname: "{{ stage }}-gitea-01.{{ domain }}" +shared_service_redis_hostname: "{{ stage }}-redis-01.{{ domain }}" shared_service_webdav_hostname: "{{ stage }}-webdav-01.{{ domain }}" shared_service_keycloak_hostname: "{{ stage }}-keycloak-01.{{ domain }}" shared_service_docker_registry_hostname: "{{ stage }}-docker-registry-01.{{ domain }}" @@ -197,6 +204,10 @@ shared_service_hosts: [ ip: "{{ shared_service_gitea_ip }}", name: "{{ shared_service_gitea_hostname }}" }, + { + ip: "{{ shared_service_redis_ip }}", + name: "{{ shared_service_redis_hostname }}" + }, { ip: "{{ shared_service_kube_master_01 }}", name: "{{ kube_master_01_hostname }}" diff --git a/group_vars/stage_dev/vault.yml b/group_vars/stage_dev/vault.yml index 9130af6..5a63ddf 100644 --- a/group_vars/stage_dev/vault.yml +++ b/group_vars/stage_dev/vault.yml @@ -1,65 +1,70 @@ $ANSIBLE_VAULT;1.1;AES256 -31333365653764633037643362613138633531313832313434646339306436663839653238333461 -6263353233386636326430356634333937343665333930610a336638356238623131613038306564 -66363934333339626463383662616131393364313263343264383062343032613331323136633733 -3063343730623031380a613139643738356535383436386664373236333139643561396232316632 -39366636343263323339363161393436346461323933663662356264633630363164383064306535 -65363839393336346333303062333466313133383539353539626435616462363332666238626566 -31626239653335306564333530636334383765373936366430623765653232393764323239616664 -32333632393338343065666534636635356338653534363233613666333837616231396634666562 -61303838383137633462643831666266313036333562383131666562346463346133363037356331 -61333863303234383435343334643535313733316436326330373165366537643432613963666331 -62316366633834386335376536363131626563303263363262653065373662643632326434636530 -35613237646261303837393363313165343230396661383366306466636336303338623830663332 -31393866323834653438303234643934353166316362333439656133613466646535653739333338 -64333862623230306266646131313664343934613432653866666134396432646365303432613332 -37353236353933323034343536396666653530313837346530616634313532623236623465663864 -38303331323433323131333539363366393962646534326135343630616131373739303232633231 -33643265323831316463363134363339313865313062663366323263306239666137303065393165 -36643061363562666665323465656562323330666132613064303935376538333463353832633262 -62373535613230623238646362353963393238353434393239396339393533376237663430393565 -66343933666433636534666534643731663133303831626132326461613566356430626661623139 -64303532616439383631393563343538643531353438653565366130666463393935373261613335 -65316564623762303432306365343364303739343865633635666437376237373930356466363435 -64323336633962663630663165316163313236623665343631616365623834663730623263353332 -38323364343865636531386136613835653332383639306536656238633533303865386436653633 -36633831626230353736626231376165653162623733323863356261613864393966666566636136 -38656364316435396135393261383033646262653861393833633838323235653835333934633134 -65323538646138623535346164386164663133393032343862393363656436656430343834333263 -65656435623232346333353336353330633836316363656634623735306164393838393139306539 -37653636323531653537306564373330663138303236626639643365303339643832393839373365 -66323737373438616666636266396238346565633730323134363936336161393765623366386535 -66633232336166623534383835383533303338383335373630336564383938303731616438646135 -39656238616331363032643630623132376333303433623061323533633937303130356364613763 -62613834346464396263313061366230396235323332323331333235306664313030643462633365 -33633833626263646435396137303939653163353136353366326565626335663132333139663363 -33663239663238376566623833373133393338393630616231623632623239633031666534303363 -39636237613366306635336534666533616463366537303161633461393465333237623661623464 -33643236383834353165393966326162626230636161393834396535653462386161386262656334 -32316632316330363761366336353961356163643264663262326164303463626363663739366262 -34356437633666343966613231653633393930616238363561633637353963343765353065623434 -34313761373366636430356166646161396332663632643061303331343335316539396263656633 -31616264646263616166653530336134313633393939636632393730333736613963383762366135 -30353733313065623034303236333036613238363039343436333866343866356461396233613136 -61316137363932333966373065386635633062643638646261303065646534373531666530663437 -64323163326236346132326163316132633462366236623962386563623161316432656633346261 -64626239346239653465376235623539363332353435366239353865396164626437643062386261 -30633363656531663235373730353335383731386164633837633032613661663861376230333439 -30363133306163323731656639343564666635356665636438636265643138306231333638663632 -30343464373231613763386638623961656436616661373466336466353333323862653237643063 -34613266383834633137393864623464646131623037313862626437366363616532316561333639 -36653363396630663432366331343831633865633864393364666135633766393132303735613136 -30653037613637393864373361643831363866373166316233623431386465326461333761306562 -63633464366564366564333730633733326234613434386165353132663363623533653637663435 -39363332343334363031353630346138353334316564313539396231376137373639323433346563 -30646333663462653962393866613666336231373230663930366365313134326265623530313434 -33363936333865623561333331633763356238316339373963313039623930653531313662613764 -65626365323164666631303465303736356537333336383539633062383663386364386236653233 -35616430663136633561306136323463316533396565663730326132356565303333393162313062 -35393738346339626462366363376661353663626264643035623231333565383439666665333738 -32346237316630376332303630646362613632613535363730663766616531303332333462333137 -65366461633234356562323536396232313837343862366362393238393862393264613162663837 -39376134376563383236633832323066636338623066363230356666653365643566333331353430 -34643433343034663264666663386335313763303165626134663532303432663739336363376532 -62306237333865353362623165313263336464303633313938336338376366363738356132376562 -34393263383264316330 +32306134373236346231396562396163656363356664636430633438663366383963303134356532 +3363393762333138656238336366623065326539306663650a616566343765386464323162316138 +65613934386161366436616338613265636237323137386263633234333061653936663635303334 +3336386637356165630a613737323630303562393030656566643633323266663836393632653737 +31343736303463386131306433643336623434353631626130336233663430306366393732386138 +62653337303338633162333663626266653461303736666261356639646533353438343539343466 +64313139373163343039666133386238396362336466653762613136613333303265366236393166 +62663362333235323139393334663266386230323534396339373432353031366466636637316533 +64376330373336306662303433393465336465666332653330323539316665356335343738303133 +66653938383462383432366364633938373164643035613964303939666237323163363862646538 +37626336316339366162636639646263633334333562346339666430616134306561616636646264 +33356665383636623138393033643263636432636331373266346138616564353631313262373833 +63313031643433323634323661666435316362346466636333383166323137646436663265396333 +33343264313061646134313963396635373232643966313263616536393065326333366162663836 +32366666633739643366633364333064313232613537653034653734646338353062613335353262 +36663131633835363337343236343432303335623861313965326433363964373361373536623166 +39313265363039303038323837376533356236333264303839363361623131343466623861656137 +32646631653238366533353231636538313135633362376363323833303831356137326530363031 +62316636646332323130373065323238306533666235636230326431333432636463336433363030 +34323438613833633632353965386138323739626163646431653039313364306161633962356133 +31346131383166393038303466376138343764656132336666613536326364636533353162313861 +37323161343832346333396361333363383938346632333836306336353337633062336561336631 +39353537313366306234363064333932646363316461653339653765333037636263343732343432 +30656536313862643435623335393262623762353635646638333532613065656664386634346436 +62643337663832396463636335376263373938623766383564323937613534363462653434316631 +30393764386335646134366566343436646462316363323539373764333437373138636231613939 +37306161316139653866336335386639616330636336616237333664613234663031383333383132 +62373039346632623766313739393666643531306665336337303363323461376136656339336463 +31613830373039316564333731333466623465323865663339653134643337313564613064323264 +65623863633138313866376230303964383631303938636134323365316537356233646439373361 +32613430343639363938373833646661643831326333633235643463336439663833363165656134 +33616563393438346230623234616332643238653735313362373831356239613433616537633939 +31653161643966313363363638383731333833366564303661353362636534656336303131643663 +66663631333633343733393564326265386132616638333465343236313562343036646261303131 +65306231386330653731633430363261623765666163633563326438623031616265303736656539 +31373564633031363162333336343339343661636663343666306163653763356261383164623264 +63323864613032306364326136636531363639663830396535313234656461613736353737623733 +31393361313362386437663833656237613136343038383231336436363531343562356263386233 +32373963363762616331363733303965306462646134303163626238303266336439306539613764 +62326566386162663133333137613666653239633834363433313966343537323536323039666538 +37666639646337336466326137306233363632323734363533373834323761393934353733396232 +31646535373666333861376266303031393230666164353965383765623333366537656466373062 +33336237343237393362333539326466383464623761666432626362353864393063356639356366 +63313234626533643430323530363265646433613436316662356463326533653537306330616638 +34323330326434643439356632376432366363326163316332363139633965653063626361616235 +33303934353165653735653736313539643231323735633365666165663438303462353939633238 +30323564346336393531663562623766323661333333616464393563633764313837376263353038 +38636235633834666430626439313434393233303339663330656534333734663265353239656130 +62323933336464666235303266343561333131373131353162316566383036323130653063646234 +32313938306638333736646537333462633539633236646134343134613662643730323733663230 +64613436633265316663386262333465313732663333393933636461303430383566383962616166 +65396566663432623837363461343436313466356366386530663966393031666336343063373162 +38373037336237626436336437376339396664646461336439336363666137613136646266336365 +35346362366166383634333430376465636361643638636363343062626363623132663233636231 +63333732653462623164396133343930313163636661346436633564623030633163356439393762 +33333330663931303437646234646134303465616365313336363335363363366137336163643939 +62306462323764346632343361326462383033313261666435626434326236396164356464326333 +65633138653735353336333530396236636630343839626330643961663666336536396165653638 +64623238623636363430636635393630663338646130333436656638623038626331643136323333 +35343638666636343537356365646136346337396635626333666436383465343630306135363261 +39633739326537393161663234333636353538633831303232366466366234626163666333643034 +61653432616366633536636138346636613064633861386661613039396338623736663330333033 +38643432396130626136656466633936626630333837636264356466613963333166326466633266 +31393032316136366562623766336138653730626136316138663361333732623838366434363363 +63656362336530646463373761613661613961623836663332316561326337653165343562633766 +37623833613634346531613432353266313936623563373461663438396233396437386339613732 +33636165313730393637333334396531383164363132303761623361666261323664323762313864 +63393136646632653935393634653365386465373865303234613339633161383037393066343166 +3266 diff --git a/group_vars/stage_qa/plain.yml b/group_vars/stage_qa/plain.yml index f835cc1..6c234c9 100644 --- a/group_vars/stage_qa/plain.yml +++ b/group_vars/stage_qa/plain.yml @@ -82,6 +82,12 @@ shared_service_gitea_ip: "{{ stage_server_infos | list | first | default('-') }}" +shared_service_redis_ip: "{{ stage_server_infos + | selectattr('name', 'match', stage + '-redis-01' ) + | map(attribute='private_ip') + | list + | first + | default('-') }}" shared_service_kube_master_01: "{{ stage_server_infos | selectattr('name', 'match', stage + '-kube-master-01' ) | map(attribute='private_ip') @@ -136,6 +142,7 @@ kube_node_03_hostname: "{{ stage }}-kube-node-03.{{ domain }}" shared_service_iam_hostname: "{{ stage }}-iam-01.{{ domain }}" shared_service_mail_hostname: "{{ stage }}-mail-01.{{ domain }}" shared_service_gitea_hostname: "{{ stage }}-gitea-01.{{ domain }}" +shared_service_redis_hostname: "{{ stage }}-redis-01.{{ domain }}" shared_service_webdav_hostname: "{{ stage }}-webdav-01.{{ domain }}" shared_service_keycloak_hostname: "{{ stage }}-keycloak-01.{{ domain }}" shared_service_docker_registry_hostname: "{{ stage }}-docker-registry-01.{{ domain }}" @@ -197,6 +204,10 @@ shared_service_hosts: [ ip: "{{ shared_service_gitea_ip }}", name: "{{ shared_service_gitea_hostname }}" }, + { + ip: "{{ shared_service_redis_ip }}", + name: "{{ shared_service_redis_hostname }}" + }, { ip: "{{ shared_service_kube_master_01 }}", name: "{{ kube_master_01_hostname }}" diff --git a/group_vars/stage_qa/vault.yml b/group_vars/stage_qa/vault.yml index 41aed30..a1ba280 100644 --- a/group_vars/stage_qa/vault.yml +++ b/group_vars/stage_qa/vault.yml @@ -1,78 +1,82 @@ $ANSIBLE_VAULT;1.1;AES256 -30616231633365376266366133663435366235323234623635336139386264666539663335343166 -6439343065353037303030376331616130376461643331370a653964343936356430346363393563 -66393466613561633833396164663534306231653733333264363661303837626466363566323239 -6237666465363066310a656639313436383963306538373364616537633233396237393237396632 -36343534363136633139393736666264323532663838656335653538663639633365623863373038 -33393033616564633465356632316163353831363234643834393264383736393734393333653166 -39633338663730343665323661336633633065646461643836666664666565346536616230656236 -37306563653939333234636162393330393263356366336133353830663764396562656134316632 -64316537353166363235396635376439626463306333323234363366396433326365366232393432 -33396265333438656337393539373734316637663835613439353231613764336662313838633238 -62613838373463333737396139303438333361313530623132623632376662393461613766353633 -64396666396238393639356635356634616661653838643236633438373339333736313461333939 -36613134663765646164356161373336656236326366333836623037656365356461363539343733 -30643439303566383334623339373538633463386336653261356566663562393637366339343134 -34636332373063666462386637333138653163316231316631313065343637356431616235666638 -66363338376236366637396664306130656330623538343837306237636162306434393433303665 -32356634373034303262623339373461663166643335393638623335356630643238343932383063 -64633636356263643531633662323764363261343536633261613231363439643335343335333763 -33656265323530626437633861303533386264366634666661363962633666646263323335366134 -61666664366538386361633938633864653334306363623664316636656531373332343631306537 -62303434353564633766313335646161303564663164346333633137323661616333363132363035 -32643136393263353061393936613034616266383265393161333934613135363162353638396362 -35613334363237663736633430376261336136633435646633353064303436633235366362366437 -65383235623438663365663434343330653434623531303334623839663663613834636166366162 -31303435323533643231616636323739363037663265333562336331613962316331306534383033 -34663966636265656561313938396630666639383665376232633332326632313535663536373462 -36316535643237373333396232346632643164393230646536653437333131656463336136316133 -62353535663235313439636238366132356631663434396235633262306265373464366262393935 -31666361656566363230336664376665633937376266396264396431373837653731396365343135 -66656666356339633964383063613962396538303633383062383261633262366566626235643861 -66346162383336633136613431313538363337376666366632663534636162376630613562356434 -65373964636565643561303232393864646434396336656132363838383638613832666664343136 -66336561653064323739626338393964316138326136333963373864333862323933316165663333 -62343839316637663034303531356332323832373865373964323465383364343661326266333964 -63343134656435636332666237626338613034336437643735366333343734653933353635356564 -34643235363337633764626437636661393766633764323638353331666464313731373166383230 -33653930643836343264666633663337343965336330383634353765633330333433656361663437 -32663835346233363266323132356336303731656431336630376265633031346165653735383230 -37303361313531623237666535663038353233323735386131326239363935323963356435343733 -66663362336661373136333665316466623463376261653036616661353066346137333163343232 -30333132643936616462646534616661623837626166353565646632393963653666343134373562 -66386430626133386536383732323534616134616536643565653335653263626230393961316137 -37386537343839396534383064306331303461633336306630643561643338323066633038383737 -31636163373764633761393261313266333838643336666637366266646632646261333266663162 -34363339373633333039356266656665303065363063333263623665653330306439383732613936 -61336162633231303734363765333639353038363838353365393961326539636131346162313833 -35626531326463303532363666666631336131363263656633323565663963616233343235303038 -63663830366363393961383736663639366230353635626361303436643561303266303135646132 -64316639363533373262366366333337356661373330653165303263366466626335623232323961 -30396436363064663766626139643335666238613032626462343233336363376531333831326631 -39343366653462323634333932363062666361643033396336303136316565313562383636353564 -30613231343861653432616632653337303163306534623861333738336139306537303438326662 -33333662343264623631653566636638373938653363643036366664643038393037356464393965 -33613231636639376535333666323239373465383330323232306364333139653030383038333866 -36323633353631616231393532646562313039376335363363636561313733616133633230316662 -34616431626661643563636461636562636539333637393634643961643732613236303133653261 -37373233333139636463343535343564636333343665353466323936343239633633653533383961 -66333936353765653532656234323236363535343536663864323330333936353933383131626634 -66643039633664613266626430306164396162303938336531376534663162663039633934346437 -35393565313365633731653963373537313536343232336562663530393936396632333362323737 -35663832646564623434623238653364373432366462383530393735313831343930623136666139 -65633363616265363231353334613061363834336635656261666232326339363739336263613735 -65396236623366323137363162326463626461663562663034336433383138373061366131323365 -62323665323365333365633632396562313936393466313862386230383235303538336164326666 -31373461656565633764373038643237323963333737333362323665633835356461313338666330 -61666133636338313138613135376537663332623632623236363364343364666563323132326632 -62313766366661396638613265666666613030353337323733353739626237636336663438623063 -34656161336135636330613333313931303264656234363539653665353236303037666561636337 -30333766623035623239303238636136373064353336376133343333616639376533313063306664 -62323861356333613336363133353733633530366661633638383831643331363439356137313363 -30366561353163386661663664646435313536323236303061366464386232366436323162656161 -38636562396561616238613930616662336131353461313438373038353938336331643663633639 -33343531623133303634633335353334653538363464313434366466653966643138383832633534 -63626339366234313161663364313765663863393038353461303762323438326534323731656237 -65363634366332366633636334656561326561386564643234636564633866646264376333646462 -38346130623866306564653763353232316265663237383861363062633937333637653731633461 -6466 +35393237356663343935636433353239373533633162393730386361336536323136653362653934 +3735336130373233386136306139326562363736383962610a363466666331313032396237663065 +64363765383530643661626365303134323036613663353331323663333833356235316264653632 +3433613932346236350a303236383638666435306164333630376138396235616561626433336265 +37653831366464373961393738656634653664653438333764363461653761373935393334313138 +35333236663037303735363466353832383762386432623761306463613330626630663162616335 +32656530326664666131633766663537356165343331626661646430336266653161626136323836 +30353230646237396362333464653830346364353062633364353964353161393030336633626535 +31313231636437343331363666656632386231383239653336313237376332323431316663383463 +64343963323962633632396463393536356563616630353139623464343635373534313634643437 +63353233343338346232356165643532366534636336656564393265323865396162663462663636 +30313066626437393437356266623535393565363536616138366537636433646439623632356366 +63336263356335356561643032623131386432316564343137333439336138643437623563636433 +64373337646231333263626665333837623639613136393738353932663338323435333138656365 +38333265643636353462383832613231316438306165306162346134336637613839636362653462 +63313238326461326237623234383437353036646633646133626239653432363931623538633838 +62393162336534316536353863393363313263316534643331636130373430656264346134633535 +31646439393662656261303865353566303563363362653532343637653862646565303833366265 +63336362306335333465336634613839336665383136616638663465383235306565366235626636 +35303430633335323039643435383861363431663539396438393666333131353533616135636539 +61623637333163336238653066393132623035383036396165316533363361386263386463643133 +37626664356136646234613133636535333162623738303532616436336337643836653931383563 +32663733333531663637633932306637373235333332666461653262656135313636396530626362 +62643132623562323430643335313036623236396330353635656165623036653534326438373431 +61666163336364613730306432303762373236653336393262333632613464363934313666663037 +63373739386132633734633363643633306233626134613832303263346430366363306233663664 +30383231653332623637613032626663646165643538666330306234653138376337393165363131 +36313335626437353132323164616331393139303536356336353234383437366537303037346339 +63366239653136363466343164333265303661313838663163346365353431633264643135313137 +31656137643936646439336365343033393231343531623730323961393961616362636531613738 +64633333646637633661646636366230396438333837303830663531656433323132613431346533 +32353939383234336534316433336462616639316562383764323563393932376332613934666165 +39373238663036306434666462333033383530393735643230376235303336376434356465363762 +62383939613036353461393830346433376466373964303661333033356131643531633834353539 +63336363343339343938313836336330633363613663306632333162306566323734393330316138 +37396235666266343436633536663939653530666333663962613738303737353033626638373436 +34343462366564363134656334636132326565633530303437303439386162653830313862343264 +35623731653561356466343763376638356336323934613137306530333337666238336635356134 +38623665663761353239306632366236656637613830616464653039323733373537613232323234 +31326531326134633263303231353465363762613035313966656630613037333333333031333037 +39623461326133316632386265646432383134326137666363663938643662373065646166333030 +61343962353563316630636431626664383066363937356138376561333133323632633934383465 +62336230653936303765326135643561386362613738333137653662363165323238383433653232 +65346262663264356232623864346661623639373738663834396563346361383462356533643630 +30373365633265323632346535353066373539663335626261336636656232656633333463386631 +34653961613463376637656336303365623433343636386530306339343131313839383832353033 +30343339393865323230663866623662326138623962353132346633663233666431626166636239 +30636163663463316463663765353233663436376138306231386431643661626131363531366232 +30353433646330626534363739303733653663653762313165313038663630396433643233373032 +32643137323864623135633439383636366133306436653137343435323732636430303066326362 +66393163643234303934376632336232343638396466653439313232613562613836663530333362 +66663661326463663036353439636263636638623037316133336538633863353866353336356461 +36336436333235323766633936393261313462363138393435613865343630336264613032633865 +63306365666563653539616237616438613664623566333639316565383664653864363836346438 +33356439613763313435356661323332343137323637623631333037636336316633623935323738 +31333536346538333635623462363435393537303638303065346361363433633162303330363637 +32626563333131666334356537373130373363656531303262623030646135646634386635373534 +62303964633166336133306663333931323064613532623035643433633664646239663038376565 +39643162366233303233326363653733623862393239616463323530316134653432633036653734 +62393838363737316566303963306536633531316563373435353933336563353330613732346638 +63313236393233346537313766333135623534366566383962613066373965663732613534313764 +37633537383163613431353563646663626536643632656466653939363233623531396533353134 +64386262333361663863376533396537633234636362303637366532643137393262373065316530 +37643832366361313035376362346139616363343365656666323263336466653138663636306138 +39316135653636393430636235643236653761326136383132393634353736636563353434633831 +32396638336237326138643832363561643235396630633862653762333962623231386162383134 +36326466383465333532646465643936356166323136333632656566636633366233353035666362 +34616561353963663239393635346364626434306438386234383538623737336136303765356236 +65333465616161353963663637343462653031643961393031343930386339656563636363383033 +34656461316666316162613930663338303932613762613430343633396232666266326634633362 +37623335356362316335323164376230373131626539386562643436623266653561656362313834 +31643765373839666262633036343331356563323830363161346439656665643862613161396333 +31633837326264626662396566356639623336383438363838393361343263373139313332353333 +30346237633830306361396565373866376534313233613339353830643666323738306664656330 +39316132353130396131663062366133326361646533333233333239313663633933343136656166 +62663334353531333132656432656136356665616237643036653766353466613438333238653266 +61363537373433653638363037663837326337363730643338613061633735663162316663333937 +39353830623132303633373238663435366164306537363163313262613938393135303962373232 +37366239373030306633386430653962333862653732636666613866363365326566376332306431 +36396331343639653431623965333263323365663432633036386539343961633433363938373665 +31653138613861663033666234623030653635363831346365323765663766306639 diff --git a/roles/redis/tasks/main.yml b/roles/redis/tasks/main.yml new file mode 100644 index 0000000..ddbd6c2 --- /dev/null +++ b/roles/redis/tasks/main.yml @@ -0,0 +1,7 @@ +--- +- name: install redis + include_role: + name: geerlingguy.redis +- name: install redis-exporter + include_role: + name: idealista.prometheus_redis_exporter_role diff --git a/smardigo.yml b/smardigo.yml index 4ae6cae..b02347c 100644 --- a/smardigo.yml +++ b/smardigo.yml @@ -59,3 +59,5 @@ when: "'webdav' in group_names" - role: management when: "'management' in group_names" + - role: redis + when: "'redis' in group_names" diff --git a/stage-dev b/stage-dev index c10dc30..d69841b 100644 --- a/stage-dev +++ b/stage-dev @@ -49,6 +49,9 @@ dev-prometheus-01 [webdav] dev-webdav-01 +[redis] +dev-redis-01 + [kube_control_plane] dev-kube-master-01 dev-kube-master-02 @@ -75,6 +78,7 @@ elastic gitea harbor iam +k8s-cluster keycloak kibana logstash @@ -84,8 +88,8 @@ pgadmin4 postfix postgres prometheus +redis webdav -k8s-cluster [all:children] stage_dev diff --git a/stage-qa b/stage-qa index 324a4a6..966432d 100644 --- a/stage-qa +++ b/stage-qa @@ -46,6 +46,9 @@ qa-postgres-02 [prometheus] qa-prometheus-01 +[redis] +qa-redis-01 + [webdav] qa-webdav-01 @@ -75,6 +78,7 @@ elastic gitea harbor iam +k8s-cluster keycloak kibana logstash @@ -84,8 +88,8 @@ pgadmin4 postfix postgres prometheus +redis webdav -k8s-cluster [all:children] stage_qa diff --git a/templates/prometheus/config/grafana/provisioning/dashboards/Redis.json b/templates/prometheus/config/grafana/provisioning/dashboards/Redis.json new file mode 100644 index 0000000..da46223 --- /dev/null +++ b/templates/prometheus/config/grafana/provisioning/dashboards/Redis.json @@ -0,0 +1,1315 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, + "type": "dashboard" + } + ] + }, + "description": "Redis Dashboard for Prometheus Redis ", + "editable": true, + "gnetId": 10819, + "graphTooltip": 0, + "id": 13, + "iteration": 1637686234590, + "links": [], + "panels": [ + { + "cacheTimeout": null, + "columns": [ + { + "text": "Current", + "value": "current" + } + ], + "datasource": "Prometheus", + "fontSize": "100%", + "gridPos": { + "h": 7, + "w": 4, + "x": 0, + "y": 0 + }, + "id": 9, + "links": [], + "pageSize": null, + "scroll": true, + "showHeader": true, + "sort": { + "col": 0, + "desc": true + }, + "styles": [ + { + "alias": "", + "align": "auto", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "", + "thresholds": [], + "type": "number", + "unit": "short" + }, + { + "alias": "Uptime", + "align": "auto", + "colorMode": "cell", + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "decimals": 2, + "link": false, + "pattern": "/.*/", + "thresholds": [ + "600", + "1200" + ], + "type": "number", + "unit": "s" + } + ], + "targets": [ + { + "expr": "redis_uptime_in_seconds{release=~\"$release\"}", + "format": "time_series", + "interval": "", + "intervalFactor": 2, + "legendFormat": "{{ instance }}", + "metric": "", + "refId": "A", + "step": 1800 + } + ], + "title": "Uptime", + "transform": "timeseries_aggregations", + "type": "table-old" + }, + { + "cacheTimeout": null, + "datasource": "Prometheus", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 0, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "max": 100, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgba(50, 172, 45, 0.97)", + "value": null + }, + { + "color": "rgba(237, 129, 40, 0.89)", + "value": 80 + }, + { + "color": "rgba(245, 54, 54, 0.9)", + "value": 95 + } + ] + }, + "unit": "percent" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 4, + "x": 4, + "y": 0 + }, + "hideTimeOverride": true, + "id": 11, + "interval": null, + "links": [], + "maxDataPoints": 100, + "options": { + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true, + "text": {} + }, + "pluginVersion": "8.1.2", + "targets": [ + { + "expr": "100 * (redis_memory_used_bytes{instance=~\"$instance\"} / redis_memory_max_bytes{instance=~\"$instance\"} )", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "", + "metric": "", + "refId": "A", + "step": 2 + } + ], + "timeFrom": "1m", + "timeShift": null, + "title": "Memory Usage", + "type": "gauge" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "editable": true, + "error": false, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "grid": {}, + "gridPos": { + "h": 7, + "w": 8, + "x": 8, + "y": 0 + }, + "hiddenSeries": false, + "id": 2, + "isNew": true, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": false, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "8.1.2", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "rate(redis_commands_processed_total{instance=~\"$instance\"}[1m])", + "format": "time_series", + "interval": "", + "intervalFactor": 2, + "legendFormat": "{{ instance }}", + "metric": "A", + "refId": "A", + "step": 240, + "target": "" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Commands Executed / sec", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 0, + "value_type": "cumulative" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "decimals": 2, + "editable": true, + "error": false, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "grid": {}, + "gridPos": { + "h": 7, + "w": 8, + "x": 16, + "y": 0 + }, + "hiddenSeries": false, + "id": 1, + "isNew": true, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": false, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "options": { + "alertThreshold": true + }, + "percentage": true, + "pluginVersion": "8.1.2", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "irate(redis_keyspace_hits_total{instance=~\"$instance\"}[5m])", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 2, + "legendFormat": "hits-{{instance}}", + "metric": "", + "refId": "A", + "step": 240, + "target": "" + }, + { + "expr": "irate(redis_keyspace_misses_total{instance=~\"$instance\"}[5m])", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 2, + "legendFormat": "misses-{{instance}}", + "metric": "", + "refId": "B", + "step": 240, + "target": "" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Hits / Misses per Sec", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": "", + "logBase": 1, + "max": null, + "min": 0, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": { + "max": "#BF1B00" + }, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "editable": true, + "error": false, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "grid": {}, + "gridPos": { + "h": 7, + "w": 12, + "x": 0, + "y": 7 + }, + "hiddenSeries": false, + "id": 7, + "isNew": true, + "legend": { + "avg": false, + "current": false, + "hideEmpty": false, + "hideZero": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "null as zero", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "8.1.2", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "redis_memory_used_bytes{instance=~\"$instance\"} ", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "used-{{instance}}", + "metric": "", + "refId": "A", + "step": 240, + "target": "" + }, + { + "expr": "redis_memory_max_bytes{instance=~\"$instance\"} ", + "format": "time_series", + "hide": false, + "intervalFactor": 2, + "legendFormat": "max", + "refId": "B", + "step": 240 + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Total Memory Usage", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 0, + "value_type": "cumulative" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "bytes", + "label": null, + "logBase": 1, + "max": null, + "min": 0, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "editable": true, + "error": false, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "grid": {}, + "gridPos": { + "h": 7, + "w": 12, + "x": 12, + "y": 7 + }, + "hiddenSeries": false, + "id": 10, + "isNew": true, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "8.1.2", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "rate(redis_net_input_bytes_total{instance=~\"$instance\"}[5m])", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "{{ input }}", + "refId": "A", + "step": 240 + }, + { + "expr": "rate(redis_net_output_bytes_total{instance=~\"$instance\"}[5m])", + "format": "time_series", + "interval": "", + "intervalFactor": 2, + "legendFormat": "{{ output }}", + "refId": "B", + "step": 240 + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Network I/O", + "tooltip": { + "msResolution": true, + "shared": true, + "sort": 0, + "value_type": "cumulative" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "bytes", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "editable": true, + "error": false, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 7, + "fillGradient": 0, + "grid": {}, + "gridPos": { + "h": 7, + "w": 12, + "x": 0, + "y": 14 + }, + "hiddenSeries": false, + "id": 5, + "isNew": true, + "legend": { + "alignAsTable": true, + "avg": false, + "current": true, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "8.1.2", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": true, + "steppedLine": false, + "targets": [ + { + "expr": "sum (redis_db_keys{instance=~\"$instance\"}) by (db)", + "format": "time_series", + "interval": "", + "intervalFactor": 2, + "legendFormat": "{{ db }} ", + "refId": "A", + "step": 240, + "target": "" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Total Items per DB", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "none", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "editable": true, + "error": false, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 7, + "fillGradient": 0, + "grid": {}, + "gridPos": { + "h": 7, + "w": 12, + "x": 12, + "y": 14 + }, + "hiddenSeries": false, + "id": 13, + "isNew": true, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "8.1.2", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": true, + "steppedLine": false, + "targets": [ + { + "expr": "sum (redis_db_keys{instance=~\"$instance\"}) - sum (redis_db_keys_expiring{instance=~\"$instance\"}) ", + "format": "time_series", + "interval": "", + "intervalFactor": 2, + "legendFormat": "not expiring", + "refId": "A", + "step": 240, + "target": "" + }, + { + "expr": "sum (redis_db_keys_expiring{instance=~\"$instance\"}) ", + "format": "time_series", + "interval": "", + "intervalFactor": 2, + "legendFormat": "expiring", + "metric": "", + "refId": "B", + "step": 240 + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Expiring vs Not-Expiring Keys", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": { + "evicts": "#890F02", + "memcached_items_evicted_total{instance=\"172.17.0.1:9150\",job=\"prometheus\"}": "#890F02", + "reclaims": "#3F6833" + }, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "editable": true, + "error": false, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "grid": {}, + "gridPos": { + "h": 7, + "w": 12, + "x": 0, + "y": 21 + }, + "hiddenSeries": false, + "id": 8, + "isNew": true, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "8.1.2", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [ + { + "alias": "reclaims", + "yaxis": 2 + } + ], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(rate(redis_expired_keys_total{instance=~\"$instance\"}[5m])) by (instance)", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 2, + "legendFormat": "expired", + "metric": "", + "refId": "A", + "step": 240, + "target": "" + }, + { + "expr": "sum(rate(redis_evicted_keys_total{instance=~\"$instance\"}[5m])) by (instance)", + "format": "time_series", + "interval": "", + "intervalFactor": 2, + "legendFormat": "evicted", + "refId": "B", + "step": 240 + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Expired / Evicted", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 0, + "value_type": "cumulative" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "editable": true, + "error": false, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 8, + "fillGradient": 0, + "grid": {}, + "gridPos": { + "h": 7, + "w": 12, + "x": 12, + "y": 21 + }, + "hiddenSeries": false, + "id": 14, + "isNew": true, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "8.1.2", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": true, + "steppedLine": false, + "targets": [ + { + "expr": "topk(5, irate(redis_commands_total{instance=~\"$instance\"} [1m]))", + "format": "time_series", + "interval": "", + "intervalFactor": 2, + "legendFormat": "{{ cmd }}", + "metric": "redis_command_calls_total", + "refId": "A", + "step": 240 + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Command Calls / sec", + "tooltip": { + "msResolution": true, + "shared": true, + "sort": 0, + "value_type": "cumulative" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "editable": true, + "error": false, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 8, + "fillGradient": 0, + "grid": {}, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 28 + }, + "hiddenSeries": false, + "id": 15, + "isNew": true, + "legend": { + "alignAsTable": false, + "avg": true, + "current": true, + "hideZero": false, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "8.1.2", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "topk(5, irate(redis_commands_duration_seconds_total{instance=~\"$instance\"} [1m]))", + "format": "time_series", + "interval": "", + "intervalFactor": 2, + "legendFormat": "{{ cmd }}-{{instance}}", + "metric": "redis_command_calls_total", + "refId": "A", + "step": 240 + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Command Duration", + "tooltip": { + "msResolution": true, + "shared": true, + "sort": 0, + "value_type": "cumulative" + }, + "transparent": true, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "s", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + } + ], + "refresh": "30s", + "schemaVersion": 30, + "style": "dark", + "tags": [ + "prometheus", + "redis" + ], + "templating": { + "list": [ + { + "allValue": null, + "current": { + "isNone": true, + "selected": false, + "text": "None", + "value": "" + }, + "datasource": "Prometheus", + "definition": "label_values(redis_up, release)", + "description": null, + "error": null, + "hide": 0, + "includeAll": false, + "label": null, + "multi": false, + "name": "release", + "options": [], + "query": { + "query": "label_values(redis_up, release)", + "refId": "Prometheus-release-Variable-Query" + }, + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "tagValuesQuery": "", + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": null, + "current": { + "selected": false, + "text": "All", + "value": "$__all" + }, + "datasource": "Prometheus", + "definition": "query_result(up{release=\"$release\"})", + "description": null, + "error": null, + "hide": 0, + "includeAll": true, + "label": null, + "multi": false, + "name": "instance", + "options": [], + "query": { + "query": "query_result(up{release=\"$release\"})", + "refId": "Prometheus-instance-Variable-Query" + }, + "refresh": 1, + "regex": "/.*instance=\"([^\"]+).*/", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tagsQuery": "", + "type": "query", + "useTags": false + } + ] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "timezone": "browser", + "title": "Redis Dashboard", + "uid": "dvSx1Dpnz", + "version": 1 +} \ No newline at end of file diff --git a/templates/prometheus/config/prometheus/prometheus.yml.j2 b/templates/prometheus/config/prometheus/prometheus.yml.j2 index 0da48b7..8982b27 100644 --- a/templates/prometheus/config/prometheus/prometheus.yml.j2 +++ b/templates/prometheus/config/prometheus/prometheus.yml.j2 @@ -278,6 +278,29 @@ scrape_configs: target_label: instance replacement: $1 +############################################## + + - job_name: 'redis' + scheme: http + metrics_path: '/metrics' + static_configs: + - targets: [ +{% for server_info in stage_server_infos | default([]) %} +{% if server_info.service == 'redis' %} + '{{ server_info.name }}.{{ domain }}:{{ redis_exporter_service_port | default("9121") }}', +{% endif %} +{% endfor %} + ] + labels: + env: {{ stage }} + project: smardigo + application: redis + relabel_configs: + - source_labels: [__address__] + regex: (.*) + target_label: instance + replacement: $1 + ############################################## ### Servers #### ##############################################