Dashboard graphs and charts and alerts by tag

Hi folks, wondering how to make dashboard graphs and charts and alerts by tag.

Specifically, we not have two different “groups” of servers, differentiated by EC2 roles (which show up as tags in New Relic via the AWS EC2 integration). They now handle different workloads, though all running our one monolithic application. Specifically, one group handles our normal web traffic and one group handles our API traffic. I’d like to monitor them separately.

I’d like to have a dashboard chart that shows me, say, just the Apdex or response time for group 1, and another just for group 2. Right now, I can get them both together (as they’re all running the same “application” from APM’s perspective), but I want to filter that chart down to just a certain group of servers. How can I do that?

Similarly for alerts. I’d like to alert when, say, response time on average from one group of servers gets too high, and from the other separately, so I’d need to alert by tag. How can I do that?

Or, alternatively, other suggestions for grouping servers in this way?

Hey there @jro -

If I understand you correctly, you are looking to build a dashboard with charts that display data for groups of servers that are organized by tag (e.g. the API group and web traffic group). Additionally, you want to set up alerts that pertain to servers with a certain tag.

Both of those would typically be handled by writing a NRQL query. At this time, Tags are not queryable in NRQL. That said, we see the value, and there is a Feature Idea about this that you can led your voice to:

Note that in that topic, the initial poster did indicate that they were able to leverage GraphQL to use Tags with this query:

{
  actor {
    entitySearch(queryBuilder: {tags: {value: "value", key: "key"}, domain: APM}, sortBy: NAME) {
      results {
        entities {
          tags {
            values
            key
          }
          name
          entityType
        }
      }
      count
    }
  }
}

Here’s some more information on using NerdGraph:

https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-entities-api-tutorial

Let me know if that does not get you what you need.

Thanks – I’m not sure NerdGraph is what I want though. I want to use New Relic’s built in dashboarding toolset, and I want to use New Relic’s built in alerting. So I don’t want a separate API.

If this can’t be done with tags, can you suggest another way these servers can be segmented, dashboarded, and alerted on separately?

Thanks @jro - that is understandable for sure. I would say that the next best thing I can think of us to use a unique naming convention for each set of servers, and then query against servers `WHERE hostname LIKE.’ I can keep noodling on this, but that’s the first thing that comes to mind for me.

@hross got it, that gives me something to potentially work with. I’ll report back with issues as I go!

1 Like

Perfect. Looking forward to hearing back!

@hross the way we’re looking likely to solve this is segmenting by app_name. We’re ruby/rails, so from our new_relic.yml config file:

# Application Name
# Set this to be the name of your application as you'd like it show
# up in New Relic.  New Relic will then auto-map instances of your application
# into a New Relic "application" on your home dashboard page. If you want
# to map this instance into multiple apps, like "AJAX Requests" and
# "All UI" then specify a semicolon-separated list of up to three
# distinct names.  If you comment this out, it defaults to the 
# capitalized RAILS_ENV (i.e., Production, Staging, etc)

So we’re now sending two app names. One will be sent by every server, regardless of type, and one will be sent if the server is a web server, and a different one sent if the server is an API server.

Making dashboard charts and alerts by app name is very easy, and this way we have one “app” with all servers in it, and two other “apps”, one with just web servers and one with just API servers.

One question though – will this double our costs? As in, will reporting in two app names count as two servers for the purposes of New Relic pricing? Or is it really just mapping one “host” to multiple “apps” as the comments in our config file say?

Hi there @jro - no worries, this will not affect your pricing. Glad you found a solution that is working for you!

Great to hear, appreciate the help!