Skip to content
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

Merged
merged 9 commits into from
Dec 31, 2024

Conversation

bdach
Copy link
Contributor

@bdach bdach commented Dec 25, 2024

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.

@bdach bdach self-assigned this Dec 25, 2024
@peppy peppy self-requested a review December 30, 2024 13:43
Copy link
Member

@peppy peppy left a 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),
Copy link
Member

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.

Copy link
Contributor Author

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

Copy link
Member

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.

Copy link
Contributor Author

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 🤷

Copy link
Member

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.

@peppy peppy merged commit 74871ae into ppy:master Dec 31, 2024
4 checks passed
@bdach bdach deleted the observability branch December 31, 2024 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants