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.
Hi All,
we're working to get metrics from appdynamics as json format.
We are in SaaS controller.
Our script:
curl -s --user 'customer@customer:password' 'https://customer.saas.appdynamics.com/controller/rest/applications/Middleware/metric-data?rollup=false&metric-path=Application%20Infrastructure%20Performance%7C*%7CIndividual%20Nodes%7C*%7CJMX%7CWeb%20Container%20Runtime%7CThreads%20Hogging%20CPU&time-range-type=BETWEEN_TIMES&start-time=1526443200000&end-time=1526450400108&duration-in-mins=15&output=json'
Where is my challenge here: I got all metrics I want (because my rollup=false) 'cause I need all collections. But, when I got the response I see this situation:
{ "metricName": "Server|Component:33111|JMX|Web Container Runtime|Threads Hogging CPU", "metricId": 41065330, "metricPath": "Application Infrastructure Performance|Pague_Aqui_OSB_M7|Individual Nodes|op2_sc2_305_01|JMX|Web Container Runtime|Threads Hogging CPU", "frequency": "ONE_MIN", "metricValues": [ { "occurrences": 1, "current": 1, "min": 1, "max": 1, "startTimeInMillis": 1526443200000, "useRange": true, "count": 1, "sum": 1, "value": 1, "standardDeviation": 0 }, { "occurrences": 1, "current": 1, "min": 1, "max": 1, "startTimeInMillis": 1526443260000, "useRange": true, "count": 1, "sum": 1, "value": 1, "standardDeviation": 0 },
I have two collect inside one metric. I should split this. I need two arrays, something like:
{ "metricName": "Server|Component:33111|JMX|Web Container Runtime|Threads Hogging CPU", "metricId": 41065330, "metricPath": "Application Infrastructure Performance|Pague_Aqui_OSB_M7|Individual Nodes|op2_sc2_305_01|JMX|Web Container Runtime|Threads Hogging CPU", "frequency": "ONE_MIN", "metricValues": [ { "occurrences": 1, "current": 1, "min": 1, "max": 1, "startTimeInMillis": 1526443200000, "useRange": true, "count": 1, "sum": 1, "value": 1, "standardDeviation": 0 }, { "metricName": "Server|Component:33111|JMX|Web Container Runtime|Threads Hogging CPU", "metricId": 41065330, "metricPath": "Application Infrastructure Performance|Pague_Aqui_OSB_M7|Individual Nodes|op2_sc2_305_01|JMX|Web Container Runtime|Threads Hogging CPU", "frequency": "ONE_MIN", "metricValues": [ "occurrences": 1, "current": 1, "min": 1, "max": 1, "startTimeInMillis": 1526443260000, "useRange": true, "count": 1, "sum": 1, "value": 1, "standardDeviation": 0 },
Any idea? It is possible?
Tks
Solved! Go to Solution.
Hi All,
we're working to get metrics from appdynamics as json format.
We are in SaaS controller.
Our script:
curl -s --user 'customer@customer:password' 'https://customer.saas.appdynamics.com/controller/rest/applications/Middleware/metric-data?rollup=false&metric-path=Application%20Infrastructure%20Performance%7C*%7CIndividual%20Nodes%7C*%7CJMX%7CWeb%20Container%20Runtime%7CThreads%20Hogging%20CPU&time-range-type=BETWEEN_TIMES&start-time=1526443200000&end-time=1526450400108&duration-in-mins=15&output=json'
Where is my challenge here: I got all metrics I want (because my rollup=false) 'cause I need all collections. But, when I got the response I see this situation:
{ "metricName": "Server|Component:33111|JMX|Web Container Runtime|Threads Hogging CPU", "metricId": 41065330, "metricPath": "Application Infrastructure Performance|Pague_Aqui_OSB_M7|Individual Nodes|op2_sc2_305_01|JMX|Web Container Runtime|Threads Hogging CPU", "frequency": "ONE_MIN", "metricValues": [ { "occurrences": 1, "current": 1, "min": 1, "max": 1, "startTimeInMillis": 1526443200000, "useRange": true, "count": 1, "sum": 1, "value": 1, "standardDeviation": 0 }, { "occurrences": 1, "current": 1, "min": 1, "max": 1, "startTimeInMillis": 1526443260000, "useRange": true, "count": 1, "sum": 1, "value": 1, "standardDeviation": 0 },
I have two collect inside one metric. I should split this. I need two arrays, something like:
{ "metricName": "Server|Component:33111|JMX|Web Container Runtime|Threads Hogging CPU", "metricId": 41065330, "metricPath": "Application Infrastructure Performance|Pague_Aqui_OSB_M7|Individual Nodes|op2_sc2_305_01|JMX|Web Container Runtime|Threads Hogging CPU", "frequency": "ONE_MIN", "metricValues": [ { "occurrences": 1, "current": 1, "min": 1, "max": 1, "startTimeInMillis": 1526443200000, "useRange": true, "count": 1, "sum": 1, "value": 1, "standardDeviation": 0 }, { "metricName": "Server|Component:33111|JMX|Web Container Runtime|Threads Hogging CPU", "metricId": 41065330, "metricPath": "Application Infrastructure Performance|Pague_Aqui_OSB_M7|Individual Nodes|op2_sc2_305_01|JMX|Web Container Runtime|Threads Hogging CPU", "frequency": "ONE_MIN", "metricValues": [ "occurrences": 1, "current": 1, "min": 1, "max": 1, "startTimeInMillis": 1526443260000, "useRange": true, "count": 1, "sum": 1, "value": 1, "standardDeviation": 0 },
Any idea? It is possible?
Tks
The format of Metric API is what you see. You can always convert JSON into form that you desire programmatically
Hi Vaibhav, really tks for your reply!
I've just made using python and pandas to do it :) It's beautiful!
Tks again
User | Count |
---|---|
9 | |
4 | |
2 | |
2 | |
1 | |
1 |
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form