Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion proxy/adminservice.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"io"
"sync"
"time"

"go.temporal.io/api/serviceerror"
"go.temporal.io/server/api/adminservice/v1"
Expand Down Expand Up @@ -159,7 +160,17 @@ func (s *adminServiceProxyServer) GetWorkflowExecutionRawHistory(ctx context.Con
}

func (s *adminServiceProxyServer) GetWorkflowExecutionRawHistoryV2(ctx context.Context, in0 *adminservice.GetWorkflowExecutionRawHistoryV2Request) (*adminservice.GetWorkflowExecutionRawHistoryV2Response, error) {
return s.adminClient.GetWorkflowExecutionRawHistoryV2(ctx, in0)
start := time.Now()

resp, err := s.adminClient.GetWorkflowExecutionRawHistoryV2(ctx, in0)
if err != nil {
deadline, ok := ctx.Deadline()
s.logger.Warn(fmt.Sprintf("GetWorkflowExecutionRawHistoryV2 failed. is_deadline_set: %v, deadline: %v\n", ok, deadline),
tag.Timestamp(deadline), tag.Error(err),
tag.NewInt("duration_ms", int(time.Since(start).Milliseconds())))
}

return resp, err
}

func (s *adminServiceProxyServer) ImportWorkflowExecution(ctx context.Context, in0 *adminservice.ImportWorkflowExecutionRequest) (*adminservice.ImportWorkflowExecutionResponse, error) {
Expand Down
13 changes: 12 additions & 1 deletion proxy/workflowservice.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ package proxy

import (
"context"
"fmt"
"time"

"go.temporal.io/api/workflowservice/v1"
"go.temporal.io/server/common/log"
"go.temporal.io/server/common/log/tag"

"github.com/temporalio/s2s-proxy/auth"
"github.com/temporalio/s2s-proxy/client"
Expand Down Expand Up @@ -130,7 +133,15 @@ func (s *workflowServiceProxyServer) GetWorkerVersioningRules(ctx context.Contex
}

func (s *workflowServiceProxyServer) GetWorkflowExecutionHistory(ctx context.Context, in0 *workflowservice.GetWorkflowExecutionHistoryRequest) (*workflowservice.GetWorkflowExecutionHistoryResponse, error) {
return s.workflowServiceClient.GetWorkflowExecutionHistory(ctx, in0)
start := time.Now()

resp, err := s.workflowServiceClient.GetWorkflowExecutionHistory(ctx, in0)
deadline, ok := ctx.Deadline()
s.logger.Warn(fmt.Sprintf("GetWorkflowExecutionHistory called. is_deadline_set: %v, deadline: %v\n", ok, deadline),
tag.Timestamp(deadline), tag.Error(err),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to add the remaining deadline time here deadline - time.Now()

tag.NewInt("duration_ms", int(time.Since(start).Milliseconds())))

return resp, err
}

func (s *workflowServiceProxyServer) GetWorkflowExecutionHistoryReverse(ctx context.Context, in0 *workflowservice.GetWorkflowExecutionHistoryReverseRequest) (*workflowservice.GetWorkflowExecutionHistoryReverseResponse, error) {
Expand Down