cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Not a customer? Start a free trial

Click the Start a free trial link to start a 15-day SaaS trial of our product and join our community as a trial user. If you are an existing customer do not start a free trial.

AppDynamics customers and established members should click the sign in button to authenticate.

Controller (SaaS, On Premises)

JSON formatting from PowerShell REST call for transaction snapshots

Bill.Mitchell
Wanderer

JSON formatting from PowerShell REST call for transaction snapshots

I am making a REST call in PowerShell for transaction snapshots using "&need-props=true&output=json" in the url.  I get the response in the response object below:

# REST CALL

$response = Invoke-RestMethod -uri $url -Header $headers -Method Get


#VIEW RESPONSE IN JSON

$response | ConvertTo-Json

 

I have a question about the formatting of the properties fields (e.g. transactionProperties, httpParameters, etc) in the response:

 

{
"firstInChain": true,
"transactionProperties": [
"@{name=ProcessID; id=0; value=4312}",
"@{name=Content length; id=0; value=724}"
],
"errorIDs": [
11457380
],

 

Note in the array for transactionProperties, that the object strings are not in a format that I am familiar with (e.g. "@{name=ProcessID; id=0; value=4312}").  Is this proprietary to AppD?  Is it a configuration setting or something that formats it this way?

I am wanting to access the key/value pairs, but not quite sure how to do that.  I've scoured the AppD site for examples of json output to see if this is normal, but haven't found anything related to the output I am getting.

 

Any insights would be most helpful...

 

Thanks!

 

 

By replying you agree to the Terms and Conditions of the AppDynamics Community.
JSON formatting from PowerShell REST call for transaction snapshots
1 REPLY 1
Bill.Mitchell
Wanderer

As a follow up, I found that when requesting a single snapshot, the properties fields are properly formatted as expected.  It is only when requesting more than one, the formatting is different.  The same goes for metrics as well as snapshots...

 

Here is a simple example from the EUM metrics... when I query for a single metric on a singe page, it comes back in a usable format:

 

{
    "metricId":  121189479,
    "metricName":  "BTM|Application Diagnostic Data|Base Page:12463461|End User Response Time (ms)",
    "metricPath":  "End User Experience|Base Pages|web.b.ebscohost.com/ehost/search/selectdb|End User Response Time (ms)",
    "frequency":  "ONE_MIN",
    "metricValues":  [
                         {
                             "startTimeInMillis":  1562605200000,
                             "occurrences":  1,
                             "current":  675,
                             "min":  675,
                             "max":  675,
                             "useRange":  true,
                             "count":  1,
                             "sum":  675,
                             "value":  675,
                             "standardDeviation":  0
                         }
                     ]
}

However, if I query for multiple metrics from that same base page, the same metric as above comes back in non-standard format...

{
    "metricId":  121143678,
    "metricName":  "METRIC DATA NOT FOUND",
    "metricPath":  "End User Experience|Base Pages|www.ebsco.com/academic-libraries/library-technology|End User Response Time (ms)",
    "frequency":  "ONE_MIN",
    "metricValues":  [

                     ]
},
{
    "metricId":  121189479,
    "metricName":  "BTM|Application Diagnostic Data|Base Page:12463461|End User Response Time (ms)",
    "metricPath":  "End User Experience|Base Pages|web.b.ebscohost.com/ehost/search/selectdb|End User Response Time (ms)",
    "frequency":  "ONE_MIN",
    "metricValues":  [
                         "@{startTimeInMillis=1562605200000; occurrences=1; current=675; min=675; max=675; useRange=True; count=1; sum=675; value=675; standardDeviation=0}"
                     ]
},
{
    "metricId":  121145538,
    "metricName":  "METRIC DATA NOT FOUND",
    "metricPath":  "End User Experience|Base Pages|epic/departments/eissales/pages|End User Response Time (ms)",