Skip to content

Commit b3a0036

Browse files
authored
Add emitted timestamp for logging (#450)
* add timestamp * change to utc
1 parent 31c7c5a commit b3a0036

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

model-engine/model_engine_server/inference/post_inference_hooks.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import json
22
from abc import ABC, abstractmethod
3+
from datetime import datetime
34
from typing import Any, Dict, List, Optional, Union
45

6+
import pytz
57
import requests
68
from fastapi.responses import JSONResponse
79
from model_engine_server.common.constants import (
@@ -122,6 +124,7 @@ def handle(
122124
return
123125
response["task_id"] = task_id
124126
data_record = {
127+
"EMITTED_AT": datetime.now(pytz.timezone("UTC")).strftime("%Y-%m-%dT%H:%M:%S"),
125128
"REQUEST_BODY": request_payload.json(),
126129
"RESPONSE_BODY": response,
127130
"ENDPOINT_ID": self._endpoint_id,

0 commit comments

Comments
 (0)