"HowTo" Posts


It's very easy to create a Scout plugin

By Andre Bullet_white Posted in HowTo Bullet_white Comments 1 comment

How easy? Really easy. There are just two things you need to know to get started:

1. Starting the Agent in test mode

The agent sports a nifty autotest-like mode to help you quickly iterate new plugin code. To start:

scout_agent test my_new_plugin.rb

With that, the agent is watching my_new_plugin.rb, just waiting for you to hit save so it can come to life. Whenever you modify the target file, the Agent will immediately log to console the results of your plugin-in-progress.

2. The basic format of a plugin

Keeping this very simple—a plugin looks like this:

class ExampleReport < Scout::Plugin
  def build_report
    report(:minute=>Time.now.min)
  end
end

Yeah, that’s a simple case all right. It just reports the minute every time it runs, so it will generate a single data series with a value between 0 and 59.

If you haven’t created a plugin before, I encourage you to try this very simple example. It will take you approximately two minutes, and you’ll see how easy the Agent’s test mode makes it to iterate.

Go a little deeper

There’s more: generating alerts, reading from option files, etc. When you’re ready, check out the developer documentation at https://scoutapp.com/info/creating_a_plugin

 

The 3 pillars of our Rails Monitoring Stack

By Derek Bullet_white Posted in HowTo Bullet_white Comments Comments

Life as a cross-dresser must be unnerving. I could buy a wig, put some makeup on my adam’s apple. Buy a skirt. Does a sock-filled bra work for my bosom?

With a bit of mood lighting, I might actually look like a woman, but it would be difficult to relax. Knowing my manhood could be exposed in a multitude of ways – some stubble on my chin, hair on my legs, forgetting to make my voice less deep, etc. would leave me on-edge.

In some ways, I feel like I identified with cross-dressers before we solidified our Rails monitoring stack over the past year. I just felt vulnerable – that one wrong move could send our Rails stack tumbling.

We’ve standardized our setup, and I thought I’d share the 3 tools we’re using that make me feel much less like a cross-dresser these days.

The 3 pillars of our Rails monitoring stack

We break Rails monitoring into the 3 parts below (along with the tools we use):

Process Monitoring

System Performance

Exception Notifications

skitched-20080822-140434.jpg

“The Diaper”

A safeguard for emergencies
skitched-20080822-140537.jpg

“The Nerves”

Preventing future problems
skitched-20080822-140602.jpg

“The Megaphone”

A loud voice when your app is breaking
Monit Scout Exception Notification plugin
Ensure Mongrels are running & restart leaking processes Catch disturbing trends before they become problems – disk space usage, server load, slow requests, etc. Organizing and collecting application exceptions


So, to be clear, even though we built Scout, we use a combination of tools to make sure our Rails apps are running.

Read More →

 

4 Simple Steps to Detect & Fix Slow Rails Requests

By Derek Bullet_white Posted in HowTo Bullet_white Comments 11 comments

2016 UPDATE: We’ve released Scout App Monitoring, which automates these steps for you.

In Blink, Malcom Gladwell’s book on split-second decisions, Gladwell tells the story of how the Emergency Department at Chicago’s Cook County Hospital changed their process for diagnosing chest pain.

Dr. Brendan Reilly instituted a simple test to determine whether a patient was suffering from a heart attack. It combined just 4 questions with the results of an ECG. This simple test was 70% better than the barrage of questions previously asked by hospital staff to identify patients that weren’t having a heart attack and was nearly 20% better at identifying patients that were having heart attacks.

More information on the patient’s symptoms often led to an incorrect diagnosis. It distracted doctors from the real issues.

I’ve seen this many times with developers trying to debug performance issues in Rails applications. They look at outliers instead of the obvious culprits. It’s part of the reason I’ve never felt a need for a deep, detailed Rails monitoring application (i.e. – benchmarks from the controller to the database level on every request).

The majority of the time, our performance problems have nothing to do with the Rails framework (and we’ve worked through a lot of issues since we started building Rails apps in 2005). Why benchmark the entire request cycle when the vast majority of issues are isolated at the database layer? After I’ve ruled out the database, I can see benchmarking a single request (there’s a great free tool below), but I simply don’t want the other, often irrelevant information clouding my mind.

The root symptom we want to avoid in our apps is slow requests. Our Scout plugin for analyzing slow Rails requests has been installed nearly 250 times, so we’re not alone there.

Read More →

 

Monitoring Amazon EC2 Instances

By Derek Bullet_white Posted in Examples, HowTo Bullet_white Comments Comments

UPDATED – We’ve made it even easier to monitor ec2 instances. Check out our post on cloud monitoring.

Read More →

 

Giving your web host access to your Scout account

By Derek Bullet_white Posted in HowTo Bullet_white Comments Comments

A couple of times already, we’ve seen users give their web host access to their Scout account.

It’s a big help when debugging problems – especially things that a basic monitoring tool might not pick up (like slow web requests).

Read More →

 

How we handle background jobs

By Derek Bullet_white Posted in HowTo Bullet_white Comments Comments

We run background jobs on our Scout servers. Lots of them.

As we’ve grown, they’ve used dramatically more resources. We needed a way to simmer them down. Most of these jobs load the entire Rails environment – that’s a hefty overhead.

We’ve modified how we run background jobs and we’re seeing great results. If you’re interested in what we did, checkout Charles’ post on our Highgroove blog.

And finally, here’s the obligatory semi-promotional graph, generated by Scout, of how the load dramatically decreased after implementation:

Scout ~ Edit Graph

 

Older posts: 1 ... 3 4 5 6