JVMs chart with GraphQL

I like to present the JVMs output into an external page. Is it possible to get JVMs output with NRQL and then use graphql to generate a embedded link?

Thanks,
Asif

Yes. Which part do you need help with?

Hi @philweber,

I am interested in Services - APM > Jira Prod > JVMs which shows all my 4 jira nodes with columns for Appdex, Resp Time, Throughput, CPU, Memory and present that in external page.

I like a NRQL query that present those data. I am familiar with graphql and if there is a query available I should be able to take it from there.

Thanks,
Asif

Try this:

SELECT 
  filter(apdex(newrelic.timeslice.value), WHERE metricTimesliceName = 'Apdex') AS 'Apdex', 
  average(apm.service.transaction.duration) * 1000 AS 'Response time', 
  rate(count(apm.service.transaction.duration), 1 minute) AS 'Throughput', 
  filter(average(newrelic.timeslice.value) * 100, WHERE metricTimesliceName = 'CPU/User/Utilization') AS 'CPU', 
  filter(average(newrelic.timeslice.value) * 1000, WHERE metricTimesliceName = 'Memory/Used') AS 'Memory' 
FROM Metric 
WHERE appName = 'Jira Prod' 
FACET host

I found these by going into the Metrics explorer view for my application and searching for the desired metrics, then viewing the NRQL query on the right-hand side:

1 Like

This looks perfect. I am trying to find out for CPU, how to show .767 to 76.70% and like.

Wait I think it is already multiplied by 100, so I need to append a % character next to the value.

I don’t think it is possible to show a percent sign beside the number, but you can use the AS clause to customize the label to say, for example, ‘CPU %’.

1 Like

I noticed Services - APM > Jira Prod > JVMs CPU column showing double digits for CPU usage. But NRQL query below showing single digit CPU usage. What gives?

SELECT filter(average(newrelic.timeslice.value) * 100, WHERE metricTimesliceName = 'CPU/User/Utilization') AS 'CPU%' FROM Metric WHERE appName = 'Jira Prod' FACET host Since 30 minutes ago

Try multiplying by 1000?

1 Like

Yeah I see the same in Metrics explorer. So can you explain why multiply by 1000 ?

No, I just do what I need to do to make the data look the same. :slight_smile:

1 Like

Is there a way to get Memory Utilization by percentage as well for APM? I only see the following fields available

SELECT uniques(metricTimesliceName) 
FROM Metric WHERE appName='Jira Prod' 
AND newrelic.timeslice.value IS NOT NULL AND metricTimesliceName RLIKE '^Memory/.*'

Memory/Heap/Committed
Memory/Used
Memory/NonHeap/Committed
Memory/Heap/Utilization
Memory/Heap/Used

Is it Memory/Heap/Utilization ?

I tried this and not sure if I need to multiply with 100 to get percentage or even this is the right parameter to collect memory usage percentage for an application

SELECT filter(average(newrelic.timeslice.value), WHERE metricTimesliceName = 'Memory/Heap/Utilization') FROM Metric WHERE appName = 'Jira Prod' 

The JVMs page shows memory utilization in megabytes. I do not know of any way to get utilization as a percentage.

This query gives me a message. It works fine for Jira and Confluence. But for Bamboo I get a message when I run this query.

SELECT filter(apdex(newrelic.timeslice.value), WHERE metricTimesliceName = 'Apdex') AS 'Apdex', average(apm.service.transaction.duration) * 1000 AS 'Response time', rate(count(apm.service.transaction.duration), 1 minute) AS 'Throughput', filter(average(newrelic.timeslice.value) * 1000, WHERE metricTimesliceName = 'CPU/User/Utilization') AS 'CPU%', filter(average(newrelic.timeslice.value) * 1000, WHERE metricTimesliceName = 'Memory/Used') AS 'Memory' FROM Metric WHERE appName = 'Bamboo Prod' FACET monthOf(timestamp) AS 'Month' SINCE '2021-05-01'

The message says
A soft-limit was applied during query execution (this could happen when query involves too many metrics and/or data reporting sources). Query results might be incomplete. Try making your where clause more restrictive.

Looking for a suggestion on how to make where clause more restrictive

Any suggestion on how to address this issue?