defer Panic

Gone Full Unikernel

It’s been almost a year since the last blogpost - what has the DeferPanic team been up to? Well, if you ever had an account with us, chances are you received a notice about us sunsetting the Go APM service. Spoiler Alert: (We aren’t removing it entirely. :) The last year has been like a whirlwhind - I honestly don’t know where the time went especially the past few months. Anyways, we’ve been building out unikernel tooling/infrastructure @

Compile Time Code Weaving in Go

One of the things in Go that frustrates me is packaging and it’s not because I have 20 dependencies that I’m including in each project. I don’t have a problem with that cause we don’t do that at DeferPanic. What we do do is routinely jump into third party codebases we’ve never seen with tens of thousands of lines of code and we are told it “has problems”. How do we find those problems so fast?

Manual Memory Management in Go

Intro Note: This post might rustle some feathers and please let me know if I get something horribly wrong - I don’t profess to be an expert at this. We collect performance statistics from a lot of go users by nature of what we do at deferpanic. Unlike other APM/error logging companies, our main focus is not telling you that there is a problem but we are there to actually help fix those problems.

Goroutine Tracing

I had ran across Dmitry’s design document a few months ago but just didn’t dedicate anytime to looking into it, however, right then I knew this was going to be a killer feature in go 1.5. Fast forward to today - we are going to look at the most awesome bodaciously bad tracing features coming in go 1.5 due out this August. We have hit a feature freeze so what you see is what you are going to get!

Finding Errors and GoRoutines with Deprehend

TLDR: Deprehend generates go src to automatically wrap goroutines with panic handling and provides other automatic deferpanic support. You can find the src here: Deprehend As more and more companies started integrating with us we kept hearing more and more of - “You mean I have to wrap every single http handler and every single go routine?” This was of course, after their initial introduction to go “You mean I have to wrap every function with error handling?” :) We admit, this is not only a complete pain in the ass but it’s hard to scale as you have no way of knowing new code has been handled correctly or not - it kinda defeats the purpose of handling un-expected errors/panics.

Always Check Your Errors

I was enjoying my coffee, smug in the sense that I just responded to a bug with a pull request in the matter of a few minutes. Then I got an email from one of the contributors that was reviewing the pull request. “Can you look at this? The tests aren’t passing for me.” The tests aren’t passing? What are you talking about the tests aren’t passing? I didn’t really do anything.

Average of a Time-Series in Go

Our product deals with a lot of time series data - most of which is purposely un-optimized at the moment because we are focusing in on figuring out what go developers want and need versus “scaling”. That can come later. However, a few users started really using one of our services and it highlighted a problem that we knew was not going to work well with “plug your favorite rdbms here”.

Golang Testing for Rubyists

There has been a swarm of converts to go from dynamically typed interpreted languages such as ruby in the past couple of years. Many come seeking the promise of fast execution and stay when they find the solace of static typing. Coming from a language like ruby means you probably spend a disproportionate more time writing tests. It is extremely common to see code like this in rails codebases: def do_something(blah) if blah.is_a?(Array) puts "array" elsif blah.is_a?(Hash) puts "hash" else puts "N/A" end end Having to write tests to cover for type checking will obviously lead to a bulkier test suite.

Understanding Go Lang Memory Usage

Warning: This is an intro to memory with the go language - you can deep dive down the rabbit hole as far as you want to go. Most beginning go developers try out a simple hello world ala: package main import ( "fmt" "time" ) func main() { fmt.Println("hi") time.Sleep(30 * time.Second) } and then they go completely crazy. 138 f!*%!G of $%@# memory!? This laptop only has 16G! Virtual vs Resident Go manages memory differently than what you might be used to.

Logging Panics in Go Lang on Android

To say that we are pretty pumped about today’s release of golang 1.4 that includes official android support is an understatement. We believe android is really going to propel go’s popularity. I mean - it’s not that it doesn’t already have killer apps - docker anyone? However, now the ecosystem has just opened up an entirely new world of software engineer that is more than willing to use it. Huge shoutout to David Crawshaw and the rest of the go team for making this happen!

Looking to monitor your go applications?