views.py 323 B

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