Thread: Sentry Setup [Server & Client]

Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1 Sentry Setup [Server & Client] 
    Extreme Donator

    Mark.'s Avatar
    Join Date
    Jul 2020
    Posts
    122
    Thanks given
    90
    Thanks received
    118
    Discord
    View profile
    Rep Power
    289
    What is Sentry

    Sentry is a crash reporting platform that provides you with "real-time insight into production deployments with info to reproduce and fix crashes". It notifies you of exceptions or errors that your users run into while using your app, and organizes them for you on a web dashboard.

    Why add to a RSPS

    Simple reason to catch errors your players may fail to report to you. This will help you identify info that players may sometimes not send. And give you Info about what build it started, how many people it has crashed / shown for, and what Conditions.

    Example



    Step 1: Make an Account

    Go to: https://sentry.io/
    Follow the steps on the screen once you get to this page



    Take note of your dsn as this is important

    Carry on following the steps, once you have sent the first error to show its working, we can now move onto step 2

    Step 2: Prepping the Server and Client

    The first thing you want to make sure you have done is import the Library using your build system. In my case, its Gradle so it looks like this



    Go to your main method where your Server launches from and right at the top add the following

    Spoiler for Server:
    Code:
    Sentry.init(option -> {
    option.setDsn("https://[email protected]/5938402");
    option.setTracesSampleRate(1.0);
    option.setDebug(true);
    option.setEnvironment(System.getProperty("os.name"));
    option.setRelease("1.0");
    option.setTag("java",System.getProperty("java.version"));
    option.setTag("java-vender",System.getProperty("java.vendor") );
    option.setTag("server-state",Server.getState());
    });


    Spoiler for Client:
    Code:
    Sentry.init(option -> {
    option.setDsn("https://[email protected]/5938402");
    option.setTracesSampleRate(1.0);
    option.setDebug(true);
    option.setEnvironment(System.getProperty("os.name"));
    option.setRelease("1.0");
    User user = new User();
    user.setUsername(Client.loggedIn ? Client.instance.myUsername : "Unknown");
    Sentry.setUser(user);
    option.setTag("java",System.getProperty("java.version"));
    option.setTag("java-vender",System.getProperty("java.vendor") );
    option.setTag("client-state",Client.instance.gameState.toString());
    option.setTag("loggedin",String.valueOf(Client.loggedIn));
    option.setTag("username", Client.loggedIn ? Client.instance.myUsername : "Unknown");
    });


    Tags - Adding more

    Code:
    option.setTag(name,value);
    Within this you can add any extra info you want to send with your crash / error report


    Catching the Errors

    For this you will need some kind of Logging lib like SLF4J Once you have this on your project in Resources [EG: Client/src/main/resources/logback.xml] make a file called logback.xml.

    This is an example of my logback

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    
    <configuration scan="true">
      
    
        <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
            <encoder>
                <Pattern>%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %class{0} - %msg%n</Pattern>
            </encoder>
        </appender>
    
        <!-- Configure the Sentry appender, overriding the logging threshold to the WARN level -->
        <appender name="Sentry" class="io.sentry.logback.SentryAppender">
            <options>
                <!-- NOTE: Replace the test DSN below with YOUR OWN DSN to see the events from this app in your Sentry project/dashboard -->
                <dsn>https://[email protected]/0</dsn>
            </options>
            <minimumEventLevel>ERROR</minimumEventLevel>
            <minimumBreadcrumbLevel>DEBUG</minimumBreadcrumbLevel>
        </appender>
    
    
        <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
            <file>${user.home}/.client/logs/client.log</file>
    
            <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
                <!-- daily rollover -->
                <fileNamePattern>${user.home}/.client/logs/client_%d{yyyy-MM-dd}.%i.log</fileNamePattern>
                <maxFileSize>10MB</maxFileSize>
                <!-- keep 30 days' worth of history -->
                <maxHistory>30</maxHistory>
            </rollingPolicy>
    
            <encoder>
                <Pattern>%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %class{0} - %msg%n</Pattern>
            </encoder>
        </appender>
        <root level="ERROR">
            <appender-ref ref="Sentry" />
            <appender-ref ref="STDOUT"/>
            <appender-ref ref="FILE"/>
        </root>
        <root level="INFO">
            <appender-ref ref="STDOUT"/>
            <appender-ref ref="FILE"/>
        </root>
        <root level="DEBUG">
            <appender-ref ref="STDOUT"/>
            <appender-ref ref="FILE"/>
        </root>
    </configuration>
    Feel free to edit these to what will suit you the best.

    Explore


    That's it Sentry is now setup to see more Options that Sentry have please check

    https://getsentry.github.io/sentry-j...ryOptions.html


    Quote Originally Posted by Jay Gatsby View Post
    For reference, you can get a paid Sentry account with the GitHub student package which some users might have access to
    Reply With Quote  
     


  2. #2  
    Bossman

    ISAI's Avatar
    Join Date
    Sep 2012
    Posts
    1,839
    Thanks given
    606
    Thanks received
    1,023
    Discord
    View profile
    Rep Power
    5000
    Holy shit, someone on R-S recommending something good? Nice work man, good guide.
    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    NONCHALANT

    Lynch's Avatar
    Join Date
    Feb 2016
    Age
    23
    Posts
    213
    Thanks given
    35
    Thanks received
    267
    Discord
    View profile
    Rep Power
    2984
    looks solid, good job.
    by George
    Spoiler for Grian:
    Reply With Quote  
     

  5. Thankful user:


  6. #4  
    https://slumbridge.com


    Jay Gatsby's Avatar
    Join Date
    Jun 2010
    Posts
    2,292
    Thanks given
    1,124
    Thanks received
    1,909
    Discord
    View profile
    Rep Power
    5000
    Nice job, good to see more people utilizing these sort of tools.

    For reference, you can get a paid Sentry account with the GitHub student package which some users might have access to
    Reply With Quote  
     

  7. #5  
    Extreme Donator

    Mark.'s Avatar
    Join Date
    Jul 2020
    Posts
    122
    Thanks given
    90
    Thanks received
    118
    Discord
    View profile
    Rep Power
    289
    Quote Originally Posted by Jay Gatsby View Post
    Nice job, good to see more people utilizing these sort of tools.

    For reference, you can get a paid Sentry account with the GitHub student package which some users might have access to
    OOO nice Thanks for the info ill add to the main post
    Reply With Quote  
     

  8. #6  
    Wut can u say when theres nothin to tell

    Tyrant's Avatar
    Join Date
    Jul 2013
    Age
    22
    Posts
    1,565
    Thanks given
    679
    Thanks received
    418
    Discord
    View profile
    Rep Power
    1029
    I'm already seeing kids mass-submitting reports with these broken custom server clients
    Reply With Quote  
     

  9. #7  
    Extreme Donator

    Mark.'s Avatar
    Join Date
    Jul 2020
    Posts
    122
    Thanks given
    90
    Thanks received
    118
    Discord
    View profile
    Rep Power
    289
    Quote Originally Posted by Tyrant View Post
    I'm already seeing kids mass-submitting reports with these broken custom server clients
    Maybe they can fix then
    Reply With Quote  
     

  10. #8  
    Registered Member Roseblood's Avatar
    Join Date
    May 2022
    Posts
    4
    Thanks given
    0
    Thanks received
    6
    Discord
    View profile
    Rep Power
    0
    Sentry is a solid recommendation - its primary benefit (imo) is making it simple to aggregate logs from clients without having to be concerned about the bandwidth or storage implications.

    As for the server, one should also consider setting up a Grafana instance. It's relatively simple to self host, but a managed instance is free or quite cheap depending on your needs. Makes it simple to aggregate metrics from multiple sources such as a database, the resource utilisation of your machines, or logs from Sentry/Loki/ELK.
    Reply With Quote  
     

  11. Thankful users:


  12. #9  
    Extreme Donator

    Mark.'s Avatar
    Join Date
    Jul 2020
    Posts
    122
    Thanks given
    90
    Thanks received
    118
    Discord
    View profile
    Rep Power
    289
    Quote Originally Posted by Roseblood View Post
    Sentry is a solid recommendation - its primary benefit (imo) is making it simple to aggregate logs from clients without having to be concerned about the bandwidth or storage implications.

    As for the server, one should also consider setting up a Grafana instance. It's relatively simple to self host, but a managed instance is free or quite cheap depending on your needs. Makes it simple to aggregate metrics from multiple sources such as a database, the resource utilisation of your machines, or logs from Sentry/Loki/ELK.
    Never looked into Grafana tbh, Ill do some research about it , The main Benefit for Sentry client side is just how easy it is to get the player errors and issues without bothering players
    Reply With Quote  
     

  13. #10  
    Registered Member
    Join Date
    Oct 2021
    Posts
    13
    Thanks given
    1
    Thanks received
    9
    Discord
    View profile
    Rep Power
    61
    Neat, thanks!
    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Replies: 3
    Last Post: 05-08-2020, 02:47 AM
  2. Server list & Client List
    By Etnies in forum Downloads
    Replies: 23
    Last Post: 02-14-2009, 06:33 AM
  3. 481 server and client.
    By Jioannou in forum Downloads
    Replies: 384
    Last Post: 02-26-2008, 11:04 PM
  4. [Req] making my server silabsoft client only
    By 1337LilPimp in forum Tutorials
    Replies: 8
    Last Post: 09-07-2007, 07:56 PM
  5. [New] Server And Client List [New]
    By Nova in forum Downloads
    Replies: 24
    Last Post: 08-24-2007, 12:41 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •