Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add label master_replid to metricinstance_info #924

Merged
merged 1 commit into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion exporter/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,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"],
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

keyValues["process_id"],
keyValues["master_replid"],
)

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