Skip to content

Commit

Permalink
[GCP] [Billing] Improve documentation (#9931)
Browse files Browse the repository at this point in the history
* improve docs

* bump package version

* fix pr id

* add cost_type in docs

* Update packages/gcp/_dev/build/docs/billing.md

Co-authored-by: subham sarkar <[email protected]>

* Update packages/gcp/_dev/build/docs/billing.md

Co-authored-by: subham sarkar <[email protected]>

* Update packages/gcp/_dev/build/docs/billing.md

Co-authored-by: subham sarkar <[email protected]>

* Update packages/gcp/_dev/build/docs/billing.md

Co-authored-by: subham sarkar <[email protected]>

* address reviews

* Update packages/gcp/_dev/build/docs/billing.md

Co-authored-by: Arianna Laudazzi <[email protected]>

* Update packages/gcp/docs/billing.md

Co-authored-by: Arianna Laudazzi <[email protected]>

* remove newline

---------

Co-authored-by: subham sarkar <[email protected]>
Co-authored-by: Arianna Laudazzi <[email protected]>
  • Loading branch information
3 people authored Aug 12, 2024
1 parent 220004b commit 4448989
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 1 deletion.
51 changes: 51 additions & 0 deletions packages/gcp/_dev/build/docs/billing.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,57 @@ For standard usage cost data, set the table pattern format to `gcp_billing_expor

For detailed usage cost data, set the table pattern to `gcp_billing_export_resource_v1`. Detailed tables include the standard fields and additional fields, such as `effective_price`, enabling a more granular view of expenses.

## Requirements

You need Elasticsearch for storing and searching your data and Kibana for visualizing and managing it.
You can use our hosted Elasticsearch Service on Elastic Cloud, which is recommended, or self-manage the Elastic Stack on your own hardware.

Before using any GCP integration you will need:

* **GCP Credentials** to connect with your GCP account.
* **GCP Permissions** to make sure the service account you're using to connect has permission to share the relevant data.

To collect GCP Billing metrics, the following permissions are required to access the necessary data:

- `roles/bigquery.dataViewer`
- `roles/bigquery.jobUser`
- `roles/billing.viewer`

## Configuration Parameters

### dataset_id

The `dataset_id` is the unique identifier of your BigQuery dataset where your billing data is stored. You can find this ID in your Google Cloud Console under the BigQuery section.

### table_pattern

The `table_pattern` parameter allows you to specify which tables to retrieve from the specified dataset. This can be set to either `gcp_billing_export_v1` for standard usage cost data or `gcp_billing_export_resource_v1` for detailed usage cost data.

### cost_type

The `cost_type` parameter enables you to filter the cost data based on specific cost categories. You can select one of the following options:

- `regular`: This cost type includes all the regular costs associated with your usage of GCP services. This does not include any taxes, adjustments, or rounding errors.

- `tax`: This cost type includes all the taxes associated with your usage of GCP services. This does not include the regular costs, adjustments, or rounding errors.

- `adjustment`: This cost type includes any adjustments made to your billing data. Adjustments can include credits, discounts, refunds, or any other modifications to the original costs.

- `rounding_error`: This cost type includes any rounding errors that occurred when calculating your costs. These are typically very small amounts and are used to reconcile any discrepancies due to rounding.

## Example Configuration

Here's an example of what your configuration might look like:

```
dataset_id: "my_billing_dataset"
table_pattern: "gcp_billing_export_resource_v1"
project_id: "my_project"
cost_type: "regular"
```

In this example, the Agent will pull data from all tables within the `my_billing_dataset` dataset that start with the pattern `gcp_billing_export_resource_v1`.

## Sample Event

{{event "billing"}}
Expand Down
5 changes: 5 additions & 0 deletions packages/gcp/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# newer versions go on top
- version: "2.37.1"
changes:
- description: Improve GCP Billing documentation.
type: enhancement
link: https://github.com/elastic/integrations/pull/9931
- version: "2.37.0"
changes:
- description: Retain `authenticationInfo.serviceAccountKeyName` data.
Expand Down
51 changes: 51 additions & 0 deletions packages/gcp/docs/billing.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,57 @@ For standard usage cost data, set the table pattern format to `gcp_billing_expor

For detailed usage cost data, set the table pattern to `gcp_billing_export_resource_v1`. Detailed tables include the standard fields and additional fields, such as `effective_price`, enabling a more granular view of expenses.

## Requirements

You need Elasticsearch for storing and searching your data and Kibana for visualizing and managing it.
You can use our hosted Elasticsearch Service on Elastic Cloud, which is recommended, or self-manage the Elastic Stack on your own hardware.

Before using any GCP integration you will need:

* **GCP Credentials** to connect with your GCP account.
* **GCP Permissions** to make sure the service account you're using to connect has permission to share the relevant data.

To collect GCP Billing metrics, the following permissions are required to access the necessary data:

- `roles/bigquery.dataViewer`
- `roles/bigquery.jobUser`
- `roles/billing.viewer`

## Configuration Parameters

### dataset_id

The `dataset_id` is the unique identifier of your BigQuery dataset where your billing data is stored. You can find this ID in your Google Cloud Console under the BigQuery section.

### table_pattern

The `table_pattern` parameter allows you to specify which tables to retrieve from the specified dataset. This can be set to either `gcp_billing_export_v1` for standard usage cost data or `gcp_billing_export_resource_v1` for detailed usage cost data.

### cost_type

The `cost_type` parameter enables you to filter the cost data based on specific cost categories. You can select one of the following options:

- `regular`: This cost type includes all the regular costs associated with your usage of GCP services. This does not include any taxes, adjustments, or rounding errors.

- `tax`: This cost type includes all the taxes associated with your usage of GCP services. This does not include the regular costs, adjustments, or rounding errors.

- `adjustment`: This cost type includes any adjustments made to your billing data. Adjustments can include credits, discounts, refunds, or any other modifications to the original costs.

- `rounding_error`: This cost type includes any rounding errors that occurred when calculating your costs. These are typically very small amounts and are used to reconcile any discrepancies due to rounding.

## Example Configuration

Here's an example of what your configuration might look like:

```
dataset_id: "my_billing_dataset"
table_pattern: "gcp_billing_export_resource_v1"
project_id: "my_project"
cost_type: "regular"
```

In this example, the Agent will pull data from all tables within the `my_billing_dataset` dataset that start with the pattern `gcp_billing_export_resource_v1`.

## Sample Event

An example event for `billing` looks as following:
Expand Down
2 changes: 1 addition & 1 deletion packages/gcp/manifest.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: gcp
title: Google Cloud Platform
version: "2.37.0"
version: "2.37.1"
description: Collect logs and metrics from Google Cloud Platform with Elastic Agent.
type: integration
icons:
Expand Down

0 comments on commit 4448989

Please sign in to comment.