Synthetics automatic creation on discovered endpoint by query

Looking for a feature similar to Grafana, whereby query I can gather Nginx-ingress endpoint (using Prometheus exporter or etc) and create automatic Synthetics check of them.

For example, in Grafana I have simple query which find all endpoint with sub-domain API and admin and check if their expected status code is 401:
count by (instance) (probe_http_status_code{target =~ "api[.].*|admin[.].*"} != 401 and probe_http_status_code{target =~ "api[.].*|admin[.].*"} != 0)

The general goal is to automatically create and monitor endpoints from the world without the manual process of creation of Synthetics because in my case I have more than 100+ endpoints which count will increase every week.

Is New Relic have features like this?

Hello,

This is Lela from New Relic Technical Support. Thanks for reaching out to our Explorer’s Hub community with your inquiry!

Unfortunately, we do not currently have a feature to automate Synthetic monitor creation. What I can do is open a Feature Request for this functionality for our engineering team to consider with the next Synthetics release. If you have any details on how you would like this feature to look please let us know and we can include that in the Feature Request.

Thank you for the input and for helping us make our product better for everyone!

Hi, @yevhen.kalyna: What if you create a single API test monitor that loops through a list of endpoints and checks them? Then you can simply add to the list as new endpoints are added.

var assert = require('assert');

const endpoints = [
  'https://dummy.restapiexample.com/api/v1/employees',
  'https://dummy.restapiexample.com/api/v1/employee/1',
  'https://api.newrelic.com'
]
var failures = [];

endpoints.forEach(
  function(endpoint) {
    $http.get(endpoint, 
      function(err, response, body) {
        if (response.statusCode != 200) {
          failures.push(endpoint);
        } 
      }
    );
  }
);

console.log(failures);
assert.equal(failures.length, 0, 'Expected 0 failures');
1 Like

2 posts were split to a new topic: How to check multiple API endpoints, passing custom headers to each one