26
26
import os
27
27
import errno
28
28
import logging
29
+ import analytics
30
+
29
31
from logging import handlers
30
32
from queryHandler .QueryHandler import PerfmonConnError
31
33
from queryHandler import SensorConfig
38
40
from prometheus import PrometheusExporter
39
41
from watcher import ConfigWatcher
40
42
from cherrypy import _cperror
43
+ from cherrypy .lib .cpstats import StatsPage
41
44
42
45
ENDPOINTS = {}
43
46
@@ -114,6 +117,7 @@ def bind_opentsdb_server(args):
114
117
opentsdb_server .ssl_module = 'builtin'
115
118
opentsdb_server .ssl_certificate = certPath
116
119
opentsdb_server .ssl_private_key = keyPath
120
+ opentsdb_server .statistics = analytics .cherrypy_internal_stats
117
121
opentsdb_server .subscribe ()
118
122
119
123
@@ -126,6 +130,7 @@ def bind_prometheus_server(args):
126
130
prometheus_server .ssl_module = 'builtin'
127
131
prometheus_server .ssl_certificate = certPath
128
132
prometheus_server .ssl_private_key = keyPath
133
+ prometheus_server .statistics = analytics .cherrypy_internal_stats
129
134
prometheus_server .subscribe ()
130
135
131
136
@@ -278,7 +283,6 @@ def main(argv):
278
283
{'request.dispatch' : cherrypy .dispatch .MethodDispatcher ()}
279
284
}
280
285
)
281
-
282
286
registered_apps .append ("OpenTSDB Api listening on Grafana queries" )
283
287
284
288
if args .get ('prometheus' , None ):
@@ -317,6 +321,7 @@ def main(argv):
317
321
}
318
322
)
319
323
registered_apps .append ("Prometheus Exporter Api listening on Prometheus requests" )
324
+ cherrypy .tree .mount (StatsPage (), '/cherrypy_internal_stats' )
320
325
321
326
logger .info ("%s" , MSG ['sysStart' ].format (sys .version , cherrypy .__version__ ))
322
327
0 commit comments