@@ -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
@@ -168,6 +169,7 @@ func (e *Exporter) makeRegistry(ctx context.Context, client *mongo.Client, topol
168
169
e .opts .EnableCollStats = true
169
170
e .opts .EnableTopMetrics = true
170
171
e .opts .EnableReplicasetStatus = true
172
+ e .opts .EnableServerStatus = true
171
173
e .opts .EnableIndexStats = true
172
174
}
173
175
@@ -221,6 +223,12 @@ func (e *Exporter) makeRegistry(ctx context.Context, client *mongo.Client, topol
221
223
registry .MustRegister (rsgsc )
222
224
}
223
225
226
+ if e .opts .EnableServerStatus {
227
+ ssc := newServerStatusCollector (ctx , client , e .opts .Logger ,
228
+ e .opts .CompatibleMode , topologyInfo )
229
+ registry .MustRegister (ssc )
230
+ }
231
+
224
232
return registry
225
233
}
226
234
@@ -282,6 +290,8 @@ func (e *Exporter) Handler() http.Handler {
282
290
requestOpts .EnableDiagnosticData = true
283
291
case "replicasetstatus" :
284
292
requestOpts .EnableReplicasetStatus = true
293
+ case "serverstatus" :
294
+ requestOpts .EnableServerStatus = true
285
295
case "dbstats" :
286
296
requestOpts .EnableDBStats = true
287
297
case "topmetrics" :
0 commit comments