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

Enable Automatic Heap Dumps on the Server #211

Merged
merged 1 commit into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@ RUN ls -lah ./server/
WORKDIR /app/server/src/SymbolCollector.Server/
RUN dotnet publish -c Release -o ../../out

FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS runtime
# GCB changes the path to /workspace. If changing the path here, accuont for GCB
WORKDIR /app
COPY --from=builder /app/server/out ./

# Install dotnet-gcdump globally
RUN dotnet tool install --global dotnet-gcdump

ENTRYPOINT ["dotnet", "SymbolCollector.Server.dll"]
4 changes: 4 additions & 0 deletions src/SymbolCollector.Server/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ private static IHostBuilder CreateHostBuilder(string[] args) =>

return @event;
});

#pragma warning disable SENTRY0001
o.EnableHeapDumps(90, Debouncer.PerDay(3, TimeSpan.FromHours(3)));
#pragma warning restore SENTRY0001
});
webBuilder.UseStartup<Startup>();
});
Expand Down
Loading