Call multiple API Test script and display it in single custom dashboard in Insights

Hi Team,

i have written 2 API Test script in synthetic and this 2 script will to the GET call and giving response of my application expiry Date.
Here am using 2 REST API call with 2 scripts and storing using $util.insight.set with some property name.

Now am able to create the dashboard in Insights using NRQL query for 1 API call sepratetly.

Now i want to merge this 2 API call response in single insight dashboard.

Please guide me on this.

Are you using the same attribute (property) name in both scripts? What type of data is it (string or number)? You may be able to do something like this:

SELECT attributeName FROM SyntheticCheck FACET monitorName

Thanks philweber for you immediate reply…
I am using same property name in both scripts and its a Date(string type) am sending to insights.

Did you try my query above?

Yes am getting error as “FACET cannot be used when selecting on event fields”

Ah, sorry. Try this:

SELECT latest(attributeName) FROM SyntheticCheck FACET monitorName

Insights’ default time windows is one hour; if your Synthetics monitors have not run with the last hour, you may need to add a SINCE clause to your query.

1 Like

Yep… Now i didn’t get any error but empty result set i got it.
Here is my insights property used in both 2 API scripts in synthetics

$util.insights.set(‘DaysRemaining’,totaldays); Number
$util.insights.set(‘RhapLicenseExpDate’, expdate); Date String(“2017-11-03”)

How we can merge the same in on insight dahsboard.

Actually i am trying to acheive below scenario

I have 2 application and running on 2 server and am getting license expiry date from both application and i want to show it in same dashboard with 2 server expiry dates.

FROM SyntheticCheck 
FACET monitorName

Superb Philweber… it works… Great thanks to you… :slight_smile:

1 Like

Philweber one more query if i changed the script name and adding some extra property in those scripts then am running the query in that am getting my old monitor name and newly changed monitor name also coming with data.
any other way to restrict this in insights.

You can add a WHERE clause to your query:

...WHERE monitorName IN ('name1', 'name2')
1 Like

@philweber from our previous NRQL querys
FROM SyntheticCheck
FACET monitorName
i want to send an email alert to the particular person if my “DaysRemaining” is 3 days in this case. Could you please guide on this part.

Hi, @Toshan.Mishra: You may create a NRQL alert condition that evaluates the above query and triggers a violation if DaysRemaining is less than or equal to 3. Create an email notification channel to send an email to the desired address in case of an alert incident.

You may find these videos helpful in understanding New Relic Alerts: