Announcing Brainfuck Monitoring for Scout APM

BY Chris Schneider

April 01, 2019

Finding the right APM solution can be a pain, and we couldn’t imagine a community that needed more pain-relief than Brainfuck developers. For example, say you woke up in the morning to debug this gem:

+[-[<<[+[--->]-[<<<]]]>>>-]>-.---.>..>.<<<<-.<+.>>>>>.>.<<.<-.

“Now, of course, that’s just Hello world”, we hear you say. But imagine a more complex codebase, at scale and in production, and you’re trying to nail down a performance issue which only crops up when a certain query is run! See! The struggle is real.

Well, starting today, you need worry no more. Scout is proud to announce support for Brainfuck!

 

undefined

Our mascot, Doggo, can't get enough Brainfuck

Getting Started

Clone the repository with our instrumented Brainfuck interpreter*, and follow the instructions in the Readme, which are also pasted below: 

* (big thanks to Shinichiro Hamaji @shinh for the excellent Brainfuck interpreter we modified)

  1. Sign up for a free trial account.

  2. Get your Org Key

  3. Download the Core Agent binary
    # OSX:
    wget https://s3-us-west-1.amazonaws.com/scout-public-downloads/apm_core_agent/release/core-agent-latest-x86_64-apple-darwin.tgz
    
    # Linux:
    wget https://s3-us-west-1.amazonaws.com/scout-public-downloads/apm_core_agent/release/core-agent-latest-x86_64-unknown-linux-gnu.tgz
    
    # For either one, untar it:
    tar xvzf core-agent-latest.....tgz
    
  4. Start the Core Agent
    ./core-agent start
    
  5. In another window, setup your environment variables:
    # Your Application Name
    export SCOUT_NAME=unicorn
    
    # Your Org Key (
    export SCOUT_KEY="fXU8f....Vi3A"
    
  6. And run your BF app!**
    ruby bf.rb pack/hello.c.eir.bf

** Prereq: You need Ruby to run the BF Interpreter.

If everything is configured properly, your Brainfuck program's performance data will get piped into Scout's standard APM view. This is actual data from a Hello World program, written in Brainfuck, put through the instrumented interpreter:

undefined

For some more example apps and config details, check out the repo.

Not using Brainfuck? Well, we also support Ruby, Python, and Elixir. If you're still using one of those esoteric languages, you can find out more about our APM here.

Shoutout

As mentioned above, we want to give special credit to Shinichiro Hamaji @shinh for the excellent BrainFuck interpreter we modified. See his very cool ELVM Compiler Infrastructure project to compile C programs into working BrainFuck code (among other EsoLang targets).