Skip to content

[aws_billing] Add new aws_billing integration #14318

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

gpop63
Copy link
Contributor

@gpop63 gpop63 commented Jun 25, 2025

Summary

This PR introduces a new integration for ingesting AWS Cost and Usage Report (CUR) 2.0 data from S3 buckets. The integration uses S3 polling with a minimum 24-hour interval (default) to avoid duplicate ingestion, as AWS CUR files are cumulative and updated multiple times daily.

The integration includes an hourly ES transform that groups billing data by key dimensions (service, account, usage type, region, tags) and aggregates unblended costs. This transform deduplicates the raw CUR data by creating uniquely identifiable data points.

For future upgrades, the transform configuration will require bumping both the fleet_transform_version and the dest.index. The move_on_creation: true setting is required as it ensures the destination index becomes the only member of the alias when created, automatically removing previous indices from the alias. This allows dashboards to continue displaying the data correctly.

I tested an actual upgrade by adding a new field to the transform's group by, then bumping the fleet_transform_version and dest.index. On upgrade, a new index aws_billing.billing_latest-v2 was created and got the aws_billing.billing_latest alias. The old index aws_billing.billing_latest-v1 lost the alias. The dashboards kept working fine because they use the alias, not the specific index names.

The integration uses defaults specific for the AWS CUR usecase:

  • bucket_list_interval is set to 24h to avoid duplicate data
  • content_type defaults to text/csv, the standard CUR format
  • file_selectors defaults to \.csv\.gz$ (this doesn't work as a default yet)

Removed Configuration Options for aws-s3

I removed some config options that I thought are not relevant or applicable to this integration.

Option
expand_event_list_from_field
include_s3_metadata
max_number_of_messages
queue_url
sqs_max_receive_count
sqs_wait_time
visibility_timeout

Minor inconveniences

  • Transform name starts with logs-* for some reason, this doesn't affect the functionality
  • Unable to set file_selectors default value to \.csv\.gz$

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.
  • I have verified that any added dashboard complies with Kibana's Dashboard good practices

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Screenshots

@gpop63 gpop63 self-assigned this Jun 25, 2025
@gpop63 gpop63 added the New Integration Issue or pull request for creating a new integration package. label Jun 25, 2025
@andrewkroh andrewkroh added the dashboard Relates to a Kibana dashboard bug, enhancement, or modification. label Jun 25, 2025
@gpop63 gpop63 added the Team:Obs-InfraObs Observability Infrastructure Monitoring team [elastic/obs-infraobs-integrations] label Jun 25, 2025
@elastic-vault-github-plugin-prod

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

@gpop63 gpop63 force-pushed the enhancement/202-aws-billing-cur branch from a8077d3 to 6651b5e Compare June 26, 2025 15:33
@gpop63 gpop63 marked this pull request as ready for review June 26, 2025 17:27
@gpop63 gpop63 requested a review from a team as a code owner June 26, 2025 17:27
- custom
conditions:
kibana:
version: "^8.18.0"
Copy link
Contributor

@mykola-elastic mykola-elastic Jun 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it not meant to be supported on ^9.0.0?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the functionality we need is already available in version 8.18.0 (probably even in older versions), so unless there are significant bug fixes in the filebeat awss3 input or other stack features in general, there's no strong justification for bumping the version 🤔

we could change it to ^8.16.5 || ^9.0.0"

@andrewkroh andrewkroh added the documentation Improvements or additions to documentation. Applied to PRs that modify *.md files. label Jul 1, 2025
@gpop63
Copy link
Contributor Author

gpop63 commented Jul 2, 2025

Dashboards updated @agithomas @daniela-elastic

aws_billing_all_time png
aws_billing_current_month

@elasticmachine
Copy link

💚 Build Succeeded

History

cc @gpop63

Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dashboard Relates to a Kibana dashboard bug, enhancement, or modification. documentation Improvements or additions to documentation. Applied to PRs that modify *.md files. New Integration Issue or pull request for creating a new integration package. Team:Obs-InfraObs Observability Infrastructure Monitoring team [elastic/obs-infraobs-integrations]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants