Splunk AppDynamics

sum,count etc. are missing in the AppDynamics Python API client.get_metric method output

CommunityUser
Splunk Employee
Splunk Employee
Hi ,
When I am invoking a REST URI from the browser using an URL like the following
http://<IP>:<PORT>/controller/rest/applications/4/metric-data?metric-path=Overall%20Application%20Performance%7CNumber%20of%20Very%20Slow%20Calls&time-range-type=BEFORE_NOW&duration-in-mins=60&rollup=true
I am getting the output like the following

<metric-datas>
<metric-data>
<metricId>4226</metricId>
<metricPath>
Overall Application Performance|Number of Very Slow Calls
</metricPath>
<metricName>BTM|Application Summary|Number of Very Slow Calls</metricName>
<frequency>ONE_MIN</frequency>
<metricValues>
<metric-value>
<startTimeInMillis>1498138740000</startTimeInMillis>
<value>7</value>
<min>0</min>
<max>0</max>
<current>0</current>
<sum>7</sum>
<count>17</count>
<standardDeviation>0.0</standardDeviation>
<occurrences>0</occurrences>
<useRange>false</useRange>
</metric-value>
</metricValues>
</metric-data>
</metric-datas>
 
But when I am making the call using appdynamics python API using the following code 
 
 
from appd.request import AppDynamicsClient
client = AppDynamicsClient("<URL>", "<USERID>", "<PASSWD>")
metrics = client.get_metrics('Overall Application Performance|Number of Very Slow Calls',4,'BEFORE_NOW',60,True)
print 'metrics details ',metrics.__dict__
 
I am getting response like the following
 
metrics details  {'data': [<MetricDataSingle: _frequency=u'ONE_MIN', values=[<MetricValue: current=0, max=0, start_time_ms=1498139220000L, value=12, min=0>], path=u'Overall Application Performance|Number of Very Slow Calls'>]}
 
Here attributes like sum,count,standardDeviation,occurrences etc are missing in the python API output .
I am new to python ,so may miss something here .
Please let me know if anybody has any idea on this .
 
 
Labels (1)
Tags (4)
0 Karma

Arun_Dasetty
Super Champion

Hi,

Unfortunately i could not locate any internal docs or options for this get specific details, we suggest to use rest api for missing details

0 Karma

CommunityUser
Splunk Employee
Splunk Employee

Hi ,
I am trying to do the same but one strange thing noticed there .
If I write a sample code using the python client 

from appd.request import AppDynamicsClient
c = AppDynamicsClient('URL','group','appd@123')
for app in c.get_applications():
print app.id, app.name

It works fine .

But if I do a simple call like the following 

import requests
usr =<uid>
pwd =<pwd>
url ='http://10.201.51.40:8090/controller/rest/applications?output=JSON'
response = requests.get(url,auth=(usr,pwd))
print 'response',response

I get the following response 

response <Response [401]>

Am I doing anything wrong here ?

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...