views.py 291 B

12345678910
  1. from django_prometheus import exports
  2. from rest_framework.permissions import IsAdminUser
  3. from rest_framework.views import APIView
  4. class DjangoPrometheusMetrics(APIView):
  5. permission_classes = [IsAdminUser]
  6. def get(self, request):
  7. return exports.ExportToDjangoView(request)