From 47b1ee6e6f55cf192be439347b5cdc31b5ccf59a Mon Sep 17 00:00:00 2001 From: Khor Shu Heng <32997938+khorshuheng@users.noreply.github.com> Date: Wed, 3 Apr 2024 16:33:44 +0800 Subject: [PATCH] bug: Add missing request timestamp for mlobs logger (#568) # Description The current mlobs logger does not populate the request timestamp, which result in error when writing to the sink. # Modifications # Tests # Checklist - [ ] Added PR label - [ ] Added unit test, integration, and/or e2e tests - [ ] Tested locally - [ ] Updated documentation - [ ] Update Swagger spec if the PR introduce API changes - [ ] Regenerated Golang and Python client if the PR introduces API changes # Release Notes ```release-note ``` --- api/pkg/inference-logger/logger/mlobs_sink.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/pkg/inference-logger/logger/mlobs_sink.go b/api/pkg/inference-logger/logger/mlobs_sink.go index ccada2b26..6cdf06d5b 100644 --- a/api/pkg/inference-logger/logger/mlobs_sink.go +++ b/api/pkg/inference-logger/logger/mlobs_sink.go @@ -6,6 +6,8 @@ import ( "errors" "fmt" + "google.golang.org/protobuf/types/known/timestamppb" + upiv1 "github.com/caraml-dev/universal-prediction-interface/gen/go/grpc/caraml/upi/v1" "github.com/confluentinc/confluent-kafka-go/v2/kafka" "go.uber.org/zap" @@ -70,6 +72,7 @@ func NewMLObsSink( func (m *MLObsSink) newPredictionLog(rawLogEntry *LogEntry) (*upiv1.PredictionLog, error) { predictionLog := &upiv1.PredictionLog{} + predictionLog.RequestTimestamp = timestamppb.Now() standardModelRequest := &StandardModelRequest{} err := json.Unmarshal(rawLogEntry.RequestPayload.Body, standardModelRequest) if err != nil {