Chapter 4. Viewing and exporting your cost data
Chapter 4. Viewing and exporting your cost data 4.1. Filtering your cost data view Tags allow you to customize your view of cost data. You can view resources by type (for example, project, node, cluster) or tag or label to investigate why certain resources show an increase in cost, or when data looks abnormal. This example shows how to see how much each OpenShift project within a cluster is costing. Prerequisites Your OpenShift cluster added as a cost management data integration. See Integrating OpenShift Container Platform data into cost management in Getting started with cost management for instructions. Your cloud infrastructure account added as a cost management data integration. See Getting started with cost management for instructions for your cloud provider type. Configure tags on your integrations. For tips and configuration instructions, see Section 3.2, "Configuring tags on your integrations" . Procedure From the OpenShift details menu, click the filter button and select Tag . In the Choose key dropdown list, select the key to filter by. For example, select environment to view clusters with the environment tag. Selecting a tag key reveals another dropdown to choose the value to filter by. In the Choose value dropdown list, select one or more values to filter by. For example, select qe and dev to show cost data for OpenShift projects with these tags. To view more information about each project: Click the arrow icon for each resource to see more information such as the cluster(s) the resource belongs to, and CPU and memory usage, limits, and requests. Click More options to reveal more viewing options: Click View price lists to see rates applied to the OpenShift metrics to calculate the costs. Click View historical data to open the daily usage comparison view, which compares usage, request, and limits by day between months for that resource. Click View all projects or View all tags to see related resources and metadata. Click Clear all filters to reset your OpenShift details view. 4.2. Grouping cost data by tag category You can group resources by tag category to further investigate your cost data. Grouping and filtering is useful for finding the root cause of a cost or problem, or investigating part of the environment that acts independently of the rest, such as a cost center or an specific environment. This allows you to hide information about the rest of the environment to help avoid unneeded complexity in cost data results and allow you to find the desired information, which can otherwise be hidden among other data. This example shows how an educational course provider who is running a lab environment on OpenShift Container Platform can use tag grouping to filter cost information by student and course. Prerequisites Your OpenShift cluster added as a cost management data integration. See Integrating OpenShift Container Platform data into cost management in Getting started with cost management for instructions. Your cloud infrastructure account added as a cost management data integration. See Getting started with cost management for instructions for your cloud provider type. Configure tags on your integrations. For tips and configuration instructions, see Section 3.2, "Configuring tags on your integrations" . Procedure From the OpenShift details page in the Group cost by: field, select the tag key to group the cost by. In this case, select Tag Key:user to show results grouped by student user. In the filter area, select Tag . In the Choose key list, select the tag key user . In the Choose value dropdown list, check the values course_id and course_type to identify how many students have taken the course X and the costs for that course. To view more information about each resource, for example, how much course X has cost: Click the arrow icon for each resource to see more information such as the cluster(s) the resource belongs to, and CPU and memory usage, limits, and requests. Click View Historical Data to open the daily usage comparison view, which compares by month the usage, request, and limits per day for that resource. Click More options to reveal more viewing options: Click View historical data to open the daily usage comparison view, which compares usage, request, and limits by day between months for that resource. Click Export data to create a .CSV file for reporting. Specify a daily or monthly aggregate and click Generate and download . Click Clear all filters to reset your OpenShift details view. 4.3. Exporting cost data to a reporting tool Tags allow you to customize your view of cost data. This is useful when you want to investigate further why certain resources show an increase in cost, or data looks abnormal. This example shows how to view data for specific OpenShift resources, and export the data to your desired reporting tool. Prerequisites Your OpenShift cluster added as a cost management data integration. See Integrating OpenShift Container Platform data into cost management in Getting started with cost management for instructions. Your cloud infrastructure account added as a cost management data integration. See Getting started with cost management for instructions for your cloud provider type. Configure tags on your integrations. For tips and configuration instructions, see Section 3.2, "Configuring tags on your integrations" . Procedure From the OpenShift details menu, click the filter button and select Tag . In the Choose key dropdown list, select the key to filter by. For example, select version . Selecting a tag key reveals another dropdown to choose the value to filter by. In the Choose value dropdown list, select one or more values to filter by. For example, select qe and dev to show cost data for OpenShift resources with these tags. To export data about your resources, check the boxes to each resource you want to export data for. Click Export to open the export options dialog. Specify a daily or monthly aggregate and click Generate and download . The CSV file will download to your local system, and you can use it in your desired reporting tool. Note You can also export your data as a .CSV file from the More options > Export data menu on each resource. Click Clear all filters to reset your OpenShift details view.