In order for us to identify which CA API Gateway Services have their trace turned on, we can utilize a simple SQL Query against the CA API Gateway MYSQL DB.
The below steps will illustrate how such can be done.
1. Create a JDBC Connection to the CA API Gateway MYSQL DB:
1.1 Open the Policy Manager and navigate to the 'Tasks' --> 'data Sources' --> Manage JDBC Connections'
1.2 Create a new JDBC Connection to your CA API Gateway MYSQL DB:
2. Create a new Policy with type: Policy-Backed Service Operation Policy Fragment
3. Add the below rules in your policy:
3.1 Create the 'Perform JDBC Query' based on the JDBC Connection you created in Step 1:
3.2 Create a condition to continue if at least one service was found with trace on.
3.3 Create the needed Email Alert settings:
3.4 Save and Activate your policy.
4. Create a new scheduled task/job to be run with the policy created.
4.1 Go to 'Tasks' --> 'Global Settings' --> 'Manage Scheduled Tasks'
4.2 Add the needed task.
Once an email will be generated and sent out, the needed Policy Manager users/admins can quickly locate the services in play and turn the trace off.