I would like to define some conditional statements with a plugin to skip over any code that is not necessary if a measure is not subscribed to (mainly to avoid sending requests to a system that does not have a relevant feature which would generate errors on their side).
I know there is some way to check whether or not a measure is subscribed to but am not certain as to what that is, any assistance/examples are appreciated.
Solved! Go to Solution.
I worked out a pretty simple solution to this:
if (!env.getMonitorMeasures(<metric_group>, <measure_name>).isEmpty())
This basically checks that the given measure is in the collection of subscribed measures as configured and if it is not in there it doesn't execute the code to get the measure.