Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Mengelola biaya log audit Akses Data
Bigtable biasanya digunakan untuk workload besar dengan volume tinggi. Akibatnya, jika Anda tidak mengelola volume log, Bigtable dapat menghasilkan log DATA_READ dan DATA_WRITE dalam jumlah yang sangat besar, sehingga menyebabkan biaya penyimpanan log yang tidak terduga tinggi. Jika menggunakan logging audit
Akses Data, Anda harus mengambil langkah-langkah untuk mengelola volume log.
Jika Anda mengikuti praktik terbaik untuk autentikasi Bigtable, sebagian besar aktivitas log audit Akses Data dihasilkan oleh akun layanan. Akun layanan adalah akun yang digunakan aplikasi untuk mengautentikasi dan melakukan panggilan API ke layanan Google Cloudseperti Bigtable. Mengelola log akun layanan adalah
langkah terpenting untuk mengurangi volume log. Anda mungkin juga ingin membatasi log
menggunakan kriteria lain.
Anda dapat mengaktifkan logging audit Akses Data untuk Bigtable dengan cara berikut:
Setelah Anda mengaktifkan logging audit, lakukan langkah-langkah berikut untuk membatasi volume log.
Mengidentifikasi akun layanan
Pertama, identifikasi akun layanan yang log-nya tidak Anda perlukan. Daftar akun layanan yang tidak berguna dan tidak boleh dicatat ke dalam log bergantung pada aplikasi dan kebutuhan bisnis Anda.Untuk mendapatkan daftar akun layanan yang memiliki izin Cloud Bigtable API (Data API), Anda dapat menelusuri kebijakan IAM untuk organisasi Anda. Anda juga dapat melihatnya di
halaman konsol Izin IAM Google Cloud
di tab Prinsipal.
Menyiapkan batasan log
Selanjutnya, siapkan batasan log Anda. Ada dua cara untuk mengelola
volume log Bigtable dengan membatasi log akun layanan. Anda dapat mengecualikan akun layanan menggunakan konfigurasi audit, atau mengecualikan log akun layanan menggunakan filter pengecualian log. Untuk setiap metode, Anda dapat menggunakan Cloud Logging API atau konsol Google Cloud .
Mengecualikan akun layanan menggunakan konfigurasi audit
Mengecualikan akun layanan menggunakan konfigurasi audit adalah
pendekatan yang direkomendasikan karena memungkinkan Anda mencegah log tertentu
dibuat sejak awal. Untuk petunjuk mendetail, lihat hal berikut:
Mengecualikan akun layanan menggunakan filter pengecualian
Filter pengecualian memungkinkan Anda menentukan log yang akan dikecualikan dari penyerapan ke bucket log. Dalam pendekatan ini, log akan dihapus setelah dibuat, sehingga log masih menimbulkan beban pemrosesan pada komponen layanan Bigtable yang menayangkan data Anda. Karena beban ini, sebaiknya gunakan konfigurasi audit. Untuk informasi selengkapnya tentang cara menyiapkan filter menggunakan
konsolGoogle Cloud dan API, lihat Membuat sink.
Memperkirakan biaya log audit Akses Data
Karena Bigtable biasanya digunakan untuk beban kerja besar dan bervolume tinggi,
Bigtable berpotensi menghasilkan log dalam jumlah yang sangat besar. Sebelum mengaktifkan logging audit Akses Data untuk Bigtable, Anda harus memperkirakan dan memahami biaya penyerapan dan penyimpanan Cloud Audit Logs yang dapat dikenakan oleh logging audit setiap bulan.
Biaya logging audit Akses Data Anda terkait langsung dengan jumlah permintaan Bigtable yang Anda pilih untuk dicatat ke dalam log setiap bulan. Tabel
berikut menunjukkan estimasi kasar biaya Cloud Audit Logs yang dapat Anda perkirakan berdasarkan
permintaan rata-rata per detik dan durasi penyimpanan log, dengan asumsi bahwa Anda mencatat semua permintaan data ke dalam log. Lihat Menghitung biaya untuk mengetahui penjelasan mendetail tentang cara penghitungan estimasi ini.
Permintaan rata-rata per detik
Waktu retensi log
Perkiraan biaya bulanan
1.000
30
$1.197
1.000
90
$1.246
10.000
30
$12.195
10.000
90
$12.684
100.000
30
$122.177
100.000
90
$124.621
Menghitung biaya
Mulailah dengan asumsi berikut:
Jumlah detik dalam sebulan rata-rata adalah sekitar 2.628.000.
Ukuran audit rata-rata adalah sekitar 1 kb.
Anda tidak akan dikenai biaya untuk 50 GiB log audit pertama yang ditransfer
per bulan, dan setelah melewati jumlah tersebut, Anda akan dikenai biaya $0,50/GiB.
Penyimpanan gratis selama 30 hari; setelah itu, Anda akan dikenai biaya $0,01/GiB untuk penyimpanan.
Metode yang dijelaskan di halaman ini memberikan estimasi kotor berdasarkan semua
traffic. Dalam produksi, sebaiknya Anda
membatasi logging akun layanan.
Menghitung volume log bulanan
Pertama, perkirakan jumlah rata-rata log yang akan dihasilkan traffic Anda dalam
bulan rata-rata.
Kumpulkan jumlah rata-rata permintaan per detik yang dikirim aplikasi Anda ke Bigtable selama sebulan.
Jika menggunakan metrik sisi klien, Anda dapat menggunakannya untuk menentukan kueri per detik (QPS) rata-rata selama sebulan terakhir.
Jika Anda lebih suka menggunakan halaman insight sistem instance di
konsolGoogle Cloud , gunakan untuk menentukan nilai rata-rata untuk permintaan
baca dan permintaan tulis per detik selama sebulan terakhir, lalu tambahkan
kedua nilai tersebut.
Kalikan permintaan per detik dengan 2.628.000 untuk mendapatkan permintaan
rata-rata per bulan.
Bagi angka tersebut dengan 10e6, atau 1.000.000. Hasilnya adalah perkiraan
volume log bulanan dalam GB yang mungkin Anda hasilkan setiap bulan.
Kalikan volume log bulanan dalam GB dengan 0,93 untuk mendapatkan perkiraan
volume log bulanan dalam GiB.
Menghitung biaya transfer
Kurangi 50 GiB dari volume log bulanan dalam GiB yang Anda hitung.
50 GiB pertama tidak dikenai biaya.
Kalikan sisanya dengan $0,50 untuk mendapatkan estimasi biaya
transfer bulanan Anda.
Menghitung biaya penyimpanan
Jika Anda berencana untuk membiarkan masa berlaku log berakhir setelah 30 hari, biaya penyimpanan Anda adalah $0,00.
Jika Anda menyimpan log selama lebih dari 30 hari, biaya penyimpanan dapat
diperkirakan dengan mengalikan volume log bulanan dengan $0,01. Biaya ini
mulai dikenakan setelah bulan pertama.
Contoh mendetail
5.000 permintaan per detik, log disimpan selama 90 hari
Dalam contoh ini, anggaplah jumlah rata-rata permintaan per detik Anda adalah
5.000 dan Anda berencana menyimpan log selama 90 hari. Dengan menggunakan langkah-langkah di halaman ini,
Anda akan menghitung estimasi berikut:
Kalikan 5.000 dengan 2.628.000 untuk mendapatkan 13.140.000.000 permintaan per bulan.
Bagi 13.140.000.000 dengan 10e6 untuk mendapatkan volume log bulanan
sebesar 13.140 GB.
Konversikan angka tersebut ke GiB dengan mengalikan 0,93 untuk mendapatkan 12 .220.
Kurangi 50 GiB dari volume log bulanan Anda untuk mendapatkan 12.170 GiB.
Kalikan dengan $0,50 untuk mendapatkan biaya penyerapan sebesar $6.085.
Untuk bulan pertama log Anda ada, biaya penyimpanannya adalah $0.
Bulan kedua, biaya penyimpanan log adalah 12.170 dikalikan dengan $0,01, atau
sekitar $122.
Setiap bulan setelah bulan kedua, biaya penyimpanan bulanan adalah dua kali
lipatnya, atau $244.
Setelah bulan kedua, perkiraan biaya logging audit Akses Data Anda
akan berkisar $6.329 per bulan.
Jika disajikan dalam bentuk persamaan, ini akan terlihat seperti (((((5.000 rps * 2.628.000
detik)/1.000.000) * 0,93) - 50 GiB) * $0,50) + $122 = $6.207.
Dalam contoh ini, biaya logging Akses Data bulanan Anda adalah sekitar $6.329 per
bulan.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-09-03 UTC."],[[["\u003cp\u003eBigtable's high-volume workloads can generate a large number of DATA_READ and DATA_WRITE logs, leading to unexpectedly high log storage costs if not managed properly.\u003c/p\u003e\n"],["\u003cp\u003eManaging service account logs is crucial for reducing log volume, as most Data Access audit log activity is generated by service accounts when following Bigtable authentication best practices.\u003c/p\u003e\n"],["\u003cp\u003eThe recommended approach to control log volume is to exempt service accounts from logging using audit configuration, as it prevents logs from being generated in the first place, unlike exclusion filters that discard logs after they're created.\u003c/p\u003e\n"],["\u003cp\u003eBefore enabling Data Access audit logging for Bigtable, it is important to estimate the potential Cloud Audit Logs ingestion and storage costs, as these costs are directly tied to the volume of Bigtable requests logged each month.\u003c/p\u003e\n"],["\u003cp\u003eYou can estimate your potential monthly log volume and costs by calculating the average requests per second multiplied by the seconds in a month, while taking into consideration free data and storage.\u003c/p\u003e\n"]]],[],null,["# Manage Data Access audit log costs\n==================================\n\n| **Key Point:** To prevent unexpected high costs, restrict service account logging.\n\nBigtable is typically used for large, high-volume workloads. As a\nresult, if you don't manage the log volume, Bigtable can generate\nan **extremely high number** of DATA_READ and DATA_WRITE logs, leading to\nunexpectedly high [log storage costs](/stackdriver/pricing#logging-costs). If you use Data Access\naudit logging, you should take steps to manage the log volume.\n\nWhen you follow the best practices for [Bigtable authentication](/bigtable/docs/authentication), most Data Access audit log activity is generated by *service\naccounts* . A [service account](/iam/docs/service-accounts) is an account that an\napplication uses to authenticate and make API calls to Google Cloud\nservices such as Bigtable. Managing service account logs is the\nmost important step to reduce log volume. You might want to also limit logs\nusing other criteria.\n\nYou can enable Data Access audit logging for Bigtable in the\nfollowing ways:\n\n- Using the Google Cloud console\n - [Individual services](/logging/docs/audit/configure-data-access#config-console) (for example, only Bigtable)\n - [Default config](/logging/docs/audit/configure-data-access#config-console-default) all services in a Google Cloud project (not just Bigtable)\n- [Using the Cloud Logging API](/logging/docs/audit/configure-data-access#config-api)\n\nAfter you enable audit logging, take the following steps to restrict the volume\nof logs.\n\nIdentify service accounts\n-------------------------\n\nFirst, identify the service accounts that you don't need logs for. The list of\nservice accounts that are not useful and should not be logged depends on your\napplication and business needs.To get a list of service accounts that have\nCloud Bigtable API (Data API) permissions, you can [search IAM\npolicies](/asset-inventory/docs/searching-iam-policies) for your organization. You can also view them on\nthe [IAM Permissions](https://console.cloud.google.com/iam-admin/iam) Google Cloud console\npage on the **Principals** tab.\n\nSet up log restrictions\n-----------------------\n\nNext, set up your log restrictions. There are two ways to manage your\nBigtable log volume by limiting service account logs. You can\neither *exempt* service accounts using audit configuration, or you can *exclude*\nservice account logs using logs exclusion filters. For each method, you can\neither use the [Cloud Logging API](/logging/docs/reference/api-overview)\nor the Google Cloud console.\n\n### Exempt service accounts using audit configuration\n\nExempting service accounts using [audit configuration](/logging/docs/audit/configure-data-access) is the\n**recommended approach** because it lets you prevent certain logs from being\ngenerated in the first place. For detailed instructions, see the following:\n\n- [Configuring Data Access audit logs with the API](/logging/docs/audit/configure-data-access#config-api)\n- [Configuring Data Access audit logs with the Google Cloud console](/logging/docs/audit/configure-data-access#config-console-exempt)\n\n### Exclude service accounts using exclusion filters\n\n[Exclusion filters](/logging/docs/routing/overview#exclusions) let you specify\nlogs to be excluded from ingestion into your logs buckets. In this approach,\nlogs are discarded *after they have been created* , so they still impose a\nprocessing load on the Bigtable service components that serve\nyour data. Because of this load, we recommend that you use audit configuration\ninstead. For more information on setting up filters using the\nGoogle Cloud console and the API, see [Create a sink](/logging/docs/export/configure_export_v2#creating_sink).\n\nEstimate Data Access audit log costs\n------------------------------------\n\nBecause Bigtable is typically used for large, high-volume workloads,\nit has the potential to generate an extremely high number of logs. Before you\nenable Data Access audit logging for Bigtable, you should estimate and\nunderstand the [Cloud Audit Logs](/logging/docs/audit) ingestion and storage costs\nthat audit logging can incur each month.\n\nYour Data Access audit logging costs are directly related to the number of\nBigtable requests that you choose to log each month. The\nfollowing table shows rough estimates of the [Cloud Audit Logs costs](/stackdriver/pricing) that you can expect based on\nyour average requests per second and the length of time that you store your\nlogs, assuming that you log all data requests. See [Calculating your costs](#calculating-costs) for a detailed explanation of how these estimates are\ncalculated.\n\nCalculate your costs\n--------------------\n\nStart with the following assumptions:\n\n- The number of seconds in an average month is about 2,628,000.\n- The average audit size is around 1 kb.\n- You are not charged for the first 50 GiB of audit logs that are ingested per month, and after you pass that amount, you're charged $0.50/GiB.\n- Storage is free for 30 days; after that you're charged $0.01/GiB for storage.\n\nThe method described on this page provides a gross estimate based on all\ntraffic. In production, you are encouraged to\n[restrict service account logging](#identify-accounts).\n| **Note:** To keep calculations simple, this page estimates log volume in GB, then converts to GiB. Cloud Logging is billed per GiB.\n\n### Calculate your monthly log volume\n\nFirst, estimate the average amount of logs your traffic will generate in an\naverage month.\n\n1. Gather the *average number of requests per second* that your application sends to Bigtable over the course of a month.\n - If you use client-side metrics, you can use them to determine your average queries per second (QPS) for the last month.\n - If you prefer to use your instance's system insights page in the Google Cloud console, use it to determine the average values for read requests and write requests per second over the last month, then add those two values together.\n2. Multiply the requests per second by 2,628,000 to get the *average\n requests per month*.\n3. Divide that number by 10e6, or 1,000,000. The result is the *estimated\n monthly log volume in GB* that you might generate each month.\n4. Multiply the monthly log volume in GB by .93 to get the approximate *monthly log volume in GiB*.\n\n### Calculate your ingestion costs\n\n1. Subtract 50 GiB from the monthly log volume in GiB that you calculated. There is no charge for the first 50 GiB.\n2. Multiply the remainder by $0.50 to arrive at your estimated monthly ingestion costs.\n\n### Calculate your storage costs\n\n1. If you plan to let your logs expire after 30 days, your cost for storage is $0.00.\n2. If you store your logs for longer than 30 days, your storage costs can be estimated by multiplying the monthly log volume by $0.01. These costs start to incur after the first month.\n\nDetailed example\n----------------\n\n### 5,000 request per second, logs retained for 90 days\n\nIn this example, suppose that your average number of requests per second is\n5,000 and you plan to keep your logs for 90 days. Using the steps on this page,\nyou calculate the following estimates:\n\n- Multiply 5,000 by 2,628,000 to arrive at 13,140,000,000 requests per month.\n- Divide 13,140,000,000 by 10e6 to arrive at roughly 13,140 GB of monthly log volume.\n- Convert that number to GiB by multiplying it by .93 to arrive at 12,220.\n- Subtract 50 GiB from your monthly log volume to get 12,170 GiB.\n- Multiply by $0.50 to get $6,085 in ingestion costs.\n- For the first month that your logs exist, the storage cost is $0.\n- The second month, the log storage cost is 12,170 multiplied by $0.01, or about $122.\n- Every month after the second month, the monthly storage cost is double that, or $244.\n- After the second month, your estimated Data Access audit logging costs would be around $6,329 per month.\n\nPresented in equation form, this looks like (((((5,000 rps \\* 2,628,000\nsec)/1,000,000) \\* .93) - 50 GiB) \\* $0.50) + $122 = $6,207.\n\nIn this example, your monthly Data Access logging costs are around **$6,329 per\nmonth**.\n\nWhat's next\n-----------\n\n- [See what a Data Access audit log entry looks like.](/bigtable/docs/audit-log-example)"]]