@@ -66,6 +66,7 @@ type Opts struct {
66
66
EnableDBStatsFreeStorage bool
67
67
EnableDiagnosticData bool
68
68
EnableReplicasetStatus bool
69
+ EnableServerStatus bool
69
70
EnableCurrentopMetrics bool
70
71
EnableTopMetrics bool
71
72
EnableIndexStats bool
@@ -172,6 +173,7 @@ func (e *Exporter) makeRegistry(ctx context.Context, client *mongo.Client, topol
172
173
e .opts .EnableCollStats = true
173
174
e .opts .EnableTopMetrics = true
174
175
e .opts .EnableReplicasetStatus = true
176
+ e .opts .EnableServerStatus = true
175
177
e .opts .EnableIndexStats = true
176
178
e .opts .EnableCurrentopMetrics = true
177
179
e .opts .EnableProfile = true
@@ -242,6 +244,12 @@ func (e *Exporter) makeRegistry(ctx context.Context, client *mongo.Client, topol
242
244
registry .MustRegister (rsgsc )
243
245
}
244
246
247
+ if e .opts .EnableServerStatus {
248
+ ssc := newServerStatusCollector (ctx , client , e .opts .Logger ,
249
+ e .opts .CompatibleMode , topologyInfo )
250
+ registry .MustRegister (ssc )
251
+ }
252
+
245
253
return registry
246
254
}
247
255
@@ -303,6 +311,8 @@ func (e *Exporter) Handler() http.Handler {
303
311
requestOpts .EnableDiagnosticData = true
304
312
case "replicasetstatus" :
305
313
requestOpts .EnableReplicasetStatus = true
314
+ case "serverstatus" :
315
+ requestOpts .EnableServerStatus = true
306
316
case "dbstats" :
307
317
requestOpts .EnableDBStats = true
308
318
case "topmetrics" :
0 commit comments