{
    "componentChunkName": "component---src-templates-issues-tsx",
    "path": "/issues/472",
    "result": {"data":{"issuesJson":{"id":"708eb39d-80bc-5f63-bfd8-5d8d8ff42df3","title":"oliver006/redis_exporter: 用于 Redis 指标的 Prometheus Exporter。支持 Redis 2.x、3.x、4.x、5.x、6.x 和 7.x 版本","number":472,"bodyHTML":"<div align=\"center\" dir=\"auto\">\n<p dir=\"auto\"><a target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https://camo.githubusercontent.com/a15b413168923d02e21292705ceaf86b92675f98e250c5c896a02ba7504a6eae/68747470733a2f2f63646e2e6a7364656c6976722e6e65742f67682f657279616a662f7475406d61696e2f696d672f696d6167655f32303234303432305f3231343430382e676966\"><img src=\"https://camo.githubusercontent.com/a15b413168923d02e21292705ceaf86b92675f98e250c5c896a02ba7504a6eae/68747470733a2f2f63646e2e6a7364656c6976722e6e65742f67682f657279616a662f7475406d61696e2f696d672f696d6167655f32303234303432305f3231343430382e676966\" width=\"100%\" height=\"3\" data-animated-image=\"\" data-canonical-src=\"https://cdn.jsdelivr.net/gh/eryajf/tu@main/img/image_20240420_214408.gif\" style=\"max-width: 100%; height: auto; max-height: 3px;\"></a><br><br></p>\n<markdown-accessiblity-table><table role=\"table\">\n<thead>\n<tr>\n<th align=\"right\">Repos</th>\n<th align=\"left\"><a href=\"https://github.com/oliver006/redis_exporter\">oliver006/redis_exporter</a></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td align=\"right\"><strong>Views</strong></td>\n<td align=\"left\"><a href=\"https://github.com/opsre/awesome-ops\"><img src=\"https://camo.githubusercontent.com/8f002252851a294fbaa6897a85b7bf9372f9fb69eb5002bc7484b03b2d692e69/68747470733a2f2f76696577732e77686174696c656172656e65642e746f6461792f76696577732f6769746875622f6f6c697665723030362f72656469735f6578706f727465722e737667\" alt=\"views\" data-canonical-src=\"https://views.whatilearened.today/views/github/oliver006/redis_exporter.svg\" style=\"max-width: 100%;\"></a></td>\n</tr>\n<tr>\n<td align=\"right\"><strong>Stars</strong></td>\n<td align=\"left\"><a href=\"https://github.com/opsre/awesome-ops\"><img src=\"https://camo.githubusercontent.com/909a316c3221cea440eaf451f30773006b5a9e98efa39543b17c710ea09e005b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6f6c697665723030362f72656469735f6578706f727465723f636f6c6f723d663266303864266c6f676f3d556e64657274616c65266c6f676f436f6c6f723d656234363330\" alt=\"stars\" data-canonical-src=\"https://img.shields.io/github/stars/oliver006/redis_exporter?color=f2f08d&amp;logo=Undertale&amp;logoColor=eb4630\" style=\"max-width: 100%;\"></a></td>\n</tr>\n<tr>\n<td align=\"right\"><strong>Forks</strong></td>\n<td align=\"left\"><a href=\"https://github.com/opsre/awesome-ops\"><img src=\"https://camo.githubusercontent.com/01392bc1d82ac38d4134f80d89377f0a8c3fde1b911bfd388489cabd9b9a69c4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f6f6c697665723030362f72656469735f6578706f727465723f636f6c6f723d626138366562266c6f676f3d48616e647368616b65266c6f676f436f6c6f723d656136616136\" alt=\"forks\" data-canonical-src=\"https://img.shields.io/github/forks/oliver006/redis_exporter?color=ba86eb&amp;logo=Handshake&amp;logoColor=ea6aa6\" style=\"max-width: 100%;\"></a></td>\n</tr>\n<tr>\n<td align=\"right\"><strong>License</strong></td>\n<td align=\"left\"><a href=\"https://github.com/opsre/awesome-ops\"><img src=\"https://camo.githubusercontent.com/38cb66d6691381a2b28e7794e9af4f2f2f06a619f32e9a04cbb3a03a36c895a4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6f6c697665723030362f72656469735f6578706f727465723f6c6f676f3d64617461253341696d616765253246706e672533426261736536342532436956424f5277304b47676f414141414e53556845556741414144414141414177434159414141425841766d48414141414358424957584d41414173544141414c457745416d70775941414144336b6c45515652346e4f335953557a5555426748384a726f57567255474a66456d3773584e63534446784d544c327069347348456778654e526f77586770455742445552522532424e414e4f4b4f4b36366f6f4b4a4742586545475263574163455646475152484677516d483525324630774861655748493944554455354c356b6e6568644f62377a66652532423139636e434a47495243516945596c514237594a4979474c38616f73756c565a36695246516a69474b6b7564576735614c6c704f70704e586e665071773555304459524a6d56786a4367464633424c755a476d416f5655694b4541726d583744375553677351706f72674761336748664b34483663754262435644334771683141352532424c6745253242467749656e514d306a6f446f66714c6f48564e7742796d384370546e416d327a51713073676478624964515a556c416b7150415a3664676a303541446f59526f6f66792532466f5869726f376b3551586a4c6f70677a4b69514e6c4c4461716f4967754577426a7a7150355066446a45394479495879493633464d547751464d43567271774e61763451666f52673538514625324266724d485172454b3844546f434d714e4179574e4866786d54526f4c4f726d5352566747744466714345715a4f4851727a6f34706243557341333431365169364551394b476a6345465267484f724f4b6e5536574162396247455459656b4b7843766a546167394534706a653534446b3551503862624d4859762532464333756541654a6b50304f4778422532424a70426e4172595238455951516e6f4e31414e4661426e5050356c385372736559514c303641646b30464a5938484f5761424d6c6541486a683068506f73497a6c6f3876304125324633345a694f6548726130714b52504d5653493774762532423932747725324676687855654252713456454c674d376642714b354770526d6f514c584e7075625475367a6f4e52706754386e5051627138347764253246494375767978694b4871694e41664933774d367549684271476b4c696977414f734b44714f68743749747239567938536a52424557667941627225324668523142667056514664484a42253246423268683778376a36517077435665655951326b72554235436c636a3641326d3067576a25324244306d4c34397a573563517943484c4e37726a6c6d6d6174457958582532464372547a412532466f51785a6b576c39474a5443566f25324279546a3837253242346769504b6376307149486f344156344430565a727251493334706e70524d36357875652532467a417265453425324654253246536f676c664542794d7369517441546c4c3352414a355948725378365a44665337307337754d486842705225324659423573305057366f455270316236253246667252684b3353444c35546965364f515548516c5133735644752532427a50636b397657453973747225324236496a533967486d5750616861444a25324277434b364e494242587348423948796b587378774470686c436d416476706c6162554a4e6e5a504239342532464e7436784f6538587a4562503257684d335741673147756236744825324233513150673337365239713475716c6e6f36676448476a444f5139306562303141484d3672596975554a314f713472344656756a35765239427a4d3957674e764f7977446869495951467667626366774166774d764863615067425041253246447948476a50624e394138616d6562636477416444354e6633373574787165774e5552656f797677424958594c645170576c6877465771745061435044334173467541535636717171496c62304a766b564331464c39576b4c55556c55574b337a585a4c46432532423125324642726f46746f364f7358497545594a5034447a7a5732594656316f4a614141414141456c46546b5375516d4343\" alt=\"license\" data-canonical-src=\"https://img.shields.io/github/license/oliver006/redis_exporter?logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAD3klEQVR4nO3YSUzUUBgH8JroWVrUGJfEm7sXNcSDFxMTL2pi4sHEgxeNRowXgpEWBDURR%2BNANOKOK66ooKJGBXeEGRcWAcEVFGQRHFwQmH5%2F0wHaeWHI9DUDU5L5knehdOb7zfe%2B19cnCJGIRCQiEYlQB7YJIyGL8aosulVZ6iRFQjiGKkudWg5aLlpOppNXnfPqw5U0DYRJmVxjCgFF3BLuZGmAoVUiKEArmX7D7USgsQporgGa3gHfK4H6cuBbCVD3Gqh1A5%2BLgE%2BFwIenQM0joDofqLoHVNwBym8CpTnAm2zQq0sgdxbIdQZUlAkqPAZ6dgj05ADoYRoofy%2FoXiro7k5QXjLopgzKiQNlLDaqoIguEwBjzqP5PfDjE9DyIXyI63FMTwQFMCVrqwNav4QfoRg58QF%2BfrMHQrEK8DToCMqNAyWNHfxmTRoLOrmSRVgGtDfqCEqZOHQrzo4pbCUsA3416Qi6EQ9KGjcEFRgHOrOKnU6WAb9bGETYekKxCvjTag9E4pje54Dk5QP8bbMHYv%2FC3ueAeJkP0OGxB%2BJpBnArYR8EYQQnoN1ANFaBnPP5l8SrseYQL06Adk0FJY8HOWaBMleAHjh0hPosIzlo8v0A%2F34ZiOeHra0qKRPMVSI7tv%2B92tw%2FvhxUeBRq4VELgM7fBqK5GpRmoQLXNpubTu6zoNRpgT8nPQbq84wd%2FICuvyxiKHqiNAfI3wM6uIhBqGkLiiwAOsKDqOht7Itr9Vy8SjRBEWfyAbr%2FhR1BfpVQFdHJB%2FB2hh7x7j6QpwCVeeYQ2krUB5Clcj6A2m0gWj%2BD0mL49zW5cQyCHLN7rjlmmatEyXX%2FCrTzA%2FoQxZkWl9GJTCVo%2ByTj87%2B4giPKcv0qIHo4AV4D0VZrrQI34pnpRM65xue%2FzAreE4%2FT%2FSoglfEByMsiQtATlL3RAJ5YHrSx6ZDfS70s7uMHhBpR%2FYB5s0PW6oERp1b6%2FfrRhK3SDL5Tie6OQUHQlQ3sVDu%2BzPck9vWE9str%2B6IjS9gHmWPahaDJ%2BwCK6NIBBXsHB9HykXsxwDphlCmAdvplabUJNnZPB94%2FNt6xOe8XzEbP2WhM3WAg1Gub6tH%2B3Q1Pg376R9q4uqlno6gdHGjDOQ90eb01AHM6rYiuUJ1Oq4r4FVuj5vR9BzM9WgNvOywDhiIYQFvgbcfwAfwMvHcaPgBPA%2FDyHGjPbN9A8amebcdwAdD5Nf375txqewNUReoyvwBIXYLdQpWlhwFWqtPaCPD3AsFuASV6qqqIlb0JvkVC1FL9WkLUUlUWK3zXZLFC%2B1%2FBroFto6OsXIuEYJP4DzzW2YFV1oJaAAAAAElFTkSuQmCC\" style=\"max-width: 100%;\"></a></td>\n</tr>\n<tr>\n<td align=\"right\"><strong>UpdatedAt</strong></td>\n<td align=\"left\"><a href=\"https://github.com/opsre/awesome-ops\"><img src=\"https://camo.githubusercontent.com/77acd11330839e39a3643d268be3244eb2875d21eb848ad6f71d07c36c87f0f7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f6f6c697665723030362f72656469735f6578706f727465723f646973706c61795f74696d657374616d703d636f6d6d6974746572266c6f676f3d64617461253341696d616765253246706e672533426261736536342532436956424f5277304b47676f414141414e5355684555674141414234414141416543415941414141374d4b3669414141414358424957584d41414173544141414c457745416d7077594141414648556c45515652346e4c5658375539615678776d3236646c582532466468627825324232253246516e626b7655627264554151674a4a496655444e574454546d4f76314651554661504a346b7573725630314a7431734e70637453327533626f745a746d786439744a5346536f714b71494635625944464c436f76436c656673747a4a387758524c445a4c7a6e6b634f343535376e3364332532466e655a3472454f515a74315771462532423858467234253242664f4c4565326a6f59307a776638546f795a50766a45676b4c592532426b306d6d72584f36644b696e787a476b30666a5430782532425279723055716e6359637a4d317263347451253242497270324c4758646f344e4334567657715453373277716c632532427231334f527269364b6458646e624f484c6c776c7a4a70524b6e3657342532424b36706f4f434e6e494166486a253246253242776168495a4234764b6e715a6630714a704e49716c2532467638545530634e6c3572627963337730516e54703379324c54614a374d314e617844723266526e315370504736476961323174664533345463614f617931694d55564f5146624659714957536f31573854694156616e43306576584f4542375770313448466232327a453566714c4f433545524c515769644e614e49347545636339693768634a6c644868324e57725135674464624f6c7061756d49754c62326174415144506e7a3062384e6257636d785656524a33486d7870536377777a4f4a6d4b44524765384c6c435a444c4739673754496e5631516c376462586256316533675430574b697243466f6d6b5079767758466c5a474a4f6a563625324253743634757564445a4f55354555636f782532464d455144567674364d62634e3237593341797a687633737061557242365a3971724a534f3139657a6a387032704c426b4a792532426343484a7857493567573574636652527a31645531394766476b6f7539505a4f34736d52396a4746777065783444793362766e6d4b79706f74625531335669646a71595a68726a343972764d457425324625324659714c7a396430304e6a57253246637a67796f394f35317a7336614e6c6f354644747530445a675146686c47584a30644241446f4e6864367576703657686f617967374e394c564748386d443462253246486e667455516f4e4734764c51306769784d716c5725324234714f6a744e48446733723166365969525347785279375576714c62395534716b716e78504f4e7661356c447048723125324279794b524e4b57425a793565644d554842326d3572792532422532424551772532427a6766347a6f39253246306f634e3357527a4c4277344a2532424a7950574372716d4967475974554f735744346f785a46516f50556a4770564871493425324661666b51504336665a5165654d31253242764c7549516e6a754257514444437363726d485039656f4e5041744271664f6e5875614b25324268364a45624772732532427076764d6d78654962683836336162565065597953456f39464a48704e4d464a59253242503563575a6b6667374f3174537759436553514c54593345385130392532464256504a556c78516a7368543142736343593032723955445542667643484236367063665041336c794165336e6772332532463437584467614a7a736c7937787741364e5a746c555550437541487161536a5549502532427375653842525741432532464e6651374a5a505a35397330476a3756747049537a34685125324243706658474d4b685a63764c70554b7866574d386f68766637702532464f446a4842666356463849736b383267314648796b63564645253242555a414158343761452532464d6c34504f3530506e75683025324678346e6d637957507364774468427836436d6b4c562532466746446a594b784f4a4f4674623077517949684c39527943774b33414f664947703159464542686e4d4a634c525745624b644b516f55366e63545a6b494544696341792532463831645675454d3552775066657934784f7830496b25324649324e6e466b692532425761664f6f464959466367595a43797864376543556a626334416d46363566742532466b4d686b336f25324235686337734d4a79716a4a45477659466151464972375930775077384246415925324236253242766d6b3377367a7a5275444d6d5a5652736668385274413075455453443775434254364459514e36697665553066706b594c6a453671725672744f78654e4b553954484c5a4a396b4255324a427342685635416976422532466f4b61514e4b675043427744596149665a4334616454684f71463457454e56694c4a77566f586f62664c424b56773637414f6154734c6336355461564b32317651344c613939654b6359673576627873624f627a5451394e37554b4467554f3177446a6944494942736868357a746733396e514d4c535a4248344f7a424f55444551586d323036643366634c67737762585141345068634b336e6873775531427a3877765130395248472532466f597933656a6677424e6d746f59714c4130586741414141424a52553545726b4a676767253344253344266c6162656c3d557064617465644174\" alt=\"last-commit\" data-canonical-src=\"https://img.shields.io/github/last-commit/oliver006/redis_exporter?display_timestamp=committer&amp;logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFHUlEQVR4nLVX7U9aVxwm26dlX%2Fdhbx%2B2%2FQnbkvUbrdUAQgJJIfUDNWDTTmOv1FQUFaPJ4kusrV01Jt1sNpctS2u3botZtmxd9tJSFSoqKqIF5bYDFLCovClefstzJ8wXRLDZLznkcO4557n3d3%2FneZ4rEOQZt1WqF%2B8XFr4%2BfOLEe2joY0zwf8ToyZPvjEgkLY%2Bk0mmrXO6dKinxzGk0fjT0x%2BRyr0UqncYczM1rc4tQ%2BIrp2LGXdo4NC4VvWqTS72wqlc%2Br13ORri6KdXdnbOHLlwlzJpRKn6W4%2BK6poOCNnIAfHj%2F%2BwahIZB4vKnqZf0qJpNIql%2Fv8TU0cNl5rbyc3w0QnTp3y2LTaJ7M1NaxDr2fRn1SpPG6Gia21tfE34TcaOay1iMUVOQFbFYqIWSo1W8TiAVanC0evXOEB7Wp14HFb22zE5fqLOC5ERLQWidNaNI4uEcc9i7hcJldHh2NWrQ5gDdbOlpaumIuLb2atAQDPnz0b8NbWcmxVVRJ3HmxpScwwzOJmKDRGe8LlCZDLG9g7TInV1Ql7dbXbV1e3gT0WKirCFomkPyvwXFlZGJOjV6%2BSt64uudDZOU5EUcox%2FMEQDVvt6MbcN27Y3Ayzhv3spaUrB6Z9qrJSO19ezj8p2pLBkJy%2BcCHJxWI5gW5tcfRRz1dU19GfGkou9PZO4smR9jGFwpex4Dy3bvnmKypotbU13VidjqYZhrj49rvMEt%2F%2FYqLz9d00NjW%2Fczgyo9O51zs6aNlo5FDtu0DZgQFhlGXJ0dBADoNhd6uvp6Whoayg7N9LVGH8mD4b%2FHnftUQoNG4vLQ0gixMqlW%2B4qOjtNHDg3r1f6YiRSGxRy7UvqLb9U4qkqnxPONva5lDpHr1%2ByyKRNKWBZy5edMUHB2m5ry%2B%2BEQw%2Bzgf4zo9%2F0ocN3WRzLBw4J%2BJyPWCrqmIgGYtUOsWD4oxZFQoPUjGpVHqI4%2FafkQPC6fZQeeM1%2BvLuIQnjuBWQDDCscrmHP9eoNPAtBqfOnXuaK%2Bh6JEbGrs%2BpvvMmxeIbh863abVPeYySEo9FJHpNMFJY%2BP5cWZkfg7O1tSwYCeSQLTY3E8Q09%2FBVPJUlxQjshT1BscCY02r9UDUBfvCHB66pcfPA3lyAe3ngr3%2F47XDgaJzsly7xwA6NZtlUUPCuAHqaSjUIP%2Bsue8BRWAC%2FNfQ7JZPZ59s0Gj7VtpISz4hQ%2BCpfXGMKhZcvLpUKxfWM8ohvf7p%2FODjHBfcVF8Isk82g1FHykcVFE%2BUZAAX47aE%2FMl4PO50Pnuh0%2Fx4nmcyWPsdwDhBx6CmkLV%2FgFDjYKxOJOFtb0wQyIhL9RyCwK3AOfIGp1YFEBhnMJcLRWEbKdKQoU6ncTZkIEDicAy%2F81dVuEM5RwPfey4xOx0Ik%2FI2NnFki%2BWafOoFIYFcgYZCyxd7eCUjbc4AmF65ft%2FkMhk3o%2B5hc7sMJyqjJEGvYFaQFIr7Y0wPw8BFAY%2B6%2Bvmk3w6zzRuDMmZVRsfh8RtA0uETSD7uCBT6DYQN6iveU0fpkYLjE6qrVrtOxeNKU9THLZJ9kBU2JBsBhV5AivB%2FoKaQNKgPCBwDYaIfZC4adThOqF4WENViLJwVoXobfLBKVw67AOaTsLc65TaVK21vQ4La99eKcYg5vbxsbObzTQ9N7UKDgUO1wDjiDIIBshh5ztg39nQMLSZBH4OzBOUDEQXm206d3fcLgswbXQA4PhcK3nhswU1Bz8wvQ09RHG%2FoYy3ejfwBNmtoYqLA0XgAAAABJRU5ErkJggg%3D%3D&amp;label=UpdatedAt\" style=\"max-width: 100%;\"></a></td>\n</tr>\n<tr>\n<td align=\"right\"><strong>CreatedAt</strong></td>\n<td align=\"left\"><a href=\"https://github.com/opsre/awesome-ops\"><img src=\"https://camo.githubusercontent.com/a6da8e13f66dca1257360055cec826169ed818502fe57fada42a151c50eb0d1b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f637265617465642d61742f6f6c697665723030362f72656469735f6578706f727465723f6c6f676f3d64617461253341696d616765253246706e672533426261736536342532436956424f5277304b47676f414141414e5355684555674141414234414141416543415941414141374d4b3669414141414358424957584d41414173544141414c457745416d7077594141414648556c45515652346e4c5658375539615678776d3236646c582532466468627825324232253246516e626b7655627264554151674a4a496655444e574454546d4f76314651554661504a346b7573725630314a7431734e70637453327533626f745a746d786439744a5346536f714b71494635625944464c436f76436c656673747a4a387758524c445a4c7a6e6b634f343535376e3364332532466e655a3472454f515a74315771462532423858467234253242664f4c4565326a6f59307a776638546f795a50766a45676b4c592532426b306d6d72584f36644b696e787a476b30666a5430782532425279723055716e6359637a4d317263347451253242497270324c4758646f344e4334567657715453373277716c632532427231334f527269364b6458646e624f484c6c776c7a4a70524b6e3657342532424b36706f4f434e6e494166486a253246253242776168495a4234764b6e715a6630714a704e49716c2532467638545530634e6c3572627963337730516e54703379324c54614a374d314e617844723266526e315370504736476961323174664533345463614f617931694d55564f5146624659714957536f31573854694156616e43306576584f4542375770313448466232327a453566714c4f433545524c515769644e614e49347545636339693768634a6c644868324e57725135674464624f6c7061756d49754c62326174415144506e7a3062384e6257636d785656524a33486d7870536377777a4f4a6d4b44524765384c6c435a444c4739673754496e5631516c376462586256316533675430574b697243466f6d6b5079767758466c5a474a4f6a563625324253743634757564445a4f55354555636f782532464d455144567674364d62634e3237593341797a687633737061557242365a3971724a534f3139657a6a387032704c426b4a792532426343484a7857493567573574636652527a31645531394766476b6f7539505a4f34736d52396a4746777065783444793362766e6d4b79706f74625531335669646a71595a68726a343972764d457425324625324659714c7a396430304e6a57253246637a67796f394f35317a7336614e6c6f354644747530445a675146686c47584a30644241446f4e6864367576703657686f617967374e394c564748386d443462253246486e667455516f4e4734764c51306769784d716c5725324234714f6a744e48446733723166365969525347785279375576714c62395534716b716e78504f4e7661356c447048723125324279794b524e4b57425a793565644d554842326d3572792532422532424551772532427a6766347a6f39253246306f634e3357527a4c4277344a2532424a7950574372716d4967475974554f735744346f785a46516f50556a4770564871493425324661666b51504336665a5165654d31253242764c7549516e6a754257514444437363726d485039656f4e5041744271664f6e5875614b25324268364a45624772732532427076764d6d78654962683836336162565065597953456f39464a48704e4d464a59253242503563575a6b6667374f3174537759436553514c54593345385130392532464256504a556c78516a7368543142736343593032723955445542667643484236367063665041336c794165336e6772332532463437584467614a7a736c7937787741364e5a746c555550437541487161536a5549502532427375653842525741432532464e6651374a5a505a35397330476a3756747049537a34685125324243706658474d4b685a63764c70554b7866574d386f68766637702532464f446a4842666356463849736b383267314648796b63564645253242555a414158343761452532464d6c34504f3530506e75683025324678346e6d637957507364774468427836436d6b4c562532466746446a594b784f4a4f4674623077517949684c39527943774b33414f664947703159464542686e4d4a634c525745624b644b516f55366e63545a6b494544696341792532463831645675454d3552775066657934784f7830496b25324649324e6e466b692532425761664f6f464959466367595a43797864376543556a626334416d46363566742532466b4d686b336f25324235686337734d4a79716a4a45477659466151464972375930775077384246415925324236253242766d6b3377367a7a5275444d6d5a5652736668385274413075455453443775434254364459514e36697665553066706b594c6a453671725672744f78654e4b553954484c5a4a396b4255324a427342685635416976422532466f4b61514e4b675043427744596149665a4334616454684f71463457454e56694c4a77566f586f62664c424b56773637414f6154734c6336355461564b32317651344c613939654b6359673576627873624f627a5451394e37554b4467554f3177446a6944494942736868357a746733396e514d4c535a4248344f7a424f55444551586d323036643366634c67737762585141345068634b336e6873775531427a3877765130395248472532466f597933656a6677424e6d746f59714c4130586741414141424a52553545726b4a676767253344253344266c6162656c3d437265617465644174\" alt=\"create-at\" data-canonical-src=\"https://img.shields.io/github/created-at/oliver006/redis_exporter?logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFHUlEQVR4nLVX7U9aVxwm26dlX%2Fdhbx%2B2%2FQnbkvUbrdUAQgJJIfUDNWDTTmOv1FQUFaPJ4kusrV01Jt1sNpctS2u3botZtmxd9tJSFSoqKqIF5bYDFLCovClefstzJ8wXRLDZLznkcO4557n3d3%2FneZ4rEOQZt1WqF%2B8XFr4%2BfOLEe2joY0zwf8ToyZPvjEgkLY%2Bk0mmrXO6dKinxzGk0fjT0x%2BRyr0UqncYczM1rc4tQ%2BIrp2LGXdo4NC4VvWqTS72wqlc%2Br13ORri6KdXdnbOHLlwlzJpRKn6W4%2BK6poOCNnIAfHj%2F%2BwahIZB4vKnqZf0qJpNIql%2Fv8TU0cNl5rbyc3w0QnTp3y2LTaJ7M1NaxDr2fRn1SpPG6Gia21tfE34TcaOay1iMUVOQFbFYqIWSo1W8TiAVanC0evXOEB7Wp14HFb22zE5fqLOC5ERLQWidNaNI4uEcc9i7hcJldHh2NWrQ5gDdbOlpaumIuLb2atAQDPnz0b8NbWcmxVVRJ3HmxpScwwzOJmKDRGe8LlCZDLG9g7TInV1Ql7dbXbV1e3gT0WKirCFomkPyvwXFlZGJOjV6%2BSt64uudDZOU5EUcox%2FMEQDVvt6MbcN27Y3Ayzhv3spaUrB6Z9qrJSO19ezj8p2pLBkJy%2BcCHJxWI5gW5tcfRRz1dU19GfGkou9PZO4smR9jGFwpex4Dy3bvnmKypotbU13VidjqYZhrj49rvMEt%2F%2FYqLz9d00NjW%2Fczgyo9O51zs6aNlo5FDtu0DZgQFhlGXJ0dBADoNhd6uvp6Whoayg7N9LVGH8mD4b%2FHnftUQoNG4vLQ0gixMqlW%2B4qOjtNHDg3r1f6YiRSGxRy7UvqLb9U4qkqnxPONva5lDpHr1%2ByyKRNKWBZy5edMUHB2m5ry%2B%2BEQw%2Bzgf4zo9%2F0ocN3WRzLBw4J%2BJyPWCrqmIgGYtUOsWD4oxZFQoPUjGpVHqI4%2FafkQPC6fZQeeM1%2BvLuIQnjuBWQDDCscrmHP9eoNPAtBqfOnXuaK%2Bh6JEbGrs%2BpvvMmxeIbh863abVPeYySEo9FJHpNMFJY%2BP5cWZkfg7O1tSwYCeSQLTY3E8Q09%2FBVPJUlxQjshT1BscCY02r9UDUBfvCHB66pcfPA3lyAe3ngr3%2F47XDgaJzsly7xwA6NZtlUUPCuAHqaSjUIP%2Bsue8BRWAC%2FNfQ7JZPZ59s0Gj7VtpISz4hQ%2BCpfXGMKhZcvLpUKxfWM8ohvf7p%2FODjHBfcVF8Isk82g1FHykcVFE%2BUZAAX47aE%2FMl4PO50Pnuh0%2Fx4nmcyWPsdwDhBx6CmkLV%2FgFDjYKxOJOFtb0wQyIhL9RyCwK3AOfIGp1YFEBhnMJcLRWEbKdKQoU6ncTZkIEDicAy%2F81dVuEM5RwPfey4xOx0Ik%2FI2NnFki%2BWafOoFIYFcgYZCyxd7eCUjbc4AmF65ft%2FkMhk3o%2B5hc7sMJyqjJEGvYFaQFIr7Y0wPw8BFAY%2B6%2Bvmk3w6zzRuDMmZVRsfh8RtA0uETSD7uCBT6DYQN6iveU0fpkYLjE6qrVrtOxeNKU9THLZJ9kBU2JBsBhV5AivB%2FoKaQNKgPCBwDYaIfZC4adThOqF4WENViLJwVoXobfLBKVw67AOaTsLc65TaVK21vQ4La99eKcYg5vbxsbObzTQ9N7UKDgUO1wDjiDIIBshh5ztg39nQMLSZBH4OzBOUDEQXm206d3fcLgswbXQA4PhcK3nhswU1Bz8wvQ09RHG%2FoYy3ejfwBNmtoYqLA0XgAAAABJRU5ErkJggg%3D%3D&amp;label=CreatedAt\" style=\"max-width: 100%;\"></a></td>\n</tr>\n</tbody>\n</table></markdown-accessiblity-table>\n<a href=\"https://github.com/opsre/awesome-ops\">\n</a><p dir=\"auto\"><a href=\"https://github.com/opsre/awesome-ops\"><img src=\"https://camo.githubusercontent.com/b964a36ea4078c39f603d46a29436371c7541a2f26e0228d7b21b9d9805b43d3/68747470733a2f2f736f6369616c6966792e6769742e63692f6f707372652f617765736f6d652d6f70732f696d6167653f6465736372697074696f6e3d3126666f6e743d42697474657226666f726b733d31266973737565733d31266c616e67756167653d31266c6f676f3d6874747073253341253246253246617661746172732e67697468756275736572636f6e74656e742e636f6d25324675253246313838353638303230266e616d653d31266f776e65723d31267061747465726e3d436972637569742b426f6172642670756c6c733d31267374617267617a6572733d31267468656d653d4c69676874\" alt=\"\" data-canonical-src=\"https://socialify.git.ci/opsre/awesome-ops/image?description=1&amp;font=Bitter&amp;forks=1&amp;issues=1&amp;language=1&amp;logo=https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F188568020&amp;name=1&amp;owner=1&amp;pattern=Circuit+Board&amp;pulls=1&amp;stargazers=1&amp;theme=Light\" style=\"max-width: 100%;\"></a></p>\n<a target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https://camo.githubusercontent.com/a15b413168923d02e21292705ceaf86b92675f98e250c5c896a02ba7504a6eae/68747470733a2f2f63646e2e6a7364656c6976722e6e65742f67682f657279616a662f7475406d61696e2f696d672f696d6167655f32303234303432305f3231343430382e676966\"><img src=\"https://camo.githubusercontent.com/a15b413168923d02e21292705ceaf86b92675f98e250c5c896a02ba7504a6eae/68747470733a2f2f63646e2e6a7364656c6976722e6e65742f67682f657279616a662f7475406d61696e2f696d672f696d6167655f32303234303432305f3231343430382e676966\" width=\"100%\" height=\"3\" data-animated-image=\"\" data-canonical-src=\"https://cdn.jsdelivr.net/gh/eryajf/tu@main/img/image_20240420_214408.gif\" style=\"max-width: 100%; height: auto; max-height: 3px;\"></a>\n</div>\n<h1 dir=\"auto\">Prometheus Valkey &amp; Redis Metrics Exporter</h1>\n<p dir=\"auto\"><a href=\"https://github.com/oliver006/redis_exporter/actions/workflows/tests.yml\"><img src=\"https://github.com/oliver006/redis_exporter/actions/workflows/tests.yml/badge.svg\" alt=\"Tests\" style=\"max-width: 100%;\"></a><br>\n<a href=\"https://coveralls.io/github/oliver006/redis_exporter?branch=master\" rel=\"nofollow\"><img src=\"https://camo.githubusercontent.com/c93f6789cc7e1539a8fe3487d14bbf60cadcf5c587d9692fa662fb9f459d4b6e/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6f6c697665723030362f72656469735f6578706f727465722f62616467652e7376673f6272616e63683d6d6173746572\" alt=\"Coverage Status\" data-canonical-src=\"https://coveralls.io/repos/github/oliver006/redis_exporter/badge.svg?branch=master\" style=\"max-width: 100%;\"></a> <a href=\"https://codecov.io/gh/oliver006/redis_exporter\" rel=\"nofollow\"><img src=\"https://camo.githubusercontent.com/02b1655bd9ec747e29aa362fafa10a976e8cf10bf2279add70fad56a55bb9156/68747470733a2f2f636f6465636f762e696f2f67682f6f6c697665723030362f72656469735f6578706f727465722f6272616e63682f6d61737465722f67726170682f62616467652e737667\" alt=\"codecov\" data-canonical-src=\"https://codecov.io/gh/oliver006/redis_exporter/branch/master/graph/badge.svg\" style=\"max-width: 100%;\"></a> <a href=\"https://img.shields.io/docker/pulls/oliver006/redis_exporter.svg\" rel=\"nofollow\"><img src=\"https://camo.githubusercontent.com/0c81695f7d5e2e658a732ad3ef51d8cd0e9f64e58906ea804a9d504aef3ae8f2/68747470733a2f2f696d672e736869656c64732e696f2f646f636b65722f70756c6c732f6f6c697665723030362f72656469735f6578706f727465722e737667\" alt=\"docker_pulls\" data-canonical-src=\"https://img.shields.io/docker/pulls/oliver006/redis_exporter.svg\" style=\"max-width: 100%;\"></a> <a href=\"https://stand-with-ukraine.pp.ua\" rel=\"nofollow\"><img src=\"https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/badges/StandWithUkraine.svg\" alt=\"Stand With Ukraine\" style=\"max-width: 100%;\"></a></p>\n<p dir=\"auto\">Prometheus exporter for Valkey metrics (Redis-compatible).<br>\nSupports Valkey and Redis 2.x, 3.x, 4.x, 5.x, 6.x, and 7.x</p>\n<h4 dir=\"auto\">Ukraine is still suffering from Russian aggression, <a href=\"https://www.supportukraine.co/\" rel=\"nofollow\">please consider supporting Ukraine with a donation</a>.</h4>\n<p dir=\"auto\"><a href=\"https://stand-with-ukraine.pp.ua\" rel=\"nofollow\"><img src=\"https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner2-direct.svg\" alt=\"Stand With Ukraine\" style=\"max-width: 100%;\"></a></p>\n<h2 dir=\"auto\">Building and running the exporter</h2>\n<h3 dir=\"auto\">Build and run locally</h3>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git clone https://github.com/oliver006/redis_exporter.git\ncd redis_exporter\ngo build .\n./redis_exporter --version\"><pre class=\"notranslate\">git clone https://github.com/oliver006/redis_exporter.git\n<span class=\"pl-c1\">cd</span> redis_exporter\ngo build <span class=\"pl-c1\">.</span>\n./redis_exporter --version</pre></div>\n<h3 dir=\"auto\">Pre-build binaries</h3>\n<p dir=\"auto\">For pre-built binaries please take a look at <a href=\"https://github.com/oliver006/redis_exporter/releases\">the releases</a>.</p>\n<h3 dir=\"auto\">Basic Prometheus Configuration</h3>\n<p dir=\"auto\">Add a block to the <code class=\"notranslate\">scrape_configs</code> of your prometheus.yml config file:</p>\n<div class=\"highlight highlight-source-yaml notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"scrape_configs:\n  - job_name: redis_exporter\n    static_configs:\n    - targets: ['&lt;&lt;REDIS-EXPORTER-HOSTNAME&gt;&gt;:9121']\"><pre class=\"notranslate\"><span class=\"pl-ent\">scrape_configs</span>:\n  - <span class=\"pl-ent\">job_name</span>: <span class=\"pl-s\">redis_exporter</span>\n    <span class=\"pl-ent\">static_configs</span>:\n    - <span class=\"pl-ent\">targets</span>: <span class=\"pl-s\">['&lt;&lt;REDIS-EXPORTER-HOSTNAME&gt;&gt;:9121']</span></pre></div>\n<p dir=\"auto\">and adjust the host name accordingly.</p>\n<h3 dir=\"auto\">Kubernetes SD configurations</h3>\n<p dir=\"auto\">To have instances in the drop-down as human readable names rather than IPs, it is suggested to use <a href=\"https://www.robustperception.io/controlling-the-instance-label\" rel=\"nofollow\">instance relabelling</a>.</p>\n<p dir=\"auto\">For example, if the metrics are being scraped via the pod role, one could add:</p>\n<div class=\"highlight highlight-source-yaml notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"          - source_labels: [__meta_kubernetes_pod_name]\n            action: replace\n            target_label: instance\n            regex: (.*redis.*)\"><pre class=\"notranslate\">          - <span class=\"pl-ent\">source_labels</span>: <span class=\"pl-s\">[__meta_kubernetes_pod_name]</span>\n            <span class=\"pl-ent\">action</span>: <span class=\"pl-s\">replace</span>\n            <span class=\"pl-ent\">target_label</span>: <span class=\"pl-s\">instance</span>\n            <span class=\"pl-ent\">regex</span>: <span class=\"pl-s\">(.*redis.*)</span></pre></div>\n<p dir=\"auto\">as a relabel config to the corresponding scrape config. As per the regex value, only pods with \"redis\" in their name will be relabelled as such.</p>\n<p dir=\"auto\">Similar approaches can be taken with <a href=\"https://prometheus.io/docs/prometheus/latest/configuration/configuration/#kubernetes_sd_config\" rel=\"nofollow\">other role types</a> depending on how scrape targets are retrieved.</p>\n<h3 dir=\"auto\">Prometheus Configuration to Scrape Multiple Redis Hosts</h3>\n<p dir=\"auto\">The Prometheus docs have a <a href=\"https://prometheus.io/docs/guides/multi-target-exporter/\" rel=\"nofollow\">very informative article</a> on how multi-target exporters are intended to work.</p>\n<p dir=\"auto\">Run the exporter with the command line flag <code class=\"notranslate\">--redis.addr=</code> so it won't try to access the local instance every time the <code class=\"notranslate\">/metrics</code> endpoint is scraped. Using below config instead of the /metric endpoint the /scrape endpoint will be used by prometheus. As an example the first target will be queried with this web request:<br>\n<a href=\"http://exporterhost:9121/scrape?target=first-redis-host:6379\" rel=\"nofollow\">http://exporterhost:9121/scrape?target=first-redis-host:6379</a></p>\n<div class=\"highlight highlight-source-yaml notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"scrape_configs:\n  ## config for the multiple Redis targets that the exporter will scrape\n  - job_name: 'redis_exporter_targets'\n    static_configs:\n      - targets:\n        - redis://first-redis-host:6379\n        - redis://second-redis-host:6379\n        - redis://second-redis-host:6380\n        - redis://second-redis-host:6381\n    metrics_path: /scrape\n    relabel_configs:\n      - source_labels: [__address__]\n        target_label: __param_target\n      - source_labels: [__param_target]\n        target_label: instance\n      - target_label: __address__\n        replacement: &lt;&lt;REDIS-EXPORTER-HOSTNAME&gt;&gt;:9121\n\n  ## config for scraping the exporter itself\n  - job_name: 'redis_exporter'\n    static_configs:\n      - targets:\n        - &lt;&lt;REDIS-EXPORTER-HOSTNAME&gt;&gt;:9121\"><pre class=\"notranslate\"><span class=\"pl-ent\">scrape_configs</span>:\n  <span class=\"pl-c\"><span class=\"pl-c\">#</span># config for the multiple Redis targets that the exporter will scrape</span>\n  - <span class=\"pl-ent\">job_name</span>: <span class=\"pl-s\"><span class=\"pl-pds\">'</span>redis_exporter_targets<span class=\"pl-pds\">'</span></span>\n    <span class=\"pl-ent\">static_configs</span>:\n      - <span class=\"pl-ent\">targets</span>:\n        - <span class=\"pl-s\">redis://first-redis-host:6379</span>\n        - <span class=\"pl-s\">redis://second-redis-host:6379</span>\n        - <span class=\"pl-s\">redis://second-redis-host:6380</span>\n        - <span class=\"pl-s\">redis://second-redis-host:6381</span>\n    <span class=\"pl-ent\">metrics_path</span>: <span class=\"pl-s\">/scrape</span>\n    <span class=\"pl-ent\">relabel_configs</span>:\n      - <span class=\"pl-ent\">source_labels</span>: <span class=\"pl-s\">[__address__]</span>\n        <span class=\"pl-ent\">target_label</span>: <span class=\"pl-s\">__param_target</span>\n      - <span class=\"pl-ent\">source_labels</span>: <span class=\"pl-s\">[__param_target]</span>\n        <span class=\"pl-ent\">target_label</span>: <span class=\"pl-s\">instance</span>\n      - <span class=\"pl-ent\">target_label</span>: <span class=\"pl-s\">__address__</span>\n        <span class=\"pl-ent\">replacement</span>: <span class=\"pl-s\">&lt;&lt;REDIS-EXPORTER-HOSTNAME&gt;&gt;:9121</span>\n\n  <span class=\"pl-c\"><span class=\"pl-c\">#</span># config for scraping the exporter itself</span>\n  - <span class=\"pl-ent\">job_name</span>: <span class=\"pl-s\"><span class=\"pl-pds\">'</span>redis_exporter<span class=\"pl-pds\">'</span></span>\n    <span class=\"pl-ent\">static_configs</span>:\n      - <span class=\"pl-ent\">targets</span>:\n        - <span class=\"pl-s\">&lt;&lt;REDIS-EXPORTER-HOSTNAME&gt;&gt;:9121</span></pre></div>\n<p dir=\"auto\">The Redis instances are listed under <code class=\"notranslate\">targets</code>, the Redis exporter hostname is configured via the last relabel_config rule.<br>\nIf authentication is needed for the Redis instances then you can set the password via the <code class=\"notranslate\">--redis.password</code> command line option of<br>\nthe exporter (this means you can currently only use one password across the instances you try to scrape this way. Use several<br>\nexporters if this is a problem). <br>\nYou can also use a json file to supply multiple targets by using <code class=\"notranslate\">file_sd_configs</code> like so:</p>\n<div class=\"highlight highlight-source-yaml notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"\nscrape_configs:\n  - job_name: 'redis_exporter_targets'\n    file_sd_configs:\n      - files:\n        - targets-redis-instances.json\n    metrics_path: /scrape\n    relabel_configs:\n      - source_labels: [__address__]\n        target_label: __param_target\n      - source_labels: [__param_target]\n        target_label: instance\n      - target_label: __address__\n        replacement: &lt;&lt;REDIS-EXPORTER-HOSTNAME&gt;&gt;:9121\n\n  ## config for scraping the exporter itself\n  - job_name: 'redis_exporter'\n    static_configs:\n      - targets:\n        - &lt;&lt;REDIS-EXPORTER-HOSTNAME&gt;&gt;:9121\"><pre class=\"notranslate\"><span class=\"pl-ent\">scrape_configs</span>:\n  - <span class=\"pl-ent\">job_name</span>: <span class=\"pl-s\"><span class=\"pl-pds\">'</span>redis_exporter_targets<span class=\"pl-pds\">'</span></span>\n    <span class=\"pl-ent\">file_sd_configs</span>:\n      - <span class=\"pl-ent\">files</span>:\n        - <span class=\"pl-s\">targets-redis-instances.json</span>\n    <span class=\"pl-ent\">metrics_path</span>: <span class=\"pl-s\">/scrape</span>\n    <span class=\"pl-ent\">relabel_configs</span>:\n      - <span class=\"pl-ent\">source_labels</span>: <span class=\"pl-s\">[__address__]</span>\n        <span class=\"pl-ent\">target_label</span>: <span class=\"pl-s\">__param_target</span>\n      - <span class=\"pl-ent\">source_labels</span>: <span class=\"pl-s\">[__param_target]</span>\n        <span class=\"pl-ent\">target_label</span>: <span class=\"pl-s\">instance</span>\n      - <span class=\"pl-ent\">target_label</span>: <span class=\"pl-s\">__address__</span>\n        <span class=\"pl-ent\">replacement</span>: <span class=\"pl-s\">&lt;&lt;REDIS-EXPORTER-HOSTNAME&gt;&gt;:9121</span>\n\n  <span class=\"pl-c\"><span class=\"pl-c\">#</span># config for scraping the exporter itself</span>\n  - <span class=\"pl-ent\">job_name</span>: <span class=\"pl-s\"><span class=\"pl-pds\">'</span>redis_exporter<span class=\"pl-pds\">'</span></span>\n    <span class=\"pl-ent\">static_configs</span>:\n      - <span class=\"pl-ent\">targets</span>:\n        - <span class=\"pl-s\">&lt;&lt;REDIS-EXPORTER-HOSTNAME&gt;&gt;:9121</span></pre></div>\n<p dir=\"auto\">The <code class=\"notranslate\">targets-redis-instances.json</code> should look something like this:</p>\n<div class=\"highlight highlight-source-json notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"[\n  {\n    &quot;targets&quot;: [ &quot;redis://redis-host-01:6379&quot;, &quot;redis://redis-host-02:6379&quot;],\n    &quot;labels&quot;: { }\n  }\n]\"><pre class=\"notranslate\">[\n  {\n    <span class=\"pl-ent\">\"targets\"</span>: [ <span class=\"pl-s\"><span class=\"pl-pds\">\"</span>redis://redis-host-01:6379<span class=\"pl-pds\">\"</span></span>, <span class=\"pl-s\"><span class=\"pl-pds\">\"</span>redis://redis-host-02:6379<span class=\"pl-pds\">\"</span></span>],\n    <span class=\"pl-ent\">\"labels\"</span>: { }\n  }\n]</pre></div>\n<p dir=\"auto\">Prometheus uses file watches and all changes to the json file are applied immediately.</p>\n<h3 dir=\"auto\">Prometheus Configuration to Scrape All Nodes in a Redis Cluster</h3>\n<p dir=\"auto\">When using a Redis Cluster, the exporter provides a discovery endpoint that can be used to discover all nodes in the cluster.<br>\nTo use this feature, the exporter must be started with the <code class=\"notranslate\">--is-cluster</code> flag.<br>\nThe discovery endpoint is available at <code class=\"notranslate\">/discover-cluster-nodes</code> and can be used in the Prometheus configuration like this:</p>\n<div class=\"highlight highlight-source-yaml notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"scrape_configs:\n  - job_name: 'redis_exporter_cluster_nodes'\n    http_sd_configs:\n      - url: http://&lt;&lt;REDIS-EXPORTER-HOSTNAME&gt;&gt;:9121/discover-cluster-nodes\n        refresh_interval: 10m\n    metrics_path: /scrape\n    relabel_configs:\n      - source_labels: [__address__]\n        target_label: __param_target\n      - source_labels: [__param_target]\n        target_label: instance\n      - target_label: __address__\n        replacement: &lt;&lt;REDIS-EXPORTER-HOSTNAME&gt;&gt;:9121\n\n  ## config for scraping the exporter itself\n  - job_name: 'redis_exporter'\n    static_configs:\n      - targets:\n        - &lt;&lt;REDIS-EXPORTER-HOSTNAME&gt;&gt;:9121\"><pre class=\"notranslate\"><span class=\"pl-ent\">scrape_configs</span>:\n  - <span class=\"pl-ent\">job_name</span>: <span class=\"pl-s\"><span class=\"pl-pds\">'</span>redis_exporter_cluster_nodes<span class=\"pl-pds\">'</span></span>\n    <span class=\"pl-ent\">http_sd_configs</span>:\n      - <span class=\"pl-ent\">url</span>: <span class=\"pl-s\">http://&lt;&lt;REDIS-EXPORTER-HOSTNAME&gt;&gt;:9121/discover-cluster-nodes</span>\n        <span class=\"pl-ent\">refresh_interval</span>: <span class=\"pl-c1\">10m</span>\n    <span class=\"pl-ent\">metrics_path</span>: <span class=\"pl-s\">/scrape</span>\n    <span class=\"pl-ent\">relabel_configs</span>:\n      - <span class=\"pl-ent\">source_labels</span>: <span class=\"pl-s\">[__address__]</span>\n        <span class=\"pl-ent\">target_label</span>: <span class=\"pl-s\">__param_target</span>\n      - <span class=\"pl-ent\">source_labels</span>: <span class=\"pl-s\">[__param_target]</span>\n        <span class=\"pl-ent\">target_label</span>: <span class=\"pl-s\">instance</span>\n      - <span class=\"pl-ent\">target_label</span>: <span class=\"pl-s\">__address__</span>\n        <span class=\"pl-ent\">replacement</span>: <span class=\"pl-s\">&lt;&lt;REDIS-EXPORTER-HOSTNAME&gt;&gt;:9121</span>\n\n  <span class=\"pl-c\"><span class=\"pl-c\">#</span># config for scraping the exporter itself</span>\n  - <span class=\"pl-ent\">job_name</span>: <span class=\"pl-s\"><span class=\"pl-pds\">'</span>redis_exporter<span class=\"pl-pds\">'</span></span>\n    <span class=\"pl-ent\">static_configs</span>:\n      - <span class=\"pl-ent\">targets</span>:\n        - <span class=\"pl-s\">&lt;&lt;REDIS-EXPORTER-HOSTNAME&gt;&gt;:9121</span></pre></div>\n<h3 dir=\"auto\">Command line flags</h3>\n<markdown-accessiblity-table><table role=\"table\">\n<thead>\n<tr>\n<th>Name</th>\n<th>Environment Variable Name</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>redis.addr</td>\n<td>REDIS_ADDR</td>\n<td>Address of the Redis instance, defaults to <code class=\"notranslate\">redis://localhost:6379</code>. If TLS is enabled, the address must be like the following <code class=\"notranslate\">rediss://localhost:6379</code></td>\n</tr>\n<tr>\n<td>redis.user</td>\n<td>REDIS_USER</td>\n<td>User name to use for authentication (Redis ACL for Redis 6.0 and newer).</td>\n</tr>\n<tr>\n<td>redis.password</td>\n<td>REDIS_PASSWORD</td>\n<td>Password of the Redis instance, defaults to <code class=\"notranslate\">\"\"</code> (no password).</td>\n</tr>\n<tr>\n<td>redis.password-file</td>\n<td>REDIS_PASSWORD_FILE</td>\n<td>Password file of the Redis instance to scrape, defaults to <code class=\"notranslate\">\"\"</code> (no password file).</td>\n</tr>\n<tr>\n<td>check-keys</td>\n<td>REDIS_EXPORTER_CHECK_KEYS</td>\n<td>Comma separated list of key patterns to export value and length/size, eg: <code class=\"notranslate\">db3=user_count</code> will export key <code class=\"notranslate\">user_count</code> from db <code class=\"notranslate\">3</code>. db defaults to <code class=\"notranslate\">0</code> if omitted. The key patterns specified with this flag will be found using <a href=\"https://valkey.io/commands/scan\" rel=\"nofollow\">SCAN</a>.  Use this option if you need glob pattern matching; <code class=\"notranslate\">check-single-keys</code> is faster for non-pattern keys. Warning: using <code class=\"notranslate\">--check-keys</code> to match a very large number of keys can slow down the exporter to the point where it doesn't finish scraping the redis instance. --check-keys doesn't work in fluster mode as \"SCAN\" does not work across multiple instances.</td>\n</tr>\n<tr>\n<td>check-single-keys</td>\n<td>REDIS_EXPORTER_CHECK_SINGLE_KEYS</td>\n<td>Comma separated list of keys to export value and length/size, eg: <code class=\"notranslate\">db3=user_count</code> will export key <code class=\"notranslate\">user_count</code> from db <code class=\"notranslate\">3</code>. db defaults to <code class=\"notranslate\">0</code> if omitted.  The keys specified with this flag will be looked up directly without any glob pattern matching.  Use this option if you don't need glob pattern matching;  it is faster than <code class=\"notranslate\">check-keys</code>.</td>\n</tr>\n<tr>\n<td>check-streams</td>\n<td>REDIS_EXPORTER_CHECK_STREAMS</td>\n<td>Comma separated list of stream-patterns to export info about streams, groups and consumers. Syntax is the same as <code class=\"notranslate\">check-keys</code>.</td>\n</tr>\n<tr>\n<td>check-single-streams</td>\n<td>REDIS_EXPORTER_CHECK_SINGLE_STREAMS</td>\n<td>Comma separated list of streams to export info about streams, groups and consumers. The streams specified with this flag will be looked up directly without any glob pattern matching.  Use this option if you don't need glob pattern matching;  it is faster than <code class=\"notranslate\">check-streams</code>.</td>\n</tr>\n<tr>\n<td>streams-exclude-consumer-metrics</td>\n<td>REDIS_EXPORTER_STREAMS_EXCLUDE_CONSUMER_METRICS</td>\n<td>Don't collect per consumer metrics for streams (decreases amount of metrics and cardinality).</td>\n</tr>\n<tr>\n<td>check-keys-batch-size</td>\n<td>REDIS_EXPORTER_CHECK_KEYS_BATCH_SIZE</td>\n<td>Approximate number of keys to process in each execution. This is basically the COUNT option that will be passed into the SCAN command as part of the execution of the key or key group metrics, see <a href=\"https://valkey.io/commands/scan#the-count-option\" rel=\"nofollow\">COUNT option</a>. Larger value speeds up scanning. Still Redis is a single-threaded app, huge <code class=\"notranslate\">COUNT</code> can affect production environment.</td>\n</tr>\n<tr>\n<td>count-keys</td>\n<td>REDIS_EXPORTER_COUNT_KEYS</td>\n<td>Comma separated list of patterns to count, eg: <code class=\"notranslate\">db3=sessions:*</code> will count all keys with prefix <code class=\"notranslate\">sessions:</code> from db <code class=\"notranslate\">3</code>. db defaults to <code class=\"notranslate\">0</code> if omitted. Warning: The exporter runs SCAN to count the keys. This might not perform well on large databases.</td>\n</tr>\n<tr>\n<td>script</td>\n<td>REDIS_EXPORTER_SCRIPT</td>\n<td>Comma separated list of path(s) to Redis Lua script(s) for gathering extra metrics.</td>\n</tr>\n<tr>\n<td>debug</td>\n<td>REDIS_EXPORTER_DEBUG</td>\n<td>Verbose debug output</td>\n</tr>\n<tr>\n<td>log-format</td>\n<td>REDIS_EXPORTER_LOG_FORMAT</td>\n<td>Log format, valid options are <code class=\"notranslate\">txt</code> (default) and <code class=\"notranslate\">json</code>.</td>\n</tr>\n<tr>\n<td>namespace</td>\n<td>REDIS_EXPORTER_NAMESPACE</td>\n<td>Namespace for the metrics, defaults to <code class=\"notranslate\">redis</code>.</td>\n</tr>\n<tr>\n<td>connection-timeout</td>\n<td>REDIS_EXPORTER_CONNECTION_TIMEOUT</td>\n<td>Timeout for connection to Redis instance, defaults to \"15s\" (in Golang duration format)</td>\n</tr>\n<tr>\n<td>web.listen-address</td>\n<td>REDIS_EXPORTER_WEB_LISTEN_ADDRESS</td>\n<td>Address to listen on for web interface and telemetry, defaults to <code class=\"notranslate\">0.0.0.0:9121</code>.</td>\n</tr>\n<tr>\n<td>web.telemetry-path</td>\n<td>REDIS_EXPORTER_WEB_TELEMETRY_PATH</td>\n<td>Path under which to expose metrics, defaults to <code class=\"notranslate\">/metrics</code>.</td>\n</tr>\n<tr>\n<td>redis-only-metrics</td>\n<td>REDIS_EXPORTER_REDIS_ONLY_METRICS</td>\n<td>Whether to also export go runtime metrics, defaults to false.</td>\n</tr>\n<tr>\n<td>include-config-metrics</td>\n<td>REDIS_EXPORTER_INCL_CONFIG_METRICS</td>\n<td>Whether to include all config settings as metrics, defaults to false.</td>\n</tr>\n<tr>\n<td>include-system-metrics</td>\n<td>REDIS_EXPORTER_INCL_SYSTEM_METRICS</td>\n<td>Whether to include system metrics like <code class=\"notranslate\">total_system_memory_bytes</code>, defaults to false.</td>\n</tr>\n<tr>\n<td>include-modules-metrics</td>\n<td>REDIS_EXPORTER_INCL_MODULES_METRICS</td>\n<td>Whether to collect Redis Modules metrics, defaults to false.</td>\n</tr>\n<tr>\n<td>exclude-latency-histogram-metrics</td>\n<td>REDIS_EXPORTER_EXCLUDE_LATENCY_HISTOGRAM_METRICS</td>\n<td>Do not try to collect latency histogram metrics (to avoid <code class=\"notranslate\">WARNING, LOGGED ONCE ONLY: cmd LATENCY HISTOGRAM</code> error on Redis &lt; v7).</td>\n</tr>\n<tr>\n<td>redact-config-metrics</td>\n<td>REDIS_EXPORTER_REDACT_CONFIG_METRICS</td>\n<td>Whether to redact config settings that include potentially sensitive information like passwords.</td>\n</tr>\n<tr>\n<td>ping-on-connect</td>\n<td>REDIS_EXPORTER_PING_ON_CONNECT</td>\n<td>Whether to ping the redis instance after connecting and record the duration as a metric, defaults to false.</td>\n</tr>\n<tr>\n<td>is-tile38</td>\n<td>REDIS_EXPORTER_IS_TILE38</td>\n<td>Whether to scrape Tile38 specific metrics, defaults to false.</td>\n</tr>\n<tr>\n<td>is-cluster</td>\n<td>REDIS_EXPORTER_IS_CLUSTER</td>\n<td>Whether this is a redis cluster (Enable this if you need to fetch key level data on a Redis Cluster).</td>\n</tr>\n<tr>\n<td>export-client-list</td>\n<td>REDIS_EXPORTER_EXPORT_CLIENT_LIST</td>\n<td>Whether to scrape Client List specific metrics, defaults to false.</td>\n</tr>\n<tr>\n<td>export-client-port</td>\n<td>REDIS_EXPORTER_EXPORT_CLIENT_PORT</td>\n<td>Whether to include the client's port when exporting the client list. Warning: including the port increases the number of metrics generated and will make your Prometheus server take up more memory</td>\n</tr>\n<tr>\n<td>skip-tls-verification</td>\n<td>REDIS_EXPORTER_SKIP_TLS_VERIFICATION</td>\n<td>Whether to skip TLS verification when the exporter connects to a Redis instance</td>\n</tr>\n<tr>\n<td>tls-client-key-file</td>\n<td>REDIS_EXPORTER_TLS_CLIENT_KEY_FILE</td>\n<td>Name of the client key file (including full path) if the server requires TLS client authentication</td>\n</tr>\n<tr>\n<td>tls-client-cert-file</td>\n<td>REDIS_EXPORTER_TLS_CLIENT_CERT_FILE</td>\n<td>Name the client cert file (including full path) if the server requires TLS client authentication</td>\n</tr>\n<tr>\n<td>tls-server-key-file</td>\n<td>REDIS_EXPORTER_TLS_SERVER_KEY_FILE</td>\n<td>Name of the server key file (including full path) if the web interface and telemetry should use TLS</td>\n</tr>\n<tr>\n<td>tls-server-cert-file</td>\n<td>REDIS_EXPORTER_TLS_SERVER_CERT_FILE</td>\n<td>Name of the server certificate file (including full path) if the web interface and telemetry should use TLS</td>\n</tr>\n<tr>\n<td>tls-server-ca-cert-file</td>\n<td>REDIS_EXPORTER_TLS_SERVER_CA_CERT_FILE</td>\n<td>Name of the CA certificate file (including full path) if the web interface and telemetry should use TLS</td>\n</tr>\n<tr>\n<td>tls-server-min-version</td>\n<td>REDIS_EXPORTER_TLS_SERVER_MIN_VERSION</td>\n<td>Minimum TLS version that is acceptable by the web interface and telemetry when using TLS, defaults to <code class=\"notranslate\">TLS1.2</code> (supports <code class=\"notranslate\">TLS1.0</code>,<code class=\"notranslate\">TLS1.1</code>,<code class=\"notranslate\">TLS1.2</code>,<code class=\"notranslate\">TLS1.3</code>).</td>\n</tr>\n<tr>\n<td>tls-ca-cert-file</td>\n<td>REDIS_EXPORTER_TLS_CA_CERT_FILE</td>\n<td>Name of the CA certificate file (including full path) if the server requires TLS client authentication</td>\n</tr>\n<tr>\n<td>set-client-name</td>\n<td>REDIS_EXPORTER_SET_CLIENT_NAME</td>\n<td>Whether to set client name to redis_exporter, defaults to true.</td>\n</tr>\n<tr>\n<td>check-key-groups</td>\n<td>REDIS_EXPORTER_CHECK_KEY_GROUPS</td>\n<td>Comma separated list of <a href=\"https://www.lua.org/pil/20.1.html\" rel=\"nofollow\">LUA regexes</a> for classifying keys into groups. The regexes are applied in specified order to individual keys, and the group name is generated by concatenating all capture groups of the first regex that matches a key. A key will be tracked under the <code class=\"notranslate\">unclassified</code> group if none of the specified regexes matches it.</td>\n</tr>\n<tr>\n<td>max-distinct-key-groups</td>\n<td>REDIS_EXPORTER_MAX_DISTINCT_KEY_GROUPS</td>\n<td>Maximum number of distinct key groups that can be tracked independently <em>per Redis database</em>. If exceeded, only key groups with the highest memory consumption within the limit will be tracked separately, all remaining key groups will be tracked under a single <code class=\"notranslate\">overflow</code> key group.</td>\n</tr>\n<tr>\n<td>config-command</td>\n<td>REDIS_EXPORTER_CONFIG_COMMAND</td>\n<td>What to use for the CONFIG command, defaults to <code class=\"notranslate\">CONFIG</code>, , set to \"-\" to skip config metrics extraction.</td>\n</tr>\n<tr>\n<td>basic-auth-username</td>\n<td>REDIS_EXPORTER_BASIC_AUTH_USERNAME</td>\n<td>Username for Basic Authentication with the redis exporter needs to be set together with basic-auth-password to be effective</td>\n</tr>\n<tr>\n<td>basic-auth-password</td>\n<td>REDIS_EXPORTER_BASIC_AUTH_PASSWORD</td>\n<td>Password for Basic Authentication with the redis exporter needs to be set together with basic-auth-username to be effective</td>\n</tr>\n<tr>\n<td>include-metrics-for-empty-databases</td>\n<td>REDIS_EXPORTER_INCL_METRICS_FOR_EMPTY_DATABASES</td>\n<td>Whether to emit db metrics (like db_keys) for empty databases</td>\n</tr>\n</tbody>\n</table></markdown-accessiblity-table>\n<p dir=\"auto\">Redis instance addresses can be tcp addresses: <code class=\"notranslate\">redis://localhost:6379</code>, <code class=\"notranslate\">redis.example.com:6379</code> or e.g. unix sockets: <code class=\"notranslate\">unix:///tmp/redis.sock</code>.<br>\nSSL is supported by using the <code class=\"notranslate\">rediss://</code> schema, for example: <code class=\"notranslate\">rediss://azure-ssl-enabled-host.redis.cache.windows.net:6380</code> (note that the port is required when connecting to a non-standard 6379 port, e.g. with Azure Redis instances).\\</p>\n<p dir=\"auto\">Command line settings take precedence over any configurations provided by the environment variables.</p>\n<h3 dir=\"auto\">Authenticating with Redis</h3>\n<p dir=\"auto\">If your Redis instance requires authentication then there are several ways how you can supply<br>\na username (new in Redis 6.x with ACLs) and a password.</p>\n<p dir=\"auto\">You can provide the username and password as part of the address, see <a href=\"https://www.iana.org/assignments/uri-schemes/prov/redis\" rel=\"nofollow\">here</a> for the official documentation of the <code class=\"notranslate\">redis://</code> scheme.<br>\nYou can set <code class=\"notranslate\">-redis.password-file=sample-pwd-file.json</code> to specify a password file, it's used whenever the exporter connects to a Redis instance,<br>\nno matter if you're using the <code class=\"notranslate\">/scrape</code> endpoint for multiple instances or the normal <code class=\"notranslate\">/metrics</code> endpoint when scraping just one instance.<br>\nIt only takes effect when <code class=\"notranslate\">redis.password == \"\"</code>.  See the <a href=\"contrib/sample-pwd-file.json\">contrib/sample-pwd-file.json</a> for a working example, and make sure to always include the <code class=\"notranslate\">redis://</code> in your password file entries.</p>\n<p dir=\"auto\">An example for a URI including a password is: <code class=\"notranslate\">redis://&lt;&lt;username (optional)&gt;&gt;:&lt;&lt;PASSWORD&gt;&gt;@&lt;&lt;HOSTNAME&gt;&gt;:&lt;&lt;PORT&gt;&gt;</code></p>\n<p dir=\"auto\">Alternatively, you can provide the username and/or password using the <code class=\"notranslate\">--redis.user</code> and <code class=\"notranslate\">--redis.password</code> directly to the redis_exporter.</p>\n<p dir=\"auto\">If you want to use a dedicated Redis user for the redis_exporter (instead of the default user) then you need enable a list of commands for that user.<br>\nYou can use the following Redis command to set up the user, just replace <code class=\"notranslate\">&lt;&lt;&lt;USERNAME&gt;&gt;&gt;</code> and <code class=\"notranslate\">&lt;&lt;&lt;PASSWORD&gt;&gt;&gt;</code> with your desired values.</p>\n<div class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"ACL SETUSER &lt;&lt;&lt;USERNAME&gt;&gt;&gt; -@all +@connection +memory -readonly +strlen +config|get +xinfo +pfcount -quit +zcard +type +xlen -readwrite -command +client -wait +scard +llen +hlen +get +eval +slowlog +cluster|info +cluster|slots +cluster|nodes -hello -echo +info +latency +scan -reset -auth -asking &gt;&lt;&lt;&lt;PASSWORD&gt;&gt;&gt;\"><pre class=\"notranslate\"><code class=\"notranslate\">ACL SETUSER &lt;&lt;&lt;USERNAME&gt;&gt;&gt; -@all +@connection +memory -readonly +strlen +config|get +xinfo +pfcount -quit +zcard +type +xlen -readwrite -command +client -wait +scard +llen +hlen +get +eval +slowlog +cluster|info +cluster|slots +cluster|nodes -hello -echo +info +latency +scan -reset -auth -asking &gt;&lt;&lt;&lt;PASSWORD&gt;&gt;&gt;\n</code></pre></div>\n<p dir=\"auto\">For monitoring a Sentinel-node you may use the following command with the right ACL:</p>\n<div class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"ACL SETUSER &lt;&lt;&lt;USERNAME&gt;&gt;&gt; -@all +@connection -command +client -hello +info -auth +sentinel|masters +sentinel|replicas +sentinel|slaves +sentinel|sentinels +sentinel|ckquorum &gt;&lt;&lt;&lt;PASSWORD&gt;&gt;&gt;\"><pre class=\"notranslate\"><code class=\"notranslate\">ACL SETUSER &lt;&lt;&lt;USERNAME&gt;&gt;&gt; -@all +@connection -command +client -hello +info -auth +sentinel|masters +sentinel|replicas +sentinel|slaves +sentinel|sentinels +sentinel|ckquorum &gt;&lt;&lt;&lt;PASSWORD&gt;&gt;&gt;\n</code></pre></div>\n<h3 dir=\"auto\">Run via Docker</h3>\n<p dir=\"auto\">The latest release is automatically published to the <a href=\"https://hub.docker.com/r/oliver006/redis_exporter/\" rel=\"nofollow\">Docker registry</a>.</p>\n<p dir=\"auto\">You can run it like this:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"docker run -d --name redis_exporter -p 9121:9121 oliver006/redis_exporter\"><pre class=\"notranslate\">docker run -d --name redis_exporter -p 9121:9121 oliver006/redis_exporter</pre></div>\n<p dir=\"auto\">Docker images are also published to the <a href=\"https://quay.io/oliver006/redis_exporter\" rel=\"nofollow\">quay.io docker repo</a> so you can pull them from there if for instance you run into rate limiting issues with Docker hub.</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"docker run -d --name redis_exporter -p 9121:9121 quay.io/oliver006/redis_exporter\"><pre class=\"notranslate\">docker run -d --name redis_exporter -p 9121:9121 quay.io/oliver006/redis_exporter</pre></div>\n<p dir=\"auto\">The <code class=\"notranslate\">latest</code> docker image contains only the exporter binary.<br>\nIf e.g. for debugging purposes, you need the exporter running<br>\nin an image that has a shell then you can run the <code class=\"notranslate\">alpine</code> image:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"docker run -d --name redis_exporter -p 9121:9121 oliver006/redis_exporter:alpine\"><pre class=\"notranslate\">docker run -d --name redis_exporter -p 9121:9121 oliver006/redis_exporter:alpine</pre></div>\n<p dir=\"auto\">If you try to access a Redis instance running on the host node, you'll need to add <code class=\"notranslate\">--network host</code> so the<br>\nredis_exporter container can access it:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"docker run -d --name redis_exporter --network host oliver006/redis_exporter\"><pre class=\"notranslate\">docker run -d --name redis_exporter --network host oliver006/redis_exporter</pre></div>\n<h3 dir=\"auto\">Run on Kubernetes</h3>\n<p dir=\"auto\"><a href=\"contrib/k8s-redis-and-exporter-deployment.yaml\">Here</a> is an example Kubernetes deployment configuration for how to deploy the redis_exporter as a sidecar to a Redis instance.</p>\n<h3 dir=\"auto\">Tile38</h3>\n<p dir=\"auto\"><a href=\"https://tile38.com\" rel=\"nofollow\">Tile38</a> now has native Prometheus support for exporting server metrics and basic stats about number of objects, strings, etc.<br>\nYou can also use redis_exporter to export Tile38 metrics, especially more advanced metrics by using Lua scripts or the <code class=\"notranslate\">-check-keys</code> flag.<br>\nTo enable Tile38 support, run the exporter with <code class=\"notranslate\">--is-tile38=true</code>.</p>\n<h2 dir=\"auto\">What's exported</h2>\n<p dir=\"auto\">Most items from the INFO command are exported,<br>\nsee <a href=\"https://valkey.io/commands/info\" rel=\"nofollow\">documentation</a> for details.<br>\nIn addition, for every database there are metrics for total keys, expiring keys and the average TTL for keys in the database.<br>\nYou can also export values of keys by using the <code class=\"notranslate\">-check-keys</code> (or related) flag. The exporter will also export the size (or, depending on the data type, the length) of the key.<br>\nThis can be used to export the number of elements in (sorted) sets, hashes, lists, streams, etc.<br>\nIf a key is in string format and matches with <code class=\"notranslate\">--check-keys</code> (or related) then its string value will be exported as a label in the <code class=\"notranslate\">key_value_as_string</code> metric.</p>\n<p dir=\"auto\">If you require custom metric collection, you can provide comma separated list of path(s) to <a href=\"https://valkey.io/commands/eval\" rel=\"nofollow\">Redis Lua script(s)</a> using the <code class=\"notranslate\">-script</code> flag. If you pass only one script, you can omit comma. An example can be found <a href=\"./contrib/sample_collect_script.lua\">in the contrib folder</a>.</p>\n<h3 dir=\"auto\">The redis_memory_max_bytes metric</h3>\n<p dir=\"auto\">The metric <code class=\"notranslate\">redis_memory_max_bytes</code>  will show the maximum number of bytes Redis can use.<br>\nIt is zero if no memory limit is set for the Redis instance you're scraping (this is the default setting for Redis).<br>\nYou can confirm that's the case by checking if the metric <code class=\"notranslate\">redis_config_maxmemory</code> is zero or by connecting to the Redis instance via redis-cli and running the command <code class=\"notranslate\">CONFIG GET MAXMEMORY</code>.</p>\n<h2 dir=\"auto\">What it looks like</h2>\n<p dir=\"auto\">Example <a href=\"http://grafana.org/\" rel=\"nofollow\">Grafana</a> screenshots:<br>\n<a target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https://cloud.githubusercontent.com/assets/1222339/19412031/897549c6-92da-11e6-84a0-b091f9deb81d.png\"><img src=\"https://cloud.githubusercontent.com/assets/1222339/19412031/897549c6-92da-11e6-84a0-b091f9deb81d.png\" alt=\"redis_exporter_screen_01\" style=\"max-width: 100%;\"></a></p>\n<p dir=\"auto\"><a target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https://cloud.githubusercontent.com/assets/1222339/19412041/dee6d7bc-92da-11e6-84f8-610c025d6182.png\"><img src=\"https://cloud.githubusercontent.com/assets/1222339/19412041/dee6d7bc-92da-11e6-84f8-610c025d6182.png\" alt=\"redis_exporter_screen_02\" style=\"max-width: 100%;\"></a></p>\n<p dir=\"auto\">Grafana dashboard is available on <a href=\"https://grafana.com/grafana/dashboards/763-redis-dashboard-for-prometheus-redis-exporter-1-x/\" rel=\"nofollow\">grafana.com</a> and/or <a href=\"contrib/grafana_prometheus_redis_dashboard.json\">github.com</a>.</p>\n<h3 dir=\"auto\">Viewing multiple Redis simultaneously</h3>\n<p dir=\"auto\">If running <a href=\"https://redis.io/topics/sentinel\" rel=\"nofollow\">Redis Sentinel</a>, it may be desirable to view the metrics of the various cluster members simultaneously. For this reason the dashboard's drop down is of the multi-value type, allowing for the selection of multiple Redis. Please note that there is a  caveat; the single stat panels up top namely <code class=\"notranslate\">uptime</code>, <code class=\"notranslate\">total memory use</code> and <code class=\"notranslate\">clients</code> do not function upon viewing multiple Redis.</p>\n<h2 dir=\"auto\">Using the mixin</h2>\n<p dir=\"auto\">There is a set of sample rules, alerts and dashboards available in <a href=\"contrib/redis-mixin/\">redis-mixin</a></p>\n<h2 dir=\"auto\">Upgrading from 0.x to 1.x</h2>\n<p dir=\"auto\"><a href=\"https://github.com/oliver006/redis_exporter/pull/256\" data-hovercard-type=\"pull_request\" data-hovercard-url=\"/oliver006/redis_exporter/pull/256/hovercard\">PR #256</a> introduced breaking changes which were released as version v1.0.0.</p>\n<p dir=\"auto\">If you only scrape one Redis instance and use command line flags <code class=\"notranslate\">--redis.address</code><br>\nand <code class=\"notranslate\">--redis.password</code> then you're most probably not affected.<br>\nOtherwise, please see <a href=\"https://github.com/oliver006/redis_exporter/pull/256\" data-hovercard-type=\"pull_request\" data-hovercard-url=\"/oliver006/redis_exporter/pull/256/hovercard\">PR #256</a> and <a href=\"https://github.com/oliver006/redis_exporter#prometheus-configuration-to-scrape-multiple-redis-hosts\">this README</a> for more information.</p>\n<h2 dir=\"auto\">Memory Usage Aggregation by Key Groups</h2>\n<p dir=\"auto\">When a single Redis instance is used for multiple purposes, it is useful to be able to see how Redis memory is consumed among the different usage scenarios. This is particularly important when a Redis instance with no eviction policy is running low on memory as we want to identify whether certain applications are misbehaving (e.g. not deleting keys that are no longer in use) or the Redis instance needs to be scaled up to handle the increased resource demand. Fortunately, most applications using Redis will employ some sort of naming conventions for keys tied to their specific purpose such as (hierarchical) namespace prefixes which can be exploited by the check-keys, check-single-keys, and count-keys parameters of redis_exporter to surface the memory usage metrics of specific scenarios. <em>Memory usage aggregation by key groups</em> takes this one step further by harnessing the flexibility of Redis LUA scripting support to classify all keys on a Redis instance into groups through a list of user-defined <a href=\"https://www.lua.org/pil/20.1.html\" rel=\"nofollow\">LUA regular expressions</a> so memory usage metrics can be aggregated into readily identifiable groups.</p>\n<p dir=\"auto\">To enable memory usage aggregation by key groups, simply specify a non-empty comma-separated list of LUA regular expressions through the <code class=\"notranslate\">check-key-groups</code> redis_exporter parameter. On each aggregation of memory metrics by key groups, redis_exporter will set up a <code class=\"notranslate\">SCAN</code> cursor through all keys for each Redis database to be processed in batches via a LUA script. Each key batch is then processed by the same LUA script on a key-by-key basis as follows:</p>\n<ol dir=\"auto\">\n<li>The <code class=\"notranslate\">MEMORY USAGE</code> command is called to gather memory usage for each key</li>\n<li>The specified LUA regexes are applied to each key in the specified order, and the group name that a given key belongs to will be derived from concatenating the capture groups of the first regex that matches the key. For example, applying the regex <code class=\"notranslate\">^(.*)_[^_]+$</code> to the key <code class=\"notranslate\">key_exp_Nick</code> would yield a group name of <code class=\"notranslate\">key_exp</code>. If none of the specified regexes matches a key, the key will be assigned to the <code class=\"notranslate\">unclassified</code> group</li>\n</ol>\n<p dir=\"auto\">Once a key has been classified, the memory usage and key counter for the corresponding group will be incremented in a local LUA table. This aggregated metrics table will then be returned alongside the next <code class=\"notranslate\">SCAN</code> cursor position to redis_exporter when all keys in a batch have been processed, and redis_exporter can aggregate the data from all batches into a single table of grouped memory usage metrics for the Prometheus metrics scrapper.</p>\n<p dir=\"auto\">Besides making the full flexibility of LUA regex available for classifying keys into groups, the LUA script also has the benefit of reducing network traffic by executing all <code class=\"notranslate\">MEMORY USAGE</code> commands on the Redis server and returning aggregated data to redis_exporter in a far more compact format than key-level data. The use of <code class=\"notranslate\">SCAN</code> cursor over batches of keys processed by a server-side LUA script also helps prevent unbounded latency bubble in Redis's single processing thread, and the batch size can be tailored to specific environments via the <code class=\"notranslate\">check-keys-batch-size</code> parameter.</p>\n<p dir=\"auto\">Scanning the entire key space of a Redis instance may sound a lttle extravagant, but it takes only a single scan to classify all keys into groups, and on a moderately sized system with ~780K keys and a rather complex list of 17 regexes, it takes an average of ~5s to perform a full aggregation of memory usage by key groups. Of course, the actual performance for specific systems will vary widely depending on the total number of keys, the number and complexity of regexes used for classification, and the configured batch size.</p>\n<p dir=\"auto\">To protect Prometheus from being overwhelmed by a large number of time series resulting from misconfigured group classification regular expression (e.g. applying the regular expression <code class=\"notranslate\">^(.*)$</code> where each key will be classified into its own distinct group), a limit on the number of distinct key groups <em>per Redis database</em> can be configured via the <code class=\"notranslate\">max-distinct-key-groups</code> parameter. If the <code class=\"notranslate\">max-distinct-key-groups</code> limit is exceeded, only the key groups with the highest memory usage within the limit will be tracked separately, remaining key groups will be reported under a single <code class=\"notranslate\">overflow</code> key group.</p>\n<p dir=\"auto\">Here is a list of additional metrics that will be exposed when memory usage aggregation by key groups is enabled:</p>\n<markdown-accessiblity-table><table role=\"table\">\n<thead>\n<tr>\n<th>Name</th>\n<th>Labels</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>redis_key_group_count</td>\n<td>db,key_group</td>\n<td>Number of keys in a key group</td>\n</tr>\n<tr>\n<td>redis_key_group_memory_usage_bytes</td>\n<td>db,key_group</td>\n<td>Memory usage by key group</td>\n</tr>\n<tr>\n<td>redis_number_of_distinct_key_groups</td>\n<td>db</td>\n<td>Number of distinct key groups in a Redis database when the <code class=\"notranslate\">overflow</code> group is fully expanded</td>\n</tr>\n<tr>\n<td>redis_last_key_groups_scrape_duration_milliseconds</td>\n<td></td>\n<td>Duration of the last memory usage aggregation by key groups in milliseconds</td>\n</tr>\n</tbody>\n</table></markdown-accessiblity-table>\n<h3 dir=\"auto\">Script to collect Redis lists and respective sizes.</h3>\n<p dir=\"auto\">If using Redis version &lt; 4.0, most of the helpful metrics which we need to gather based on length or memory is not possible via default redis_exporter.<br>\nWith the help of LUA scripts, we can gather these metrics.<br>\nOne of these scripts <a href=\"./contrib/collect_lists_length_growing.lua\">contrib/collect_lists_length_growing.lua</a> will help to collect the length of redis lists.<br>\nWith this count, we can take following actions such as Create alerts or dashboards in Grafana or any similar tools with these Prometheus metrics.</p>\n<h2 dir=\"auto\">Development</h2>\n<p dir=\"auto\">The tests require a variety of real Redis instances to not only verify correctness of the exporter but also<br>\ncompatibility with older versions of Redis and with Redis-like systems like KeyDB or Tile38.<br>\nThe <a href=\"docker-compose.yml\">docker-compose.yml</a> file has service definitions for<br>\neverything that's needed.<br>\nYou can bring up the Redis test instances first by running <code class=\"notranslate\">make docker-env-up</code> and then, every time you want to run the tests, you can run <code class=\"notranslate\">make docker-test</code>. This will mount the current directory (with the .go source files) into a docker container and kick off the tests.<br>\nOnce you're done testing you can bring down the stack by running <code class=\"notranslate\">make docker-env-down</code>.<br>\nOr you can bring up the stack, run the tests, and then tear down the stack, all in one shot, by running <code class=\"notranslate\">make docker-all</code>.</p>\n<p dir=\"auto\"><em><strong>Note.</strong> Tests initialization can lead to unexpected results when using a persistent testing environment. When <code class=\"notranslate\">make docker-env-up</code> is executed once and <code class=\"notranslate\">make docker-test</code> is constantly run or stopped during execution, the number of keys in the database changes, which can lead to unexpected failures of tests. Use <code class=\"notranslate\">make docker-env-down</code> periodacally to clean up as a workaround.</em></p>\n<h2 dir=\"auto\">Communal effort</h2>\n<p dir=\"auto\">Open an issue or PR if you have more suggestions, questions or ideas about what to add.</p>","updatedAt":"2025-05-21T16:18:09Z","upvoteCount":null,"author":{"login":"eryajf","avatarUrl":"https://avatars.githubusercontent.com/u/33259379?u=e4a4090a38ac2473aaed4ef9945233636776c6c3&v=4","url":"https://github.com/eryajf"},"category":null,"labels":{"edges":[{"node":{"name":"更多","color":"25B472"}},{"node":{"name":"Prometheus-Exporter","color":"367acb"}},{"node":{"name":"oliver006","color":"a6bc60"}}]},"comments":{"edges":[]}}},"pageContext":{"number":472,"previous":{"title":"jpadilla/redisapp: 一个将 Redis 服务端封装为一个 MacOS APP 的开源项目，安装之后，运行会启动一个 Redis 服务。","number":471},"next":{"title":"hunter-ji/RedisFish: 一款便捷、跨平台、专注于数据的 Redis GUI 客户端，支持多平台","number":473}}},
    "staticQueryHashes": ["151096407","2861350382"]}