def test_prometheus(self, request):
"""Increment prometheus metric for testing"""
if not pkg_is_installed('prometheus-client'):
return Response('Not Supported', status=501)
if not hasattr(self, 'test_counter'):
import prometheus_client
self.test_counter = prometheus_client.Counter('test', 'test')
self.test_counter.inc()
return Response('Incremented test counter')
评论列表
文章目录