129
}
130
131
>
pageToken.PersistenceToken = rawHistoryResponse.NextPageToken
api.go
132
>
size := rawHistoryResponse.Size
133
>
metricsHandler := interceptor.GetMetricsHandlerFromContext(ctx, shardContext.GetLogger()).WithTags(metrics.OperationTag(metrics.HistoryGetWorkflowExecutionRawHistoryV2Scope))
134
>
metrics.HistorySize.With(metricsHandler).Record(
135
>
int64(size),
136
>
metrics.NamespaceTag(ns.Name().String()),
137
>
metrics.OperationTag(metrics.AdminGetWorkflowExecutionRawHistoryV2Scope),
138
>
)
139
>
140
>
// Ensure all raw history is proto3 encoded since data may be stored in other formats during testing.
141
>
// In production (proto3 encoding), this returns the input unchanged.
142
>
historyBlobs, err := serialization.ReencodeEventBlobsAsProto3(shardContext.GetPayloadSerializer(), rawHistoryResponse.HistoryEventBlobs)
143
>
if err != nil {
144
return nil, err
145
}
146
148
>
&adminservice.GetWorkflowExecutionRawHistoryV2Response{
149
>
HistoryBatches: historyBlobs,
150
>
VersionHistory: targetVersionHistory,
151
>
HistoryNodeIds: rawHistoryResponse.NodeIDs,
152
>
}
153
>
if len(pageToken.PersistenceToken) == 0 {
154
>
result.NextPageToken = nil
155
>
} else {
156
result.NextPageToken, err = api.SerializeRawHistoryToken(pageToken)
157
if err != nil {