IronMQ+New Relic

Hi, New Relic team!

I hope you’re doing well. My name is Alex and I am a lead developer of iron.io team. I’m trying to configure New Relic to monitor our message queue service (IronMQ). IronMQ had an integration with New Relic before. We have a ruby script that retrieves IronMQ statistics (queue size, message rate) and sends this info to New Relic. Unfortunately, I’m not able to find the graph in New Relic UI.

Here is a piece of ruby script we’re running:

require ‘newrelic_platform’
@new_relic = NewRelic::Client.new(:license => {LICENCE_KEY},
:guid => ‘io.iron.mq’,
:version => ‘2’)
collector = @new_relic.new_collector
component = collector.component(‘Queues’)

component.add_metric “Total”, ‘messages’, total
component.add_metric “Size”, ‘messages’, size

Best,
Alex

Dashboards Question Template

Please describe the behaviour you are seeing, and how that differs from what you are expecting.

If relevant, please share screenshots of your query results / dashboards & NRQL/PromQL queries from your dashboards.

Please be sure to omit any sensitive information.

Hi. I’m trying to configure New Relic to monitor our message queue service (IronMQ). IronMQ had an integration with New Relic before. We have a ruby script that retrieves IronMQ statistics (queue size, message rate) and sends this info to New Relic. Unfortunately, I’m not able to find the graph in New Relic UI.

Here is a piece of ruby script we’re running:
require ‘newrelic_platform’
@new_relic = NewRelic::Client.new(:license => {LICENCE_KEY},
:guid => ‘io.iron.mq’,
:version => ‘2’)
collector = @new_relic.new_collector
component = collector.component(‘Queues’)

component.add_metric “Total”, ‘messages’, total
component.add_metric “Size”, ‘messages’, size

If there is a plan we need to subscribe to in order to get this integration, please let me know. Thanks.

Welcome, @alex.litvak

I am one of the engineers on the Ruby agent team and hopefully, I can help you out. I’m a little perplexed by the example you provided as it doesn’t really line up with how the Ruby agent is built. So let’s break it down a bit…

Where is this reference source for this line?

If you’re attempting to require the Ruby agent, this file doesn’t exist in the repo and also the lines that follow doesn’t match anything we’ve documented for the Ruby agent’s invocation. Which means this code snippet isn’t the right approach for this unless there’s a Ruby gem out there you’re leveraging in the above example.

Also, is this line right? Seems like it might be intending to interpolate a string with curly braces around LICENCE_KEY like that, so you’re not really injecting a valid license key here, if that’s indeed the intent. If interpolation is the intent, then surely, "#{LICENCE_KEY}" or just straight up LICENCE_KEY (without the braces) is appropriate.

Either way, I would suggest following the guide here for setting up the Ruby agent, using environment variables or a newrelic.yml config file and use require 'newrelic_rpm' rather than newrelic_platform

If you need to manually start the agent because it doesn’t auto-start then call NewRelic::Agent.manual_start to start it at the appropriate place in your start up code.

Hopefully, this helps you get started in the right direction, but please do elaborate and ask more questions so we can help you out!

1 Like