Llamarada

Tomar de la élite lo que pertenece a todos

Research Into Application Monitoring, Software Metrics and Hosted Logging Tools

| Comments

Important information is buried in our application logs, key business metrics await to be released into the light. Computer generated logs can be processed and turned into intelligence.

Application performance metrics tools (APM) like New Relic can drill into our application logs and produce information about it

Log tools like logly, logstash or logz.io can be used to analyze data from standard applications that use syslog and produce information from those logs

Time series databases like graphite and influx db could be used to track usage of network or telephony resources including destinations called, megabits used, balance remaining. It could be more efficient than using a standalone redis to track this. It could probably be used to track live call data but it is not clear. Other metrics that could be gathered are server and network equipment usage, RAM, HARD DISK CPU utilization metrics and other stuff.

New Relic is one of the oldest and better known application performance monitoring tools. Among its features are: Application monitoring including.. Application response times Time consuming transactions Performance of external services Cross application and transaction tracing

Database Monitoring: Time spent in data base calls Database call response time and throughput SQL query analysis Slow SQL Report

Alert Policies Availability Monitoring (external ping)

Reports (with custom dashboards) on Deployments Scalability SLA Capacity Availability

It has team collaboration features and has many security features on the data collected

There is a free plan capped with 24 hr retention (we will use it) and then there are PRO plans at ($149/month)

[ Stackify ] offers both a hosted log analizer and an application monitoring service. The application monitoring service checks server utilization, tracks performance of web requests and shows application errors. There is a configurable alert feature. A Charting feature for all metrics within the dashboard. It also offers a remote acces mode to access server log files. Its cost is $15 per server per month. The log analyzer feature is billed at $20 per 10 gigabits/month it has a log data viewer. with full text search and alerts. there is realtime tailing of logs and monitoring error rates.

Logly Collects log data from many sources including Ngnix Mysql and from custom applications using Syslog standard Alerts can be configured. Thends can be spotted using the log visualization tools and dashboards. Triggers can be configured for third party services.

There is a free plan that caps 200/MB each day with 7-day retention (we will use it) Paid plans start at $45 month with a 1 GB each day cap and also 7-day retention

[ Graylog ] is a powerful opensource log management platform

[ Datadog ] Is a hosted monitoring service. It features multiple integrations to monitor a lot of services and applications. It has an interactive dashboard that can be customized. It has a full text search function and it is team ready. It has alerts. It allows you to push your own metrics and events with its client libraries and APIs . It has a free mode (i will use it) that allows to work with up to 5 servers with one day retention and it also has a paid more at $15 per server per month.

CUSTOM METRICS I could build dashboards using this

Influx DB is an opensource free database that is used to collect application time series and produce metrics. it can be used with Grafana to produce dasbhoards with live information. It can sample data from many different sources and it can produce analyics on the data. It has a ruby client

Graphite it also a graphing tool it has a ruby client there is a hosted graphite service as well starging at $19 monthly for 2 year retention, 5s resolution and 100 metrics with 2 users, next plan is $49 monthly and it brings 500 metrics and 3 users

Grafana is a graph and dashboard editor for influx db and graphite

OTHER TOOLS I WONT TEST

[ Logz ] Is a log analizer posibblly built on graphite that bills for free for upto 1Gb a day of data with 5 day retention with no alerts and no dashboards, paid plans start at 49 USD a month for 7 day retention and i3 alerts and unlimited dashboards also 1 gigabit a day limit (WILL NOT USE IT)

[ Boundary ] it very similar to datadog system with a similar cost of $15 per month per server (WILL NOT USE IT)

[ happy apps ] is a hosted monitoring and alerting system with checks for many different applications. It also has a search function. It generates a report of all the checks that are run (WILL NOT USE IT?)

New Useful Freeswitch Tips

| Comments

As we delve deeper into FreeSwitch the discovery of clever little tools makes life easier

Display the value of a variable:

display the value of a variable
1
2
# display the value for the 'domain' variable 
fs>  eval ${domain}

Find out if user exists:

user_exists
1
2
3
4
fs>  user_exists id <domain>
# the value for <domain> can be obtained using the technique mentioned above: 'eval ${domain}'
# in the example below we try to locate user 100 at domain 127.0.0.1
fs>  user_exists 100 127.0.0.1
is a module loaded?
1
2
fs>  module_exists mod_directory
#will return true if  mod_directory has been loaded

Load freeswitch module

load module
1
2
fs>  load mod_directory
#will try to load mod_directory if it has been compiled and installed properly

Display the dialplan

display the contents of the dialplan
1
fs>  xml_locate dialplan

Remember to Vendor Your Gems

| Comments

Vendor Everything as Ryan McGeary told us back in 2011 apparently still applies, so remember to tell bundler to install your project gems inside the project’s vendor/bundle directory, eliminating the need of polluting the system wide gemset and the conflicts that can cause when using different versions of the same gem among projects. Also obviates the need to use rvm gemsets, which seemed to me like a little bit of extra work

bundle vendor install
1
$ bundle install --path vendor/bundle

Stefan Wrobel shares a nice tip to configure bundle to perform installs to your project vendor/bundle directory by default (instead of going to your system wide gemset)

tell bundle to install gems to vendor/bundle inside your project by default
1
$ bundle config --global path vendor/bundle

Updating to Ruby 2.1.2

| Comments

Ruby 1.9.3 has been declared EOL, support will end on February 23, 2015

We attempted to install ruby-2.1.2 to upgrade our setup but our RVM was quite old and said 2.1.2 was unavailable, so we needed to update RVM first

Update RVM
1
$ rvm get stable

Then after reloading rvm we asked it again about available rubies using :

reload RVM and query for available ruby versions
1
2
$ rvm reload
$ rvm list known

Finally we can ask rvm to download and install ruby 2.1.2 for us

Install latest ruby version uang:bash
1
$ rvm install ruby-2.1.2

Handy Octopress Commands

| Comments

OctoPress is the engine powering Llamarada blog. Lets discuss a few of the most important commands

Create a new blog post named “Handy Octopress Commands” and open it in your favorite editor:

CREATE NEW BLOG POST
1
$ rake new_post["Handy Octopress Commands"]

In our case we are using Heroku, these would be the required commands to generate the post content and upload it to our octopress site running on Heroku’s platform:

GENERATE POST AND PUSH IT TO HEROKU
1
2
3
4
$ rake generate
$ git add .
$ git commit -m "added new post titled: Handy Octopress Commands"
$ git push

The Various FreeSwitch Log Levels

| Comments

FreeSwitch is a very powerful Softswitch that you should be considering if your some sort of hardcore asterisk user, its console mode is quite a bit different from the familiar asterisk cli. fs_cli can get very chatty if you have more than a few concurrent calls, in any case here are a couple of commands to get you sorted..

Disable anything lower than warning i.e. DEBUG, NOTICE, INFO:

SET CONSOLE LOG LEVEL
1
$  /log warning

Disable all SIP traces:

DISABLE SIP TRACES
1
$  sofia global siptrace off

Enable sip tracing for a sofia sip profile named customers:

ENABLE SIP TRACES FOR CUSTOMERS PROFILE
1
$  sofia profile customers siptrace on

Thats it for now. it has been a while

Rails :after_save Callback Runs Before the Actual Database Record Is Created. So Use :after_commit Instead

| Comments

I ran into a gotcha yersterday when using the :after_save Rails callback, i hadn’t realized that the :after_save hook gets called before the SQL transaction is commited to the database. I was trying to tell asterisk to reload a queue from the database in the after_save hook using an AMI command but asterisk was not ‘seeing’ the record in the database at the time the reload command was being issued, then i realized that what i needed is called :after_commit

:after_commit is Rails 3 only but it can be used in Rails 2.x apps using the after commit gem

Happy Hacking

Speed Up Web Design With Serve

| Comments

Serve is a rack app server with a focus on web design it understand Rails style views and partials, as well as ERB, HAML and SASS

The premise is that front-end coders can use this to create mockups on its own project and without having to load the full framework