Python - Connection Monitors to SLA

Hi,

How can I get the SLA results from my monitors using API?
Which connections should I do to see the SLA results of my monitors?
And I’m coding in python

Hi @calmeida

Thanks for reaching out, I hope you are well.

I located a post that will help you achieve this Relic Solution: Using Insights to create the Ultimate SLA report. The approach is to use a NRQL and from there use your Phython, see below for guidance also.

However it may be best to use a GraphQL;

{
  actor {
    account(id: accountID) {
      nrql(query: "FROM SyntheticCheck SELECT average(duration) as 'Duration', percentage(count(*), WHERE result = 'SUCCESS') as 'Uptime', apdex(duration, t: 7000) as 'Apdex', percentage(count(*), where duration < 7000) as '% Satisfied', percentage(count(*), where duration > 7000 AND duration < (7000 * 4)) as '% Tolerated', percentage(count(*), where duration > (7000*4)) as '% Frustrated' SINCE 13 MONTHS AGO FACET monthOf(timestamp) LIMIT MAX") {
        results
      }
    }
  }
}

and also a NQRL will help here;

FROM SyntheticCheck SELECT average(duration) as 'Duration', percentage(count(*), WHERE result = 'SUCCESS') as 'Uptime', apdex(duration, t: 7000) as 'Apdex', percentage(count(*), where duration < 7000) as '% Satisfied', percentage(count(*), where duration > 7000 AND duration < (7000 * 4)) as '% Tolerated', percentage(count(*), where duration > (7000*4)) as '% Frustrated' SINCE 13 MONTHS AGO FACET monthOf(timestamp) LIMIT MAX

I hope this was helpful, please do let us know if this worked or if you found another solution.

1 Like