Giter Site home page Giter Site logo

lexicality / gmod-sentry Goto Github PK

View Code? Open in Web Editor NEW
37.0 4.0 3.0 94 KB

Find out how terrible your workshop addons are in one easy place

Home Page: https://lexicality.github.io/gmod-sentry/

License: Apache License 2.0

Lua 100.00%
garrysmod sentry-client

gmod-sentry's Introduction

Sentry integration for Garry's Mod

Track errors as they happen on your server, find out which workshop addon is making your players quit and track bugs without having to rely on user reports.

Requirements

Setup

  1. Download and install the correct version of luaerror from your server (eg gmsv_luaerror_linux.dll)
  2. Set up a project in Sentry
  3. Find your DSN
  4. Upload sentry.lua to lua/includes/modules on the server
  5. Create lua/autorun/server/sentry.lua on the server with the contents
    require( "sentry" )
    sentry.Setup( "YOUR DSN HERE", { server_name = "SHORT NAME FOR SERVER" } )
  6. Start collecting errors!

Customisation

sentry.Setup()

You can pass a number of fields to sentry.Setup:

  • server_name: Tags your server in the sentry UI. If you have more than one server, this is useful for filtering between them. If you don't set it, your server's public hostname will be used.
  • environment: Used for setting up Environments on sentry. Not very useful if you don't run a testing server.
  • release: Used by the Releases feature in Sentry.
  • tags: Any additional tags you want every error from this server to be tagged with
  • no_detour: If you don't want the module to override certain functions (because you've already overriden them) then pass them in here.

Example:

sentry.Setup(
	"https://[email protected]/1337",
	{
		server_name = "server 7",
		environment = "production",
		release = "v23",
		tags = { foo = "bar" },
		no_detour = { "hook.Call" },
	}
)

Transactions

By default this module will detour a number of Lua entry points to attempt to instrument as many things with useful transaction names as possible.

This means your errors will be tagged with things such as hook/PlayerInitialSpawn/DarkRP_DoorData or net/GModSave, but you may wish to use your own names for functions. You can use sentry.ExecuteInTransaction to do this.

Example:

function DoDatabaseSave( ply )
	-- snip
end
hook.Add( "PlayerDisconnected", "Save Player Data", function( ply )
	sentry.ExecuteInTransaction( "My Save System", DoDatabaseSave, ply )
end)

Documentation

A generated LDoc file is available at https://lexicality.github.io/gmod-sentry

gmod-sentry's People

Contributors

donkie avatar lexicality avatar mstruntze avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

gmod-sentry's Issues

August 2020 Update causes a lua panic under certain conditions

I haven't been able to investigate this very well myself as I'm on holiday, however the August 2020 update has caused a lua panic on our server during bootup (doesn't seem to occur 100% of the time)

image

This patchnote imparticular is likely the root cause.

Hopefully this can be fixed, or a workaround found.

Incompatibility with luadev

At startup while gmod-sentry is trying to get version data the following happens:

error: bad argument #1 to 'pairs' (table expected, got function)
  File "[C]", in pairs
  File "addons/luadev/lua/autorun/tinylua.lua", line 33, in tinylua
  File "addons/luadev/lua/autorun/easylua.lua", line 726, in __index
  File "lua/includes/modules/sentry.lua", line 211, in func
  File "lua/includes/modules/sentry.lua", line 862, in ExecuteTransaction
  File "lua/includes/modules/sentry.lua", line 1205, in <unknown>
  File "[C]", in xpcall
  File "lua/includes/modules/sentry.lua", line 864, in <unknown>

looks like it's caused by these, which is: https://github.com/Metastruct/luadev/blob/8b53bec879869fba6df097c3144fc8d79352275a/lua/autorun/easylua.lua#L809

No clientside errors?

I can't see support for clientside LUA errors, is this deliberately or not done yet?

Re-running the setup script causes crash

Seemingly gmod enters an infinite lua loop if I try to re-run the described sentry.lua script I've put in autorun. Naturally, this is not that's normally done but when developing I'd like to re-initialize sentry.

Add detour for mysqloo

  • Add a function specifically for reporting SQL errors
  • See if we can automatically wrap all callbacks in transactions
  • Automatic breadcrumb capture? (#6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.