Skip to content

Commit 46798a0

Browse files
Merge pull request #135 from oracle-devrel/lift-tenancy-cost-usage
lift-tenancy-usage-cost-reports
2 parents 1ba633a + 96feae4 commit 46798a0

File tree

9 files changed

+186
-0
lines changed

9 files changed

+186
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
2+
Copyright (c) 2023 Oracle and/or its affiliates.
3+
4+
The Universal Permissive License (UPL), Version 1.0
5+
6+
Subject to the condition set forth below, permission is hereby granted to any
7+
person obtaining a copy of this software, associated documentation and/or data
8+
(collectively the "Software"), free of charge and under any and all copyright
9+
rights in the Software, and any and all patent rights owned or freely
10+
licensable by each licensor hereunder covering either (i) the unmodified
11+
Software as contributed to or provided by such licensor, or (ii) the Larger
12+
Works (as defined below), to deal in both
13+
14+
(a) the Software, and
15+
(b) any piece of software and/or hardware listed in the lrgrwrks.txt file if
16+
one is included with the Software (each a "Larger Work" to which the Software
17+
is contributed by such licensors),
18+
19+
without restriction, including without limitation the rights to copy, create
20+
derivative works of, display, perform, and distribute the Software and make,
21+
use, sell, offer for sale, import, export, have made, and have sold the
22+
Software and the Larger Work(s), and to sublicense the foregoing rights on
23+
either these or other terms.
24+
25+
This license is subject to the following condition:
26+
The above copyright notice and either this complete permission notice or at
27+
a minimum a reference to the UPL must be included in all copies or
28+
substantial portions of the Software.
29+
30+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
31+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
32+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
33+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
34+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
35+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
36+
SOFTWARE.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Tenancy Usage and Cost Reports
2+
3+
Usage2ADW is a tool that uses the Python SDK to extract the usage and cost reports from OCI tenancy and load them to Oracle Autonomous Database. It is an extension of OCI's native Billing & Cost management capabilities, to provide customers with a granular understanding of their spending and utilization of OCI. Using ADW and OAC features, this solution can provide a high-level overview, in-depth spending analysis, resource utilization trends, and forecast.
4+
5+
OCI automatically generates usage data and is stored in an Oracle-owned Object Storage bucket. It contains one row per each OCI resource per hour along with consumption information, metadata, namespace, and tags. Usage2ADW load this data to the ADW database and OAC visualizations can be created on top of this database.
6+
7+
# When to use this asset?
8+
9+
Usage2ADW provides customers granular understanding of their spending and utilization of OCI. This solution provides an in-depth spending analysis on OCI. It includes a high-level overview for executives, resource and cost trends for line of business application owners, trends in resource utilization, and more. Usage2ADW is ideal for self-service analysis and allows users to build their own visualizations and enrich the analysis by bringing in their own data like departmental budgets.
10+
11+
Customers can leverage a management module to securely retrieve their tenancy cost and usage data. The module can also be configured to retrieve multiple OCI tenancies data for analysis. This solution extends the core Usage2ADW solution with integration to retrieve usage and cost metrics from other sources, in particular from OEM for the customer on-premises database estate.
12+
13+
This asset will provide the following key features and benefits:
14+
15+
1) Load Usage Report to ADW.
16+
2) Load Cost Reports to ADW.
17+
3) Load Public Rates to ADW.
18+
4) Report Usage Current State.
19+
5) Report Usage Over Time.
20+
6) Report Cost Analysis.
21+
7) Report Cost Over Time.
22+
8) Report Rate Card for Used Products.
23+
24+
# How to use this asset?
25+
26+
Here is an overview of how to use this asset:
27+
28+
Step 1: Provision ADW, OAC, and a VM on Oracle cloud.
29+
Step 2: Deploy Usage2ADW scripts on VM.
30+
Step 3: Upload and restore the catalog file on OAC.
31+
Step 4: Create necessary connections between OCI, ADW, and OAC.
32+
Step 5: Refresh the OAC dashboard to retrieve your tenancy usage and cost details.
33+
34+
Note: Usage2ADW can be downloaded from https://github.com/oracle/oci-python-sdk/tree/master/examples/usage_reports_to_adw
35+
36+
37+
## License
38+
Copyright (c) 2023 Oracle and/or its affiliates.
39+
Licensed under the Universal Permissive License (UPL), Version 1.0.
40+
See [LICENSE](LICENSE) for more details.
88 KB
Loading
105 KB
Loading
55.9 KB
Loading
92.9 KB
Loading
123 KB
Loading
106 KB
Loading
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
# Introduction
2+
3+
Usage2ADW is a tool that uses the Python SDK to extract the usage and cost reports from OCI tenancy and load them to Oracle Autonomous Database. It is an extension of OCI's native Billing & Cost management capabilities, to provide customers with a granular understanding of their spending and utilization of OCI. Using ADW and OAC features, this solution can provide a high-level overview, in-depth spend analysis, resource utilization trends, and forecast.
4+
5+
OCI automatically generates usage data and is stored in an Oracle-owned Object Storage bucket. It contains one row per each OCI resource per hour along with consumption information, metadata, namespace, and tags. Usage2ADW load this data to the ADW database and OAC visualizations can be created on top of this database.
6+
7+
## Required technical skills
8+
9+
- Python scripting.
10+
- Oracle SQL.
11+
- Oracle Analytics Cloud (OAC).
12+
- Application Express (Apex).
13+
14+
## OCI APIs Used
15+
16+
- IdentityClient.list_compartments - Policy COMPARTMENT_INSPECT
17+
- IdentityClient.get_tenancy - Policy TENANCY_INSPECT
18+
- ObjectStorageClient.list_objects - Policy OBJECT_INSPECT
19+
- ObjectStorageClient.get_object - Policy OBJECT_READ
20+
21+
## SDK Modules Used
22+
23+
- oci.identity.IdentityClient
24+
- oci.object_storage.ObjectStorageClient
25+
26+
## OCI Resources Used
27+
28+
- Compute VM: The compute VM houses the install script to create the required data structures and installs the package and Apex application. All data integrations to retrieve OCI information and load it into ADW tables are run on the compute VM.
29+
30+
- Oracle Analytics Cloud: OAC instance will contain Dashboards and Visualization of the cost and usage reports.
31+
32+
- Autonomous Data Warehouse: ADW instance will be used to store and process the cost and usage data and effectively support a data mart that will provide usage and cost visibility of the tenancy and different dimensions like tenancy, region, project, and environments.
33+
34+
- ADW Private Endpoint: PE is used in order that ADW to be deployed on a private subnet and hence be only accessible from a private connection and not from the internet.
35+
36+
- AC Private Access Channel: PAC provides connectivity to private databases from Oracle Analytics Cloud. It will enable a private endpoint in a private subnet of the Virtual Cloud Network (VCN) of OCI that will let OAC query the private ADW using the private endpoint of ADW.
37+
38+
## Main features:
39+
40+
- Load Usage Report to ADW.
41+
- Load Cost Reports to ADW.
42+
- Load Public Rates to ADW.
43+
- Report Usage Current State.
44+
- Report Usage Over Time.
45+
- Report Cost Analysis.
46+
- Report Cost Over Time.
47+
- Report Rate Card for Used Products.
48+
49+
# Business Value
50+
51+
With Usage2ADW, the customer will enjoy the benefits of an analytics platform with dashboards and data visualizations that provide cost by OCI Resources, PaaS, and IaaS services and can be grouped by regions, compartments, etc. for budgetary purposes and chargeback. The analysis can be personalized by application, or department, based on custom tags. Additionally, performance monitoring and utilization metrics will be available for applications running on OCI compute instances.
52+
53+
## Use case
54+
55+
When the extension Usage2ADW is implemented, the user through a dashboard will be able to visualize usage and cost reports over the dimension values. The Tag Namespace and Keys can be used to classify and group resources for Usage and Costing visibility.
56+
The Usage and Cost Reports provide customers granular understanding of their spending and utilization of OCI. This solution provides an in-depth spend analysis on OCI. It includes a high-level overview for executives, resource and cost trends for line of business application owners, trends in resource utilization, and more. Usage2ADW is ideal for self-service analysis and allows users to build their own visualizations and enrich the analysis by bringing in their own data like departmental budgets. Customers can leverage a management module to securely retrieve their tenancy cost and usage data. The module can also be configured to retrieve multiple OCI tenancies data for analysis. This solution extends the core Usage2ADW solution with integration to retrieve usage and cost metrics from other sources, in particular from OEM for the customer on-prem database estate.
57+
58+
The implemented solution satisfies a broader set of functional requirements:
59+
60+
- Provides the cost of a specific instance.
61+
- Plot the cost evolution of a specific project over 1, 3, 6, 12, 24 months.
62+
- Plot the usage evolution of a specific instance per day & month.
63+
- View the current global consumption.
64+
- Predict the consumption.
65+
- Plan the budget in a better way.
66+
67+
68+
The solution can also be extended with the following set of capabilities using OCI Tags and drill-down features:
69+
70+
- Extract and Load OCI Tags and Resource Identifiers into the database.
71+
- Define Meta-Data information about OCI Tags on OCI Resource Identifiers.
72+
- Data model for Oracle Analytics Cloud (OAC), extended tables for Tags, Meta-Data, and Resource Identifying tables.
73+
- Custom Canvas/Report in OAC based on the Data Model with drill-down capabilities.
74+
75+
## Sample visualizations
76+
77+
Below are a few visualizations that can be derived out of OCI usage data, using Usage2ADW.
78+
79+
![Alt text](image.png)
80+
81+
Figure 1. Representation of total cost incurred by compartments over a period of time.
82+
83+
![Alt text](image-1.png)
84+
85+
Figure 2. Representation of total cost incurred by services over a period of time.
86+
87+
![Alt text](image-2.png)
88+
89+
Figure 3. Representation of Oracle CPU usage in hours by compartments.
90+
91+
![Alt text](image-3.png)
92+
93+
Figure 4. Representation of running hours of each resource.
94+
95+
![Alt text](image-4.png)
96+
97+
Figure 5. Representation of profit earned each month and forecast for future months.
98+
99+
![Alt text](image-5.png)
100+
101+
102+
Figure 6. Representation of cost incurred each month.
103+
104+
105+
106+
107+
108+
109+
110+

0 commit comments

Comments
 (0)