-
Notifications
You must be signed in to change notification settings - Fork 3
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
Improve observability by integrating sentry, datadog, and adding extended logging #15
Conversation
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.
Looks pretty good apart from kinda unrelated syntax thing.
@@ -60,13 +62,15 @@ public async Task StoreBeatmapSetAsync(uint beatmapSetId, byte[] beatmapPackage, | |||
|
|||
await Task.WhenAll([ | |||
uploadBeatmapPackage(beatmapSetId, beatmapPackage, stream), | |||
..uploadAllVersionedFiles(allFiles), | |||
..uploadAllBeatmapFiles(beatmapFiles) | |||
..uploadAllVersionedFiles(beatmapSetId, allFiles), |
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 know I already let this syntax in (by oversight) but I am not sure I can get used to this. It's quite non-obvious what this is doing.
diff --git a/osu.Server.BeatmapSubmission/Services/S3BeatmapStorage.cs b/osu.Server.BeatmapSubmission/Services/S3BeatmapStorage.cs
index f78441b..cbce08e 100644
--- a/osu.Server.BeatmapSubmission/Services/S3BeatmapStorage.cs
+++ b/osu.Server.BeatmapSubmission/Services/S3BeatmapStorage.cs
@@ -60,11 +60,10 @@ namespace osu.Server.BeatmapSubmission.Services
beatmapFiles.Add((beatmapId, contents));
}
- await Task.WhenAll([
- uploadBeatmapPackage(beatmapSetId, beatmapPackage, stream),
- ..uploadAllVersionedFiles(beatmapSetId, allFiles),
- ..uploadAllBeatmapFiles(beatmapSetId, beatmapFiles)
- ]);
+ await uploadBeatmapPackage(beatmapSetId, beatmapPackage, stream);
+ await Task.WhenAll(uploadAllVersionedFiles(beatmapSetId, allFiles));
+ await Task.WhenAll(uploadAllBeatmapFiles(beatmapSetId, beatmapFiles));
+
logger.LogInformation("All file uploads for beatmapset {beatmapSetId} concluded successfully.", beatmapSetId);
}
@@ -165,7 +164,8 @@ namespace osu.Server.BeatmapSubmission.Services
{
foreach (var file in files)
{
- using var response = await client.GetObjectAsync(AppSettings.S3CentralBucketName, getPathToVersionedFile(BitConverter.ToString(file.File.sha2_hash).Replace("-", string.Empty).ToLowerInvariant()));
+ using var response = await client.GetObjectAsync(AppSettings.S3CentralBucketName,
+ getPathToVersionedFile(BitConverter.ToString(file.File.sha2_hash).Replace("-", string.Empty).ToLowerInvariant()));
zipWriter.Write(file.VersionFile.filename, response.ResponseStream);
}
}
is probably what i'd stick with.
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.
Replaced with slightly different functional equivalent in 684247d
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'd still just use multiple awaits for better readability, but I'm not going to get hung up on it.
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 sort of explicitly didn't want to do multiple awaits, as that reduces concurrency 🤷
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.
Fair, I wasn't considering that part.
Not much interaction with datadog here other than incrementing a counter for uploads similar to old BSS. If you have ideas what would be nice to see there I'm all ears.