Your data. Anywhere you go.

New Relic for iOS or Android


Download on the App Store    Android App on Google play


New Relic Insights App for iOS


Download on the App Store


Learn more

Close icon

New relic insight memory metrics for every 5 min interval


#1

###Insights Question Template

  • There are many ways to achieve a goal in Insights, tell us a bit about your end goal. What insights are you hoping to gain?

I’m trying to get memoryUsedBytes for all ec2 instances. I’m using below query and noticed that the timestamp is for every 10 min.

  1. Is it possible that the interval can be 5 min instead of 10 min?
  2. The timestamps are sorted Descending. Can this be sorted ascending?

from SystemSample select entityKey, memoryUsedBytes where entityKey = 'i-002215bc91cf2a4b3' since 1 day ago LIMIT 150

  • Please include the URL to the Insights dashboard that needs addressing:

  • Let us know which NRQL queries you have tried so far:

from SystemSample select entityKey, memoryUsedBytes where entityKey = ‘i-002215bc91cf2a4b3’ since 1 day ago LIMIT 150

Helpful Resources:


#2

Hey @chinu.lee - by default the infrastructure agent should be capturing this data at 5 minute intervals, not 10.

Can you conform whether you have set the polling interval manually (either by metrics_system_sample_rate in yaml or NRIA_METRICS_SYSTEM_SAMPLE_RATE as an Env Var?).

If not, this may be a native polling frequency from an older agent, we see that you are using an older version of the agent (1.2.6), could you update to v1.6.0 and let us know the results of that same query?

Thanks in advance


#3

Hi Ryan,

Thank you so much for your reply. I just confirmed that we do have a different agent version installed in our infrastructure. However,

  1. we do have a service which has the version 1.6.0 installed.
  2. I also confirmed that the ‘metadata/agent_config/infrastructure/MetricsSystemSampleRate’ setting is configured with value ‘5’.
  3. I don’t see the ‘metrics_system_sample_rate’ in the yml file.

What I noticed is if I query for less than ‘5 hours’ in fact it returns every 5 min as the configured setting.

from SystemSample SELECT entityKey, memoryUsedBytes where entityKey = ‘i-08b05062de4e61e55’ since ‘2019-11-10 08:00:00 PST’ until ‘2019-11-10 13:00:00 PST’ LIMIT max

However, If I extend the query for 24 hours, it returns for every 10 min.

from SystemSample SELECT entityKey, memoryUsedBytes where entityKey = ‘i-08b05062de4e61e55’ since ‘2019-11-10 08:00:00 PST’ until ‘2019-11-11 07:59:59 PST’ LIMIT max

Is it possible from the query level I can choose the interval to 5 min?

Thanks,


#4

Hi @chinu.lee - Thanks for sending over that information. By default, the sampling frequency for the data being sent under SystemSample is 5 seconds. This means that the smallest interval between individual events in Insights should be 5 seconds.

As mentioned by @RyanVeitch the sampling frequency can be changed to a value higher than 5 in the newrelic-infra.yml for the infrastructure agent. If you want to go down this path the line below can be added and the agent restarted:

metrics_system_sample_rate: [value >=5]

This line is not included in the config when you first install the infrastructure agent.

From an Insights perspective, the window you select to view will determine the number of buckets data is aggregated into i.e. the smaller the window the more the buckets (up to a limit).

A good way of finding out how many events are being reported for a given query you can use the count() aggregator function as per the below:

FROM SystemSample SELECT count(memoryUsedBytes) WHERE entityKey = 'i-08b05062de4e61e55' SINCE '2019-11-10 08:00:00 PST' until '2019-11-11 07:59:59 PST' 

HTH