[SERVER-63254] Add Index usage metrics to serverStatus Created: 03/Feb/22  Updated: 29/Oct/23  Resolved: 31/Mar/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.3.2, 6.0.0-rc0, 5.0.9

Type: Task Priority: Major - P3
Reporter: Michael Gargiulo Assignee: Louis Williams
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Related
Backwards Compatibility: Fully Compatible
Backport Requested:
v5.3, v5.0
Sprint: Execution Team 2022-02-21, Execution Team 2022-04-04
Participants:

 Description   

Summary

Define and add new metrics to serverStatus in order to better track index usage.

Motivation

In order to make more informed Product decisions and expand the data we consume to better support customers feature requests and issue triage we need to continue to build out better telemetry around usage. By adding metrics to track index usage and behavior we will be able to not only measure the success of features and inits, but better understand how to develop and prioritize new features related to indexing and improve diagnostic capability. 

Additional details in comments



 Comments   
Comment by Githook User [ 20/Apr/22 ]

Author:

{'name': 'Louis Williams', 'email': 'louis.williams@mongodb.com', 'username': 'louiswilliams'}

Message: SERVER-63254 Add index feature usage stats to serverStatus

(cherry picked from commit 0fa0170045ccab649621111ec86c80e798bcac23)
(cherry picked from commit 45def0471022bb6e7a56acb354e35817211a25d8)
Branch: v5.0
https://github.com/mongodb/mongo/commit/5c4ea8bae7c97955962fa4f825a0ed9ce00d77ed

Comment by Githook User [ 20/Apr/22 ]

Author:

{'name': 'Louis Williams', 'email': 'louis.williams@mongodb.com', 'username': 'louiswilliams'}

Message: SERVER-63254 Add index feature usage stats to serverStatus

(cherry picked from commit 0fa0170045ccab649621111ec86c80e798bcac23)
Branch: v5.3
https://github.com/mongodb/mongo/commit/45def0471022bb6e7a56acb354e35817211a25d8

Comment by Louis Williams [ 14/Apr/22 ]

colby.ing@mongodb.com, no this does not include hidden indexes. I believe it was just overlooked during the implementation. Do you want us to expose this? If so, can you please file a ticket?

Comment by Colby Ing [ 13/Apr/22 ]

louis.williams@mongodb.com does this also record counts for hidden indexes? 

Comment by Louis Williams [ 29/Mar/22 ]

We have added an "indexStats" section to serverStatus. The results are formatted as such:

{
// Reports statistics about all indexes on non-internal databases and collections.
"indexStats": {
  "count": <> // Number of indexes 
    "2d": {
      "count": <> // Total number of indexes with this feature
      "accesses" <> // Total number of accesses on indexes with this feature
    },
    "2dsphere": ...,
    "2dsphere_bucket": ...,
    "collation": ...,
    "compound": ...,
    "hashed": ...,
    "id": ...,
    "normal": ...,
    "partial": ...,
    "single": ...,
    "sparse": ...,
    "text": ...,
    "ttl": ...,
    "unique": ..., // Note that these counters will not include the _id index
    "wildcard": ...
  }
}

Comment by Githook User [ 29/Mar/22 ]

Author:

{'name': 'Louis Williams', 'email': 'louis.williams@mongodb.com', 'username': 'louiswilliams'}

Message: SERVER-63254 Add index feature usage stats to serverStatus
Branch: master
https://github.com/mongodb/mongo/commit/0fa0170045ccab649621111ec86c80e798bcac23

Generated at Thu Feb 08 05:57:17 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.