NEW OCI Cost reports and an awesome APEX app to get insight to all Usage and Cost

By | April 22, 2020

Oracle has started rolling out a new feature for Cost Reporting. For a while now daily Usage reports where available, but these reports only contained quantities of usage, like 8 hours of OCPU, but no actual $ cost.

The new daily Costs reports show the actual consumption cost of all your services! If you are not seeing the Cost reports yet, be patient 🙂

So great, you now have daily file your can download for Usage and Cost… but how do you make sense of it all???

Thanks to the great work of Adi Zohar you can dump all this data into the Oracle Autonomous Database and using APEX get a great app interface to analyze all your cost.

You can find the instruction to set this all up here:
https://github.com/oracle/oci-python-sdk/blob/master/examples/usage_reports_to_adw/step_by_step_installation.md

You can find the full code here:
https://github.com/oracle/oci-python-sdk/tree/master/examples/usage_reports_to_adw

Just to be clear, this has been created by Adi, this is not an official Oracle application. But the reports are ofcourse official OCI usage and Cost reports.

10 thoughts on “NEW OCI Cost reports and an awesome APEX app to get insight to all Usage and Cost

  1. Andre

    This even works in an Always Free tenancy. Of course there will be no cost and very little usage to show, but it is fun to do and the instructions are excellent.

    Just beware at step 7 where this variable must read 19.6 instead of 18.3:
    export CLIENT_HOME=/usr/lib/oracle/19.6/client64

    Thanks very much!

    Reply
  2. Pingback: OCI Rate Card Utility – Oracle Cloud Blog

  3. Ravi Kasibhatla

    Hi

    We are evaluating this solution and have two doubts regarding this.

    1. We have to monitor the monthly usage and costs incurred there-off to one of our clients. The client has given us one user with the usage monitoring privileges. On the other hand, we have our own OCI cloud account and we would like to deploy this solution between the OCI Cloud Tenancy of our client and our OCI Cloud account. The idea is to read the usage info from our Client Tenancy and to load that into the ADW Database with your APEX App in our OCI Tenancy. Is that possible? Because in all the detailed steps we haven’t seen where the tenancy and user connection details are being configured; we assume that you are taking those details from your Linux VM. But in the proposed solution, the ADW and the Linux VM are going to be our assets but we have to do a connection to the Client Tenancy to read the usage reports. Please clarify.

    2. Other thing is that, to bring the usage details of the tenancy before he installation of this App, (ex. I am going to install this App today, however I need to pull the usage info since he beginning of this month. How that can be achieved?

    Regards

    Reply
  4. Rohit

    Hi,
    Can i use this to present the data from the showOci scripts too?

    Reply
    1. richard Post author

      I am not sure I understand the question. But showOci is made by the same engineer i believe and outputs (in multiple formats) details about all your resources. I do not believe you can import this into the Usage APEX app.

      Reply
  5. Dhilip Kumar

    When I tried to connect, I get below error. Could you help me. I followed the same steps
    [opc@oci-usage-p ~]$ cd ADWCUSG/
    [opc@oci-usage-p ADWCUSG]$ sqlplus admin/mypasswordhere@adwcusg_low

    SQL*Plus: Release 19.0.0.0.0 – Production on Fri Aug 28 08:42:52 2020
    Version 19.6.0.0.0

    Copyright (c) 1982, 2019, Oracle. All rights reserved.

    ERROR:
    ORA-12154: TNS:could not resolve the connect identifier specified

    Enter user-name:

    Reply
  6. Jose Camacho

    When running the script python3 usage2adw.py it shows an error:

    Error Download Usage and insert to database – {‘opc-request-id’: ‘iad-1:xxxxxxxxx’, ‘code’: ‘BucketNotFound’, ‘message’: “Either the bucket named ‘ocid1.tenancy.oc1.xxx’ does not exist in the namespace ‘bling’ or you are not authorized to access it”, ‘status’: 404}

    The namespace ‘bling’ is hardcoded in the usage2adw.py file. I tried changing it to my tenana namespace but I get the same error.

    What else can I do to run correctly the usage2adw.py and finish the installation?

    Reply
  7. Rohit

    Can you please also share what specific port needs to be opened in the egress rule to get the usage2adw.py running?

    Reply
  8. Reggie Stuart

    Gentlemen, & Ladies,

    Thank you very much for this application. Following the instructions has given me a great intro to ADW, APEX, GitHub and refreshed my memory on some of the pitfalls with sqlplus and tnsnames.ora. It is an excellent starting point to for cloud work and supporting clients.

    Regards,

    Reggie Stuart

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.