Alert for new dependencies

Is it possible to create an alert for when a new dependency is added to a service? For example, if my service has a new deployment and connects to a different external service, an alert should be sent.

The intent being to monitor and verify that new external services are acceptable.

Thank you

Hello @maltermatt :wave:

This is a great idea! I haven’t tried this myself but I have some ideas that may get you in the right direction!

APM agents will generate a ‘External’ metric, this is what you see on the ‘Externals’ UI page. The level of detail depends on if you are using Distributed Tracing? or Cross Application Tracing. Cross Application Tracing provides more detail on the Externals UI page:

And Distributed Tracing has this detail and more in trace data. Originally I was thinking of going down the route of alerting on Span data, but trace data is sampled and so it is not the best to alert on (unless you switched to Infinite Tracing and set your own sampling rules).

Metric data does not have the same sampling problem, it is a very lightweight data type meant to show trends and be aggregated, so it is the perfect candidate for this use case!

Best place to see your metric data is the ‘Metrics Explorer’ in the APM UI, at the very bottom of the left side bar, you will see ‘MORE VIEWS’, expand that and you will see the ‘Metrics Explorer’.
We want the External/ metrics, since we only care about the external service and not the transport type, let’s only look at those metrics with names like External/.../all.

So we could build a query like:

SELECT count(newrelic.timeslice.value) FROM Metric WHERE metricTimesliceName LIKE 'External/%/all' AND `entity.guid` = 'your service entity guid here' FACET metricTimesliceName SINCE 1 day AGO TIMESERIES

From there, you can set up a NRQL alert where you set the Number of expected groups:

I would love to hear about your results!

1 Like

This topic was automatically closed after 365 days. New replies are no longer allowed.