Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5718 +/- ##
=======================================
Coverage 61.46% 61.47%
=======================================
Files 314 314
Lines 11354 11358 +4
Branches 789 808 +19
=======================================
+ Hits 6979 6982 +3
- Misses 4375 4376 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| } | ||
|
|
||
| private def saveJsonFile(resourceId: ResourceId, value: Object): Unit = { | ||
| private def saveJsonFile(resourceId: => ResourceId, path: String, value: Object): Unit = { |
There was a problem hiding this comment.
hmm, where is path getting used in this method outside of the logging? can we just log the resourceID directly?
There was a problem hiding this comment.
the problem is that creation of resourceId can fail if bucket does not exist
There was a problem hiding this comment.
I think that's ok; if we do:
logger.info(f"Saved metrics to '$resourceId'")
} catch {
case e: Throwable =>
logger.warn(
f"Failed to save metrics: ${mapper.writeValueAsString(value)}",
e
)in the success case, the resourceID exists so it's safe to log, and in the failure case, the error msg would include the path anyway, right?
There was a problem hiding this comment.
actually I re-tested it and resourceID is safely created even if bucket does not exist! So I have updated the code and replaced path with resourceId!
| } | ||
|
|
||
| private def saveJsonFile(resourceId: ResourceId, value: Object): Unit = { | ||
| private def saveJsonFile(resourceId: => ResourceId, path: String, value: Object): Unit = { |
There was a problem hiding this comment.
I think that's ok; if we do:
logger.info(f"Saved metrics to '$resourceId'")
} catch {
case e: Throwable =>
logger.warn(
f"Failed to save metrics: ${mapper.writeValueAsString(value)}",
e
)in the success case, the resourceID exists so it's safe to log, and in the failure case, the error msg would include the path anyway, right?
Co-authored-by: Claire McGinty <clairem@spotify.com>
No description provided.