fix: Increment S3 Request Count on Success #1026
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We were previously incrementing S3 request count in all cases. However, this was misleading as the metrics indicated a significantly higher amount of requests than expected, and the metric was being used as a proxy for cost of the service. Research indicated that many requests were in fact failing due to a dispatch error, shown below.
GetObjectBytesError(DispatchFailure(DispatchFailure { source: ConnectorError { kind: Io, source: hyper::Error(Connect, ConnectError("dns error", Custom { kind: Uncategorized, error: "failed to lookup address information: nodename nor servname provided, or not known" })), connection: Unknown } }))
In order to more accurately gauge actual S3 usage by the service, I've changed the increment counter to occur below the S3 get request, so that only successful requests get counted. However, it was observed that this metric is somehow still inaccurate, reporting an inconsistent number compared to the actual requests made, which were verified through cache size and logs. Regardless, this should still be an improvement to the metric.