Skip to content

Commit 45380e3

Browse files
committed
Don't update API metrics on non-POST requests
(cherry picked from commit f1bc223)
1 parent 9af5fa0 commit 45380e3

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

pkg/workloads/cortex/onnx_serve/api.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ def after_request(response):
7474
api = local_cache["api"]
7575
ctx = local_cache["ctx"]
7676

77-
if request.path != "/{}/{}".format(ctx.app["name"], api["name"]):
77+
if not (
78+
request.path == "/{}/{}".format(ctx.app["name"], api["name"]) and request.method == "POST"
79+
):
7880
return response
7981

8082
logger.info(response.status)

pkg/workloads/cortex/tf_api/api.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ def after_request(response):
101101
api = local_cache["api"]
102102
ctx = local_cache["ctx"]
103103

104-
if request.path != "/{}/{}".format(ctx.app["name"], api["name"]):
104+
if not (
105+
request.path == "/{}/{}".format(ctx.app["name"], api["name"]) and request.method == "POST"
106+
):
105107
return response
106108

107109
logger.info(response.status)

0 commit comments

Comments
 (0)