@@ -65,6 +65,7 @@ type Opts struct {
65
65
EnableDBStats bool
66
66
EnableDiagnosticData bool
67
67
EnableReplicasetStatus bool
68
+ EnableServerStatus bool
68
69
EnableTopMetrics bool
69
70
EnableIndexStats bool
70
71
EnableCollStats bool
@@ -158,6 +159,7 @@ func (e *Exporter) makeRegistry(ctx context.Context, client *mongo.Client, topol
158
159
e .opts .EnableCollStats = true
159
160
e .opts .EnableTopMetrics = true
160
161
e .opts .EnableReplicasetStatus = true
162
+ e .opts .EnableServerStatus = true
161
163
e .opts .EnableIndexStats = true
162
164
}
163
165
@@ -202,6 +204,12 @@ func (e *Exporter) makeRegistry(ctx context.Context, client *mongo.Client, topol
202
204
registry .MustRegister (rsgsc )
203
205
}
204
206
207
+ if e .opts .EnableServerStatus {
208
+ ssc := newServerStatusCollector (ctx , client , e .opts .Logger ,
209
+ e .opts .CompatibleMode , topologyInfo )
210
+ registry .MustRegister (ssc )
211
+ }
212
+
205
213
return registry
206
214
}
207
215
@@ -263,6 +271,8 @@ func (e *Exporter) Handler() http.Handler {
263
271
requestOpts .EnableDiagnosticData = true
264
272
case "replicasetstatus" :
265
273
requestOpts .EnableReplicasetStatus = true
274
+ case "serverstatus" :
275
+ requestOpts .EnableServerStatus = true
266
276
case "dbstats" :
267
277
requestOpts .EnableDBStats = true
268
278
case "topmetrics" :
0 commit comments