Skip to content

Commit

Permalink
Log warning only when there is an error in SA size validation (#3443)
Browse files Browse the repository at this point in the history
Log error only when there is an error in SA size validation
  • Loading branch information
rodrigozhou authored and dnr committed Sep 29, 2022
1 parent 70ca71b commit f84be21
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions service/history/commandChecker.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,18 @@ func (c *workflowSizeChecker) checkIfSearchAttributesSizeExceedsLimit(
namespace namespace.Name,
commandTypeTag metrics.Tag,
) error {
c.metricsScope.Tagged(commandTypeTag).RecordDistribution(metrics.SearchAttributesSize, searchAttributes.Size())

c.metricsScope.Tagged(commandTypeTag).RecordDistribution(
metrics.SearchAttributesSize,
searchAttributes.Size(),
)
err := c.searchAttributesValidator.ValidateSize(searchAttributes, namespace.String())
c.logger.Warn("Search attributes size exceeds limits. Fail workflow.", tag.Error(err), tag.WorkflowNamespace(namespace.String()))

if err != nil {
c.logger.Warn(
"Search attributes size exceeds limits. Fail workflow.",
tag.Error(err),
tag.WorkflowNamespace(namespace.String()),
)
}
return err
}

Expand Down

0 comments on commit f84be21

Please sign in to comment.