[SERVER-66018] Expose metrics for readPreference usage Created: 27/Apr/22  Updated: 14/Dec/23  Resolved: 15/Sep/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.2.0-rc0, 6.0.11, 7.0.3

Type: Task Priority: Major - P3
Reporter: Judah Schvimer Assignee: Ali Mir
Resolution: Fixed Votes: 1
Labels: auto-reverted, repl-shortlist
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Documented
is documented by DOCS-16384 [Server] Investigate changes in SERVE... Closed
Duplicate
is duplicated by SERVER-49806 Record read preference metrics in ser... Closed
Problem/Incident
Related
Assigned Teams:
Replication
Backwards Compatibility: Fully Compatible
Backport Requested:
v7.0, v6.0, v5.0
Sprint: Repl 2023-09-04, Repl 2023-09-18
Participants:
Linked BF Score: 159

 Description   

Goal / Product Question:

Our recommended topology is a replica set with three nodes for high availability. However, some customers are questioning the cost associated with running all three nodes, where they claim reads & writes only happen on their primary.

We offer the ability to redirect reads to a secondary node. We believe there is a population of customers who use secondary reads, but we never had a good way to identify them. Exposing a metric to identify if a secondary node has served reads will help identify these customers who specifically directed reads to a secondary node.

 

Must have: 

-Number of clusters with secondary reads

-Distribution of readPreference options (e.g. secondary, secondaryPreferred, primary)  

 

Nice to Have:

-Hedge Reads 

-Mirror Reads

-Number of clusters with reads with multiple read preferences



 Comments   
Comment by Githook User [ 21/Sep/23 ]

Author:

{'name': 'Ali Mir', 'email': 'ali.mir@mongodb.com', 'username': 'ali-mir'}

Message: SERVER-66018 Record metrics on readPreference usage

(cherry picked from commit e69f81ada7ecc5902bafa48bf112358fcc4df2ad)
Branch: v6.0
https://github.com/mongodb/mongo/commit/04b6c2d0bcc1358aab19b5fd6a969fc95b419735

Comment by Githook User [ 21/Sep/23 ]

Author:

{'name': 'Ali Mir', 'email': 'ali.mir@mongodb.com', 'username': 'ali-mir'}

Message: SERVER-66018 Create read preference metrics counters

(cherry picked from commit 95f8ff78f52cd48415f82d9ee87a96d73c7e3497)
Branch: v6.0
https://github.com/mongodb/mongo/commit/67c83724523c97a4905e65a90ca81b248476b8c9

Comment by Githook User [ 21/Sep/23 ]

Author:

{'name': 'Ali Mir', 'email': 'ali.mir@mongodb.com', 'username': 'ali-mir'}

Message: SERVER-66018 Create class skeleton for read preference metrics

(cherry picked from commit d12ede7c93c8c770f3f7d0a862fa1a2627412b92)
Branch: v6.0
https://github.com/mongodb/mongo/commit/98c874f632dcdaabd046bbd93ecbf76b7d38ed87

Comment by Githook User [ 21/Sep/23 ]

Author:

{'name': 'Ali Mir', 'email': 'ali.mir@mongodb.com', 'username': 'ali-mir'}

Message: SERVER-66018 Record metrics on readPreference usage

(cherry picked from commit e69f81ada7ecc5902bafa48bf112358fcc4df2ad)
Branch: v7.0
https://github.com/mongodb/mongo/commit/e1db0aeed09e91ee91932cb11c0b36b8058e4849

Comment by Githook User [ 21/Sep/23 ]

Author:

{'name': 'Ali Mir', 'email': 'ali.mir@mongodb.com', 'username': 'ali-mir'}

Message: SERVER-66018 Create read preference metrics counters

(cherry picked from commit 95f8ff78f52cd48415f82d9ee87a96d73c7e3497)
Branch: v7.0
https://github.com/mongodb/mongo/commit/afd850e6078fea41b07359ca7feb9480a1a70556

Comment by Githook User [ 21/Sep/23 ]

Author:

{'name': 'Ali Mir', 'email': 'ali.mir@mongodb.com', 'username': 'ali-mir'}

Message: SERVER-66018 Create class skeleton for read preference metrics

(cherry picked from commit d12ede7c93c8c770f3f7d0a862fa1a2627412b92)
Branch: v7.0
https://github.com/mongodb/mongo/commit/c60e210aeb699d4bad07c1c37b593ec792f711ca

Comment by Githook User [ 15/Sep/23 ]

Author:

{'name': 'Ali Mir', 'email': 'ali.mir@mongodb.com', 'username': 'ali-mir'}

Message: SERVER-66018 Record metrics on readPreference usage
Branch: master
https://github.com/mongodb/mongo/commit/e69f81ada7ecc5902bafa48bf112358fcc4df2ad

Comment by Githook User [ 07/Sep/23 ]

Author:

{'name': 'Ali Mir', 'email': 'ali.mir@mongodb.com', 'username': 'ali-mir'}

Message: SERVER-66018 Create read preference metrics counters
Branch: master
https://github.com/mongodb/mongo/commit/95f8ff78f52cd48415f82d9ee87a96d73c7e3497

Comment by xgen-buildbaron-user [ 07/Sep/23 ]

Ticket re-opened due to revert. noPassthrough began a consistent failure of jstests\noPassthrough\read_preference_metrics.js

Comment by Githook User [ 07/Sep/23 ]

Author:

{'name': 'auto-revert-processor', 'email': 'dev-prod-dag@mongodb.com', 'username': ''}

Message: Revert "SERVER-66018 Create read preference metrics counters"

This reverts commit 3226ff88ab0c7b23ff03c6dbaf88f2a825914138.
Branch: master
https://github.com/mongodb/mongo/commit/d6823c4432538ca76bf25a6a86e8c3b9c5dd911a

Comment by Githook User [ 06/Sep/23 ]

Author:

{'name': 'Ali Mir', 'email': 'ali.mir@mongodb.com', 'username': 'ali-mir'}

Message: SERVER-66018 Create read preference metrics counters
Branch: master
https://github.com/mongodb/mongo/commit/3226ff88ab0c7b23ff03c6dbaf88f2a825914138

Comment by Githook User [ 24/Aug/23 ]

Author:

{'name': 'Ali Mir', 'email': 'ali.mir@mongodb.com', 'username': 'ali-mir'}

Message: SERVER-66018 Create class skeleton for read preference metrics
Branch: master
https://github.com/mongodb/mongo/commit/d12ede7c93c8c770f3f7d0a862fa1a2627412b92

Comment by Ali Mir [ 22/Aug/23 ]

Looks like we already have some metrics around mirrored reads and hedged reads in serverStatus. jason.chan@mongodb.com alan.zheng@mongodb.com are these metrics sufficient or are there additions I can make in this ticket?

Comment by Jason Chan [ 08/Aug/23 ]

Would it be possible to also get metrics on how many people are enabling hedged reads as part of their read preference?

Generated at Thu Feb 08 06:04:15 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.