-
Notifications
You must be signed in to change notification settings - Fork 805
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add metric when history replication message is too large #6558
Add metric when history replication message is too large #6558
Conversation
service/history/handler/handler.go
Outdated
@@ -1601,6 +1601,9 @@ func (h *handlerImpl) GetReplicationMessages( | |||
|
|||
size := proto.FromReplicationMessages(tasks).Size() | |||
if (responseSize + size) >= maxResponseSize { | |||
metricsScope := h.GetMetricsClient().Scope(metrics.ReplicationMessageTooLargeScope, metrics.ShardIDTag(int(shardID))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's reuse the metric scope returned in line 1558 with shard id tag included
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed. I only added the shard tag inside of that if statement.
Codecov ReportAll modified and coverable lines are covered by tests ✅
... and 6 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
service/history/handler/handler.go
Outdated
@@ -1601,6 +1601,9 @@ func (h *handlerImpl) GetReplicationMessages( | |||
|
|||
size := proto.FromReplicationMessages(tasks).Size() | |||
if (responseSize + size) >= maxResponseSize { | |||
metricsScope.Tagged(metrics.ShardIDTag(int(shardID))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be better to have a gauge metric instead of counter which would have value responseSize + size
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about that but:
- Our purpose was to make an alert that can catch things when there are a lot of "replication message too large" warnings, so I think adding a counter could be a more straightforward way.
- The maxResponseSize is not a fixed value, so that it would be harder to find a threshold to trigger the alert.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. If we are more interested in the number of occurrences then counter makes sense.
What changed?
Add metric when history replication message is too large
Why?
to catch a previous on-call issue
How did you test it?
Potential risks
Release notes
Documentation Changes