cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Retrieve license consumption for a longer period of time

paulito
Frequent Guest

I've read the documentation for retrieving license consumption via API but the endpoint "/api/cluster/v2/license/consumption/hour" only retrieves the latest hour.

 

Is there a way to edit the URL to retrieve data for the last say week/month/year?

 

In the example provided in the documentation, you can specify a starting timestamp. Are there other parameters you can filter for?

 

I know I can export the data but that's in a zip file and I prefer to have updated data.

 

PS: I'm a beginner at this stuff any help is appreciated

7 REPLIES 7

ChadTurner
DynaMight Legend
DynaMight Legend

What is your scope? are you looking for overall consumption? Hosts/entities individually?

-Chad

Individual entity consumption

If you are on managed - the most precise method is to use the data in the zip file. 

For individual environment or saas I use this script to push license metric bound to individual hosts. It uses the /api/v1/oneagents API to pull consumption and then push the metric value back to the environment. Then you have the license metric in your environment and you can report consumption simply using Data Explorer by filtering on hosts or management zones as you prefer.

Also, the recent version notifies you if some of your hosts are disabled due to overconsumption.

Certified Dynatrace Master | Alanata a.s., Slovakia, Dynatrace Master Partner

The consumption data in the zip file is actually not correct. It often outputs wrong hostunit / consumption values, or at least it used to. That's one of the reasons we couldn't use it. In a support case I was told I am not to rely on that data - so I would not.

 

Same with the consumedHostUnits value in the API, this often does not reflect the real value. That was an issue since we have to get the costs of individual hosts for our actual accounting.

 

That may be fixed by now, it was a year ago, but that was an issue for us internally.

 

We ended up writing a script taking the paasMemoryLimit / zosTotalPhysicalMemory and applying the calculations ourselves depending on the mode the hosts (infrastructure, fullstack).

We never had issues with either the zip file or the API (OneAgent API). Both are reporting correct host units. I'd stay away from calculating that on your own unless you know the details such as memory tolerance. (Yes there is some tolerance). 

Certified Dynatrace Master | Alanata a.s., Slovakia, Dynatrace Master Partner

We didn't, and I even have a support call which confirms that, even with a statement made we are not to rely on that data. I'd have to re-check that though if that situation changed. We actually implemented the calculation ourselves because of that.

I am looking for Hosts/entities individually in the SAAS environment.

 

Featured Posts