Hi All,
I have a customer who want to monitor their revenue trend with dynaTrace, but the only way I can find the revenue value is inside a big java method argument, the argument is a complex java type, with a toString() method to return the XML representation of the object. My question is that: if I am going to monitor this argument with custom sensor, will dynaTrace return the full XML string or just part of it, is there any restriction on the size of method argument (String) that can be retrieved by dynaTrace?
Any comment is highly appreciated!
Thanks a lot!
Wei
Answer by Wei D. ·
Hi Reinhard,
Thanks for your advice.
I've tried to search for other option, like a java method with revenue as argument, but couldn't find one in the monitored agents. Right now, not only the revenue value but also other information, like bank id, need to be extracted from the big xml, so I have to use this way for now.
As for the numerical transformations for formatted strings, do you think we can have a dynaTrace patch to parse string in the form of scientific notation into numeric value, like an enhancement?
Any comment is highly appreciated!
Thanks a lot!
Wei
Wei,
we have had one request in the past to parse arbitarty number format strings back to numbers. This request wasn't implemented du to the low usage nad high effort associated with it. Sorry, very unlikely to get that anytime soon. I think the best way to get to your data easily is option (c) as Andy described it above.
Reinhard
Answer by Wei D. ·
Hi All,
I've change the string size captured to 12000, and the big argument can be captured.
Yet, with the argument in hand, there is another issue raised up. I am trying to extract certain number value from the big argument, but some time, this number value is in the form of scientific notation, for instance, 2.4e7. can dynaTrace recognize such number value, can dynaTrace transform such string into numeric?
Any comment is highly appreciated!
Thanks a lot!
Wei
Wei,
12k characters is very likely too big. I highly advise to go for the other options as you will probably run into an performance impact on the dynatrace server with a 12k attachment! Also parsing the whole XML via a regex to get the numeric value is not lightweight at all. Another reason to get the revenue value somewhere else.
I'm pretty sure a deeper investigation of the code will reveal some other possibility to extract the revenue value. Seems very unlogic to me to have it only in an XML that is passed along...
dynatrace does not provide any means of numerical transformations for formatted strings.
Reinhard
Answer by Andreas G. ·
Hi. There is a maximum string length capturing setting in your system profile. Check out your Agent Group/Tier and then click to Sensor Configuration. There you find that setting which defaults to 250.
Now - I think you have three options
a) capture the full String and then use a Measure Argument Measure with a RegEx to parse that revenue and use it in a BT
b) Instead of capturing the method argument as a full XML.toString() you can use the new "accessor" feature introduced in dt6 which allows you to call a method on that argument instead of just calling toString(). So - in case there is a simply get method that you can call on that method argument that would return the revenue you could do that. The limitatio here is that these accessors right now only allow you to call simple methods without parameters.
c) talk with your developers and let them call a "dummy" method where they pass the revenue as a method argumet. Define a custom sensor for that method to capture that value.
Andi
JANUARY 15, 3:00 PM GMT / 10:00 AM ET