Not a customer? Click the 'Start a free trial' link to begin a 30-day SaaS trial of our product and to join our community.
Existing Cisco AppDynamics customers should click the 'Sign In' button to authenticate to access the community
08-03-2020 02:45 AM
Hey guys,
Recently I found an issue when using the AppDynamics API to retrieve metrics or events on a LITE account. I know about the restriction on the last 1440 minutes and I comply with it by requesting data for less that.
However the API still returns the 400 error with body:
"HTTP Status 400 - For LITE Account only last 1440 minutes of data could be extracted"
It is weird because I request less than the limit, for example the request that I use is:
GET /controller/rest/applications/9077/metric-data?output=JSON&metric-path=Overall+Application+Performance%7C*&time-range-type=BETWEEN_TIMES&start-time=1596446430281&end-time=1596446434281&rollup=false HTTP/1.1
The time range defined between the start-time and end-time parameters is only a few seconds and it is just a minute in the past relative to the time of initiating the request, so it fits in the limit of last 1440 minutes, however I still have the error...
If I try to request data using the BEFORE_NOW parameter, like:
GET /controller/rest/applications/9077/metric-data?output=JSON&metric-path=Overall+Application+Performance%7C*&time-range-type=BEFORE_NOW&duration-in-mins=10&rollup=false HTTP/1.1
I get successful response.
BUT I don't see anywhere on the documentation that the
I did look on the documentation and I don't BETWEEN_TIMES time range type is not supported on LITE accounts.
So bottom line the questions is why the BETWEEN_TIMES range type does not work on my LITE account?
Solved! Go to Solution.
08-03-2020 06:32 AM
Hi
As per the documentation, you can only access the last 1440 minutes of data.
The start and end dates cannot be used when using accessing the data via that API call from what I know, if on LITE version.
On a side note, if you use developer options in your browser, in the UI by setting start & end date e.g in metric browser, it should possibly give you a working query you can maybe use if you really need to use start and end dates.
As you only have access to the last 1440 minutes, is there a reason you are trying to use start & end dates?
08-04-2020 03:22 AM
Hi Mario,
Thanks for your comment, I had another look on the UI, inspecting the requests through the developer console and what I found is that on LITE account, on the Metric Browser page the Custom time range is not available. So the queries are only with BEFORE_NOW time range type.
If I check the same on a PRO instance, I have the Custom time frame on the UI and the request on the background is actually using BETWEEN_TIMES parameter.
So I tend to agree that the BETWEEN_TIMES parameter is actually not allowed for LITE version, though it is not clearly stated... It would make much more sense to either get a more descriptive error from the API or at least note it in the documentation.
And just to comment, the use case I need the start/end time for is an integration. So using the start/end parameters on scheduled queries is the best way from integration perspective. Using the last n could cause either performance issues or gaps in the data.
Another thing I noticed by inspecting the network requests is that the frontend is using a match better API request for retrieving the metrics data
THanks,
Lyubo
Thank you! Your submission has been received!
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form