cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Conditionally capture arguments

bruce_garner
Participant

Hi,

I want to conditionally capture arguments during a dynatrace method sensor rule. The reason for this is that there is some sensitive information in some calls so I only want to capture the arguments when one of the arguments is a specific value.

From what I can see this isn't possible? Anyone know for sure?

8 REPLIES 8

kyle_kowalski
Dynatrace Pro
Dynatrace Pro

I don't know that you can specify only pull out the arg value if it equals xyz. You can create a BT and measure to use that specific value but as far as I know its either capture that value or not. I would look at seeing if you can pull an object out and use an accessor for access to a specific element of it.

Just to explain a little more :

I have a setValue(String key,String value) call I want to monitor and capture the argument. Problem is that apart for the two keys I'm interested in and want to capture (starting depart or arrive) the container also has personal details and payment information which I absolutely cannot capture.

Does this set value method also set the Credit Card information? If not you should be able to safely instrument that method. If you have a test environment I would look at testing those sensor placements there to be 100% sure you are not getting CC information

yup - that what I tested before asking and it does have card info - hence I can't instrument it sadly

Joe_Hoffman
Dynatrace Champion
Dynatrace Champion

Another approach is to modify your code. Below the setValue(), put an IF statement.

If key in (a,b) {call passToDynatrace(key, value)}.
Then create a passToDyntrace(key, value) method that doesn't do anything, just returns, and instrument the passToDynatrace(key, value) where you capture the key and/or value.

This approach allows your business logic to make the decision as to what Dynatrace collects, as it's not possible for Dynatrace to know what keys to collect and which ones not to collect until it's collected.

Great Suggestion!

Hi Joseph
Thanks - we've done that in other code we have. Unfortunately this is third party code - and part of their generic product so we can't get it modified.
I might have to consider using AOP.

Joe_Hoffman
Dynatrace Champion
Dynatrace Champion

Bruce, Given your 3rd party situation, AOP is certainly an option. Another approach I would consider is trying to find the two nuggets of interest someplace else in the code, and thus avoid the conflicts of capturing generic setters. Good luck.