Skip to content

Conversation

@diydriller
Copy link

@diydriller diydriller commented Jan 8, 2026

New Metrics

  1. sentinel_master_config_epoch: The configuration epoch of the master (increments on each failover)

    • Extracted from SENTINEL MASTERS command response
    • Labels: master_name, master_address
    • Use case: Track failover events and frequency
  2. sentinel_master_last_ok_ping_reply_ms: Elapsed time in milliseconds since the last successful ping reply

    • Extracted from SENTINEL MASTERS command response
    • Labels: master_name, master_address
    • Use case: Monitor master health and detect potential down states proactively

Changes

  • Added config-epoch field extraction in extractSentinelMetrics() function
  • Added last-ok-ping-reply field extraction in extractSentinelMetrics() function
  • Added metric descriptions in exporter.go

closes: #1077

@oliver006
Copy link
Owner

Thanks for the PR!

"sentinel_master_setting_failover_timeout": {txt: "Show the current failover-timeout config for each master", lbls: []string{"master_name", "master_address"}},
"sentinel_master_setting_parallel_syncs": {txt: "Show the current parallel-syncs config for each master", lbls: []string{"master_name", "master_address"}},
"sentinel_master_config_epoch": {txt: "The configuration epoch of the master (increments on each failover)", lbls: []string{"master_name", "master_address"}},
"sentinel_master_last_ok_ping_reply_ms": {txt: "Elapsed time in milliseconds since the last successful ping reply from the master", lbls: []string{"master_name", "master_address"}},
Copy link
Owner

Choose a reason for hiding this comment

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

sentinel_master_last_ok_ping_reply_ms

base unit should be seconds - can you convert?

Copy link
Author

Choose a reason for hiding this comment

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

@oliver006
I have a question, doesn't the existing sentinel_master_setting_down_after_milliseconds use milliseconds instead of seconds?

Copy link
Owner

Choose a reason for hiding this comment

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

Yeah, they both should probably use _seconds

Copy link
Author

Choose a reason for hiding this comment

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

For now I only converted the units of the metrics I added

@codecov
Copy link

codecov bot commented Jan 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.90%. Comparing base (0e921f7) to head (113f628).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1078      +/-   ##
==========================================
+ Coverage   81.85%   81.90%   +0.04%     
==========================================
  Files          20       20              
  Lines        2657     2663       +6     
==========================================
+ Hits         2175     2181       +6     
  Misses        362      362              
  Partials      120      120              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 20811912693

Details

  • 6 of 6 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.03%) to 85.696%

Totals Coverage Status
Change from base Build 20400308272: 0.03%
Covered Lines: 2750
Relevant Lines: 3209

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Sentinel metrics to improve failover detection and monitoring capabilities

3 participants