Skip to content

Commit

Permalink
feat: Testing custom agent check on stage
Browse files Browse the repository at this point in the history
  • Loading branch information
MushtaqRossier committed Aug 12, 2024
1 parent 5fb5c9d commit 006012d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion commerce_coordinator/apps/commercetools/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,21 @@
fulfill_order_sanctioned_message_signal
)
from commerce_coordinator.apps.core.views import SingleInvocationAPIView
from datadog_checks import AgentCheck

logger = logging.getLogger(__name__)


# noinspection DuplicatedCode
class OrderFulfillView(SingleInvocationAPIView):
class OrderFulfillView(SingleInvocationAPIView, AgentCheck):
"""Order Fulfillment View"""

authentication_classes = [JwtBearerAuthentication, SessionAuthentication]
permission_classes = [IsAdminUser]

def check(self, instance):
self.gauge("hello.world", 1)

def post(self, request):
"""Receive a message from commerce tools forwarded by aws event bridge"""

Expand Down Expand Up @@ -64,6 +68,8 @@ def post(self, request):
message_id=message_id
)

self.check()

return Response(status=status.HTTP_200_OK)


Expand Down

0 comments on commit 006012d

Please sign in to comment.