Skip to content

Commit

Permalink
feat: add label master_replid to metricinstance_info (#924)
Browse files Browse the repository at this point in the history
  • Loading branch information
wilkice authored Aug 9, 2024
1 parent 5aeb972 commit 55476aa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion exporter/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ func NewRedisExporter(redisURI string, opts Options) (*Exporter, error) {
"db_keys_cached": {txt: "Total number of cached keys by DB", lbls: []string{"db"}},
"errors_total": {txt: `Total number of errors per error type`, lbls: []string{"err"}},
"exporter_last_scrape_error": {txt: "The last scrape error status.", lbls: []string{"err"}},
"instance_info": {txt: "Information about the Redis instance", lbls: []string{"role", "redis_version", "redis_build_id", "redis_mode", "os", "maxmemory_policy", "tcp_port", "run_id", "process_id"}},
"instance_info": {txt: "Information about the Redis instance", lbls: []string{"role", "redis_version", "redis_build_id", "redis_mode", "os", "maxmemory_policy", "tcp_port", "run_id", "process_id", "master_replid"}},
"key_group_count": {txt: `Count of keys in key group`, lbls: []string{"db", "key_group"}},
"key_group_memory_usage_bytes": {txt: `Total memory usage of key group in bytes`, lbls: []string{"db", "key_group"}},
"key_size": {txt: `The length or size of "key"`, lbls: []string{"db", "key"}},
Expand Down
5 changes: 4 additions & 1 deletion exporter/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,10 @@ func (e *Exporter) extractInfoMetrics(ch chan<- prometheus.Metric, info string,
keyValues["redis_mode"],
keyValues["os"],
keyValues["maxmemory_policy"],
keyValues["tcp_port"], keyValues["run_id"], keyValues["process_id"],
keyValues["tcp_port"],
keyValues["run_id"],
keyValues["process_id"],
keyValues["master_replid"],
)

if keyValues["role"] == "slave" {
Expand Down

0 comments on commit 55476aa

Please sign in to comment.