| 1 | package exporterscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ |
| 2 | |
| 3 | import ( |
| 4 | "regexpscip-go gomod github.com/golang/go/src go1.25.0 regexp/" |
| 5 | "strconvscip-go gomod github.com/golang/go/src go1.25.0 strconv/" |
| 6 | "stringsscip-go gomod github.com/golang/go/src go1.25.0 strings/" |
| 7 | "timescip-go gomod github.com/golang/go/src go1.25.0 time/" |
| 8 | |
| 9 | "github.com/gomodule/redigo/redisscip-go gomod github.com/gomodule/redigo v1.9.3 `github.com/gomodule/redigo/redis`/" |
| 10 | "github.com/prometheus/client_golang/prometheusscip-go gomod github.com/prometheus/client_golang v1.23.2 `github.com/prometheus/client_golang/prometheus`/" |
| 11 | logscip-go gomod github.com/sirupsen/logrus v1.9.4 `github.com/sirupsen/logrus`/ "github.com/sirupsen/logrusscip-go gomod github.com/sirupsen/logrus v1.9.4 `github.com/sirupsen/logrus`/" |
| 12 | ) |
| 13 | |
| 14 | var reClientListIdscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/reClientListId. = regexpscip-go gomod github.com/golang/go/src go1.25.0 regexp/.MustCompilescip-go gomod github.com/golang/go/src go1.25.0 regexp/MustCompile().(`^id=\d+ addr=\S+`) |
| 15 | |
| 16 | type ClientInfoscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo# struct { |
| 17 | Idscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#Id., |
| 18 | Namescip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#Name., |
| 19 | Userscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#User., |
| 20 | Flagsscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#Flags., |
| 21 | Dbscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#Db., |
| 22 | Hostscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#Host., |
| 23 | Portscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#Port., |
| 24 | Respscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#Resp. string |
| 25 | CreatedAtscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#CreatedAt., |
| 26 | IdleSincescip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#IdleSince., |
| 27 | Subscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#Sub., |
| 28 | Psubscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#Psub., |
| 29 | Ssubscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#Ssub., |
| 30 | Watchscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#Watch., |
| 31 | Qbufscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#Qbuf., |
| 32 | QbufFreescip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#QbufFree., |
| 33 | Oblscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#Obl., |
| 34 | Ollscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#Oll., |
| 35 | OMemscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#OMem., |
| 36 | TotMemscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#TotMem. int64 |
| 37 | } |
| 38 | |
| 39 | /* |
| 40 | Valid Examples |
| 41 | id=11 addr=127.0.0.1:63508 fd=8 name= age=6321 idle=6320 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=0 obl=0 oll=0 omem=0 events=r cmd=setex user=default resp=2 |
| 42 | id=14 addr=127.0.0.1:64958 fd=9 name= age=5 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=26 qbuf-free=32742 obl=0 oll=0 omem=0 events=r cmd=client user=default resp=3 |
| 43 | id=40253233 addr=fd40:1481:21:dbe0:7021:300:a03:1a06:44426 fd=19 name= age=782 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=26 qbuf-free=32742 argv-mem=10 obl=0 oll=0 omem=0 tot-mem=61466 ow=0 owmem=0 events=r cmd=client user=default lib-name=redis-py lib-ver=5.0.1 numops=9 |
| 44 | */ |
| 45 | func parseClientListStringscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/parseClientListString().(clientInfo string) (*ClientInfoscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#, bool) { |
| 46 | if !reClientListIdscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/reClientListId..MatchStringscip-go gomod github.com/golang/go/src go1.25.0 regexp/Regexp#MatchString().(clientInfo) { |
| 47 | return nil, false |
| 48 | } |
| 49 | connectedClient := ClientInfoscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#{} |
| 50 | connectedClient.Ssubscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#Ssub. = -1 // mark it as missing - introduced in Redis 7.0.3 |
| 51 | connectedClient.Watchscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#Watch. = -1 // mark it as missing - introduced in Redis 7.4 |
| 52 | for kvPart := range stringsscip-go gomod github.com/golang/go/src go1.25.0 strings/.SplitSeqscip-go gomod github.com/golang/go/src go1.25.0 strings/SplitSeq().(clientInfo, " ") { |
| 53 | vPart := stringsscip-go gomod github.com/golang/go/src go1.25.0 strings/.Splitscip-go gomod github.com/golang/go/src go1.25.0 strings/Split().(kvPart, "=") |
| 54 | if len(vPart) != 2 { |
| 55 | logscip-go gomod github.com/sirupsen/logrus v1.9.4 `github.com/sirupsen/logrus`/.Debugfscip-go gomod github.com/sirupsen/logrus v1.9.4 `github.com/sirupsen/logrus`/Debugf().("Invalid format for client list string, got: %s", kvPart) |
| 56 | return nil, false |
| 57 | } |
| 58 | |
| 59 | switch vPart[0] { |
| 60 | case "id": |
| 61 | connectedClient.Idscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#Id. = vPart[1] |
| 62 | case "name": |
| 63 | connectedClient.Namescip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#Name. = vPart[1] |
| 64 | case "user": |
| 65 | connectedClient.Userscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#User. = vPart[1] |
| 66 | case "age": |
| 67 | createdAt, err := durationFieldToTimestampscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/durationFieldToTimestamp().(vPart[1]) |
| 68 | if err != nil { |
| 69 | logscip-go gomod github.com/sirupsen/logrus v1.9.4 `github.com/sirupsen/logrus`/.Debugfscip-go gomod github.com/sirupsen/logrus v1.9.4 `github.com/sirupsen/logrus`/Debugf().("could not parse 'age' field(%s): %s", vPart[1], err.Error()) |
| 70 | return nil, false |
| 71 | } |
| 72 | connectedClient.CreatedAtscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#CreatedAt. = createdAt |
| 73 | case "idle": |
| 74 | idleSinceTs, err := durationFieldToTimestampscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/durationFieldToTimestamp().(vPart[1]) |
| 75 | if err != nil { |
| 76 | logscip-go gomod github.com/sirupsen/logrus v1.9.4 `github.com/sirupsen/logrus`/.Debugfscip-go gomod github.com/sirupsen/logrus v1.9.4 `github.com/sirupsen/logrus`/Debugf().("could not parse 'idle' field(%s): %s", vPart[1], err.Error()) |
| 77 | return nil, false |
| 78 | } |
| 79 | connectedClient.IdleSincescip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#IdleSince. = idleSinceTs |
| 80 | case "flags": |
| 81 | connectedClient.Flagsscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#Flags. = vPart[1] |
| 82 | case "db": |
| 83 | connectedClient.Dbscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#Db. = vPart[1] |
| 84 | case "sub": |
| 85 | connectedClient.Subscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#Sub., _ = strconvscip-go gomod github.com/golang/go/src go1.25.0 strconv/.ParseIntscip-go gomod github.com/golang/go/src go1.25.0 strconv/ParseInt().(vPart[1], 10, 64) |
| 86 | case "psub": |
| 87 | connectedClient.Psubscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#Psub., _ = strconvscip-go gomod github.com/golang/go/src go1.25.0 strconv/.ParseIntscip-go gomod github.com/golang/go/src go1.25.0 strconv/ParseInt().(vPart[1], 10, 64) |
| 88 | case "ssub": |
| 89 | connectedClient.Ssubscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#Ssub., _ = strconvscip-go gomod github.com/golang/go/src go1.25.0 strconv/.ParseIntscip-go gomod github.com/golang/go/src go1.25.0 strconv/ParseInt().(vPart[1], 10, 64) |
| 90 | case "watch": |
| 91 | connectedClient.Watchscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#Watch., _ = strconvscip-go gomod github.com/golang/go/src go1.25.0 strconv/.ParseIntscip-go gomod github.com/golang/go/src go1.25.0 strconv/ParseInt().(vPart[1], 10, 64) |
| 92 | case "qbuf": |
| 93 | connectedClient.Qbufscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#Qbuf., _ = strconvscip-go gomod github.com/golang/go/src go1.25.0 strconv/.ParseIntscip-go gomod github.com/golang/go/src go1.25.0 strconv/ParseInt().(vPart[1], 10, 64) |
| 94 | case "qbuf-free": |
| 95 | connectedClient.QbufFreescip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#QbufFree., _ = strconvscip-go gomod github.com/golang/go/src go1.25.0 strconv/.ParseIntscip-go gomod github.com/golang/go/src go1.25.0 strconv/ParseInt().(vPart[1], 10, 64) |
| 96 | case "obl": |
| 97 | connectedClient.Oblscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#Obl., _ = strconvscip-go gomod github.com/golang/go/src go1.25.0 strconv/.ParseIntscip-go gomod github.com/golang/go/src go1.25.0 strconv/ParseInt().(vPart[1], 10, 64) |
| 98 | case "oll": |
| 99 | connectedClient.Ollscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#Oll., _ = strconvscip-go gomod github.com/golang/go/src go1.25.0 strconv/.ParseIntscip-go gomod github.com/golang/go/src go1.25.0 strconv/ParseInt().(vPart[1], 10, 64) |
| 100 | case "omem": |
| 101 | connectedClient.OMemscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#OMem., _ = strconvscip-go gomod github.com/golang/go/src go1.25.0 strconv/.ParseIntscip-go gomod github.com/golang/go/src go1.25.0 strconv/ParseInt().(vPart[1], 10, 64) |
| 102 | case "tot-mem": |
| 103 | connectedClient.TotMemscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#TotMem., _ = strconvscip-go gomod github.com/golang/go/src go1.25.0 strconv/.ParseIntscip-go gomod github.com/golang/go/src go1.25.0 strconv/ParseInt().(vPart[1], 10, 64) |
| 104 | case "addr": |
| 105 | hostPortString := stringsscip-go gomod github.com/golang/go/src go1.25.0 strings/.Splitscip-go gomod github.com/golang/go/src go1.25.0 strings/Split().(vPart[1], ":") |
| 106 | if len(hostPortString) < 2 { |
| 107 | logscip-go gomod github.com/sirupsen/logrus v1.9.4 `github.com/sirupsen/logrus`/.Debugscip-go gomod github.com/sirupsen/logrus v1.9.4 `github.com/sirupsen/logrus`/Debug().("Invalid value for 'addr' found in client info") |
| 108 | return nil, false |
| 109 | } |
| 110 | connectedClient.Hostscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#Host. = stringsscip-go gomod github.com/golang/go/src go1.25.0 strings/.Joinscip-go gomod github.com/golang/go/src go1.25.0 strings/Join().(hostPortString[:len(hostPortString)-1], ":") |
| 111 | connectedClient.Portscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#Port. = hostPortString[len(hostPortString)-1] |
| 112 | case "resp": |
| 113 | connectedClient.Respscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#Resp. = vPart[1] |
| 114 | } |
| 115 | } |
| 116 | |
| 117 | return &connectedClient, true |
| 118 | } |
| 119 | |
| 120 | func durationFieldToTimestampscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/durationFieldToTimestamp().(field string) (int64, error) { |
| 121 | parsed, err := strconvscip-go gomod github.com/golang/go/src go1.25.0 strconv/.ParseIntscip-go gomod github.com/golang/go/src go1.25.0 strconv/ParseInt().(field, 10, 64) |
| 122 | if err != nil { |
| 123 | return 0, err |
| 124 | } |
| 125 | return timescip-go gomod github.com/golang/go/src go1.25.0 time/.Nowscip-go gomod github.com/golang/go/src go1.25.0 time/Now().().Unixscip-go gomod github.com/golang/go/src go1.25.0 time/Time#Unix().() - parsed, nil |
| 126 | } |
| 127 | |
| 128 | func (e *Exporterscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/Exporter#) extractConnectedClientMetricsscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/Exporter#extractConnectedClientMetrics().(ch chan<- prometheusscip-go gomod github.com/prometheus/client_golang v1.23.2 `github.com/prometheus/client_golang/prometheus`/.Metricscip-go gomod github.com/prometheus/client_golang v1.23.2 `github.com/prometheus/client_golang/prometheus`/Metric#, c redisscip-go gomod github.com/gomodule/redigo v1.9.3 `github.com/gomodule/redigo/redis`/.Connscip-go gomod github.com/gomodule/redigo v1.9.3 `github.com/gomodule/redigo/redis`/Conn#) { |
| 129 | reply, err := redisscip-go gomod github.com/gomodule/redigo v1.9.3 `github.com/gomodule/redigo/redis`/.Stringscip-go gomod github.com/gomodule/redigo v1.9.3 `github.com/gomodule/redigo/redis`/String().(doRedisCmdscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/doRedisCmd().(c, "CLIENT", "LIST")) |
| 130 | if err != nil { |
| 131 | logscip-go gomod github.com/sirupsen/logrus v1.9.4 `github.com/sirupsen/logrus`/.Errorfscip-go gomod github.com/sirupsen/logrus v1.9.4 `github.com/sirupsen/logrus`/Errorf().("CLIENT LIST err: %s", err) |
| 132 | return |
| 133 | } |
| 134 | e.parseConnectedClientMetricsscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/Exporter#parseConnectedClientMetrics().(reply, ch) |
| 135 | } |
| 136 | |
| 137 | func (e *Exporterscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/Exporter#) parseConnectedClientMetricsscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/Exporter#parseConnectedClientMetrics().(input string, ch chan<- prometheusscip-go gomod github.com/prometheus/client_golang v1.23.2 `github.com/prometheus/client_golang/prometheus`/.Metricscip-go gomod github.com/prometheus/client_golang v1.23.2 `github.com/prometheus/client_golang/prometheus`/Metric#) { |
| 138 | |
| 139 | for s := range stringsscip-go gomod github.com/golang/go/src go1.25.0 strings/.SplitSeqscip-go gomod github.com/golang/go/src go1.25.0 strings/SplitSeq().(input, "\n") { |
| 140 | info, ok := parseClientListStringscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/parseClientListString().(s) |
| 141 | if !ok { |
| 142 | logscip-go gomod github.com/sirupsen/logrus v1.9.4 `github.com/sirupsen/logrus`/.Debugfscip-go gomod github.com/sirupsen/logrus v1.9.4 `github.com/sirupsen/logrus`/Debugf().("parseClientListString( %s ) - couldn';t parse input", s) |
| 143 | continue |
| 144 | } |
| 145 | clientInfoLabels := []string{"id", "name", "flags", "db", "host"} |
| 146 | clientInfoLabelValues := []string{info.Idscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#Id., info.Namescip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#Name., info.Flagsscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#Flags., info.Dbscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#Db., info.Hostscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#Host.} |
| 147 | |
| 148 | if e.optionsscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/Exporter#options..ExportClientsInclPortscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/Options#ExportClientsInclPort. { |
| 149 | clientInfoLabels = append(clientInfoLabels, "port") |
| 150 | clientInfoLabelValues = append(clientInfoLabelValues, info.Portscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#Port.) |
| 151 | } |
| 152 | |
| 153 | if user := info.Userscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#User.; user != "" { |
| 154 | clientInfoLabels = append(clientInfoLabels, "user") |
| 155 | clientInfoLabelValues = append(clientInfoLabelValues, user) |
| 156 | } |
| 157 | |
| 158 | // introduced in Redis 7.0 |
| 159 | if resp := info.Respscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#Resp.; resp != "" { |
| 160 | clientInfoLabels = append(clientInfoLabels, "resp") |
| 161 | clientInfoLabelValues = append(clientInfoLabelValues, resp) |
| 162 | } |
| 163 | |
| 164 | e.createMetricDescriptionscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/Exporter#createMetricDescription().("connected_client_info", clientInfoLabels) |
| 165 | e.registerConstMetricGaugescip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/Exporter#registerConstMetricGauge().( |
| 166 | ch, "connected_client_info", 1.0, |
| 167 | clientInfoLabelValues..., |
| 168 | ) |
| 169 | |
| 170 | clientBaseLabels := []string{"id", "name"} |
| 171 | clientBaseLabelsValues := []string{info.Idscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#Id., info.Namescip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#Name.} |
| 172 | |
| 173 | for _, metricName := range []string{ |
| 174 | "connected_client_output_buffer_memory_usage_bytes", |
| 175 | "connected_client_total_memory_consumed_bytes", |
| 176 | "connected_client_created_at_timestamp", |
| 177 | "connected_client_idle_since_timestamp", |
| 178 | "connected_client_channel_subscriptions_count", |
| 179 | "connected_client_pattern_matching_subscriptions_count", |
| 180 | "connected_client_query_buffer_length_bytes", |
| 181 | "connected_client_query_buffer_free_space_bytes", |
| 182 | "connected_client_output_buffer_length_bytes", |
| 183 | "connected_client_output_list_length", |
| 184 | } { |
| 185 | e.createMetricDescriptionscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/Exporter#createMetricDescription().(metricName, clientBaseLabels) |
| 186 | } |
| 187 | |
| 188 | e.registerConstMetricGaugescip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/Exporter#registerConstMetricGauge().( |
| 189 | ch, "connected_client_output_buffer_memory_usage_bytes", float64(info.OMemscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#OMem.), |
| 190 | clientBaseLabelsValues..., |
| 191 | ) |
| 192 | |
| 193 | e.registerConstMetricGaugescip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/Exporter#registerConstMetricGauge().( |
| 194 | ch, "connected_client_total_memory_consumed_bytes", float64(info.TotMemscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#TotMem.), |
| 195 | clientBaseLabelsValues..., |
| 196 | ) |
| 197 | |
| 198 | e.registerConstMetricGaugescip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/Exporter#registerConstMetricGauge().( |
| 199 | ch, "connected_client_created_at_timestamp", float64(info.CreatedAtscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#CreatedAt.), |
| 200 | clientBaseLabelsValues..., |
| 201 | ) |
| 202 | |
| 203 | e.registerConstMetricGaugescip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/Exporter#registerConstMetricGauge().( |
| 204 | ch, "connected_client_idle_since_timestamp", float64(info.IdleSincescip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#IdleSince.), |
| 205 | clientBaseLabelsValues..., |
| 206 | ) |
| 207 | |
| 208 | e.registerConstMetricGaugescip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/Exporter#registerConstMetricGauge().( |
| 209 | ch, "connected_client_channel_subscriptions_count", float64(info.Subscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#Sub.), |
| 210 | clientBaseLabelsValues..., |
| 211 | ) |
| 212 | |
| 213 | e.registerConstMetricGaugescip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/Exporter#registerConstMetricGauge().( |
| 214 | ch, "connected_client_pattern_matching_subscriptions_count", float64(info.Psubscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#Psub.), |
| 215 | clientBaseLabelsValues..., |
| 216 | ) |
| 217 | |
| 218 | e.registerConstMetricGaugescip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/Exporter#registerConstMetricGauge().( |
| 219 | ch, "connected_client_query_buffer_length_bytes", float64(info.Qbufscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#Qbuf.), |
| 220 | clientBaseLabelsValues..., |
| 221 | ) |
| 222 | |
| 223 | e.registerConstMetricGaugescip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/Exporter#registerConstMetricGauge().( |
| 224 | ch, "connected_client_query_buffer_free_space_bytes", float64(info.QbufFreescip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#QbufFree.), |
| 225 | clientBaseLabelsValues..., |
| 226 | ) |
| 227 | |
| 228 | e.registerConstMetricGaugescip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/Exporter#registerConstMetricGauge().( |
| 229 | ch, "connected_client_output_buffer_length_bytes", float64(info.Oblscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#Obl.), |
| 230 | clientBaseLabelsValues..., |
| 231 | ) |
| 232 | |
| 233 | e.registerConstMetricGaugescip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/Exporter#registerConstMetricGauge().( |
| 234 | ch, "connected_client_output_list_length", float64(info.Ollscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#Oll.), |
| 235 | clientBaseLabelsValues..., |
| 236 | ) |
| 237 | |
| 238 | if info.Ssubscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#Ssub. != -1 { |
| 239 | e.createMetricDescriptionscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/Exporter#createMetricDescription().("connected_client_shard_channel_subscriptions_count", clientBaseLabels) |
| 240 | e.registerConstMetricGaugescip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/Exporter#registerConstMetricGauge().( |
| 241 | ch, "connected_client_shard_channel_subscriptions_count", float64(info.Ssubscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#Ssub.), |
| 242 | clientBaseLabelsValues..., |
| 243 | ) |
| 244 | } |
| 245 | if info.Watchscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#Watch. != -1 { |
| 246 | e.createMetricDescriptionscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/Exporter#createMetricDescription().("connected_client_shard_channel_watched_keys", clientBaseLabels) |
| 247 | e.registerConstMetricGaugescip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/Exporter#registerConstMetricGauge().( |
| 248 | ch, "connected_client_shard_channel_watched_keys", float64(info.Watchscip-go gomod github.com/oliver006/redis_exporter . `github.com/oliver006/redis_exporter/exporter`/ClientInfo#Watch.), |
| 249 | clientBaseLabelsValues..., |
| 250 | ) |
| 251 | } |
| 252 | } |
| 253 | } |