/
SentryRegistry.java
26 lines (24 loc) · 1.06 KB
/
SentryRegistry.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package net.creeperhost.polylib.sentry;
import dev.architectury.platform.Platform;
import io.sentry.Sentry;
import io.sentry.SentryOptions;
import net.fabricmc.api.EnvType;
import net.minecraft.client.Minecraft;
public class SentryRegistry
{
public static Sentry.OptionsConfiguration<SentryOptions> registerSentryHandler(String dsn, String packagePath)
{
return options ->
{
options.setDsn(dsn);
options.setTracesSampleRate(Platform.isDevelopmentEnvironment() ? 1.0 : 0.025);
options.setEnvironment(Platform.getMinecraftVersion());
options.setTag("modloader", Minecraft.getInstance().getLaunchedVersion());
options.setTag("ram", String.valueOf(((Runtime.getRuntime().maxMemory() / 1024) / 1024)));
options.setDist(System.getProperty("os.arch"));
options.setServerName(Platform.getEnv() == EnvType.CLIENT ? "integrated" : "dedicated");
options.setDebug(Platform.isDevelopmentEnvironment());
options.addInAppInclude(packagePath);
};
}
}