Resource
pengumpul data memungkinkan Anda mengumpulkan berbagai macam data kustom dari traffic API.
Setelah membuat pengumpul data, Anda menentukan data yang ingin dikumpulkan menggunakan kebijakan
DataCapture.
Pengumpul data seperti keranjang belanja, dan kebijakan DataCapture adalah daftar belanja
untuk data yang ingin Anda ambil.
Untuk mengetahui daftar kuantitas terkait traffic API yang dapat Anda ambil
menggunakan resource pengumpul data, lihat
Metrik.
Membuat pengumpul data
Anda dapat membuat resource pengumpul data di UI Apigee atau dengan Apigee API:
Apigee di Konsol Cloud
Untuk membuat resource pengumpul data menggunakan Apigee di Konsol Cloud:
Di konsol Google Cloud , buka halaman Pengelolaan > Pengumpul Data.
Di dialog Tambahkan pengumpul data, masukkan informasi berikut:
Nama: Nama untuk pengumpul data.
Jenis: Jenis data yang akan dikumpulkan (Integer, String,
dan sebagainya).
Deskripsi: Deskripsi informal data yang akan dikumpulkan, yang mungkin
mencakup alasan pengumpulannya. Hal ini dilakukan untuk kepentingan
developer API lain yang mungkin terlibat dalam menganalisis data.
Klik Tambahkan.
Apigee Klasik
Untuk membuat resource pengumpul data menggunakan Apigee Klasik:
Tindakan ini akan menampilkan panel Pengumpul Data.
Panel yang ditampilkan di atas kosong karena belum ada pengumpul data yang dibuat. Pada
tahap ini, Anda dapat membuat pengumpul data baru. Setelah beberapa pengumpul data dibuat, Anda dapat mengklik namanya di panel untuk mengeditnya.
Klik + BUAT untuk menampilkan dialog Tambahkan pengumpul data.
Tambahkan informasi berikut dalam dialog:
Nama: Nama untuk pengumpul data.
Jenis: Jenis data yang akan dikumpulkan (Integer, String,
dan sebagainya).
Deskripsi: Deskripsi informal data yang akan dikumpulkan, yang mungkin
mencakup alasan pengumpulannya. Hal ini dilakukan untuk kepentingan
developer API lain yang mungkin terlibat dalam menganalisis data.
Klik Tambahkan.
Pengumpul data baru kini muncul di panel Pengumpul data.
Untuk mengedit atau menghapus pengumpul data, klik tiga titik di akhir
barisnya di bagian Tindakan,
lalu pilih Edit atau Hapus.
Apigee API
Anda dapat membuat resource
pengumpul data menggunakan Apigee API. Contoh:
curl -H "Authorization: Bearer $(gcloud auth print-access-token)" -X POST -H "content-type:application/json" \
-d '
{
"name": "dc_data_collector",
"description": "Collects data for analysis.",
"type": "STRING",
}' \
"https://apigee.googleapis.com/v1/organizations/ORG/datacollectors"
dengan ORG adalah nama organisasi.
Tindakan ini akan membuat resource bernama dc_data_collector, yang dapat Anda gunakan dalam kebijakan DataCapture.
[[["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-05 UTC."],[[["\u003cp\u003eData collector resources in Apigee and Apigee hybrid allow for the collection of custom data from API traffic, functioning like a shopping cart for data.\u003c/p\u003e\n"],["\u003cp\u003eThe DataCapture policy specifies the data to be collected, serving as a shopping list, and works in conjunction with the data collector.\u003c/p\u003e\n"],["\u003cp\u003eData collectors can be created through the Apigee UI (both Apigee in Cloud console and Classic Apigee) or via the Apigee API.\u003c/p\u003e\n"],["\u003cp\u003eData collector names must start with \u003ccode\u003edc_\u003c/code\u003e, and creating collectors with names that only differ in case is prohibited due to potential errors.\u003c/p\u003e\n"],["\u003cp\u003eIf a Data collector is used in multiple policies, the last policy to run will overwrite any captured data from earlier executions.\u003c/p\u003e\n"]]],[],null,["# Managing Data Collectors\n\n*This page\napplies to **Apigee** and **Apigee hybrid**.*\n\n\n*View [Apigee Edge](https://docs.apigee.com/api-platform/get-started/what-apigee-edge) documentation.*\n\nA\n[data collector](/apigee/docs/reference/apis/apigee/rest#rest-resource:-v1.organizations.datacollectors) resource enables you to collect a wide variety of custom data from API traffic.\nOnce you have created a data collector, you specify the data you want to gather using the\n[DataCapture](/apigee/docs/api-platform/reference/policies/data-capture-policy) policy.\nThe data collector is like a shopping cart, and the DataCapture policy is a shopping list\nfor the data you want to capture.\n| **Note:** If you use a data collector in multiple policies, the captured data will be overwritten by the last policy that executes.\n\nFor a list of the quantities related to API traffic that you can capture\nusing the data collector resource, see\n[Metrics](/apigee/docs/api-platform/analytics/analytics-reference).\n\nCreating a data collector\n-------------------------\n\nYou can create a data collector resource in the Apigee UI or with the Apigee API: \n\n### Apigee in Cloud console\n\nTo create a data collector resource using Apigee in Cloud console:\n\n1. In the Google Cloud console, go to the **Management \\\u003e Data Collectors** page.\n\n [Go to Data Collectors](https://console.cloud.google.com/apigee/datacollectors)\n2. In the **Data Collectors** view, click **Create**.\n3. In the **Add data collector** dialog, enter the following information:\n - **Name** : A name for the data collector. **Note:** The name for a data collector must begin with `dc_`.\n | **Warning:** Do *not* create two data collectors whose names differ only by case, such as `dc_my_data` and `dc_My_Data`, as then exporting data will result in a \"duplicate column names\" error.\n - **Type** : The type of the data to be collected (`Integer`, `String`, and so on).\n - **Description**: An informal description of the data to be collected, possibly including the reason for collecting it. This is for the benefit of other API developers who may be involved in analyzing the data.\n4. Click **Add**.\n\n### Classic Apigee\n\nTo create a data collector resource using the Classic Apigee:\n\n1. Open the [Apigee UI](https://apigee.google.com) in a browser.\n2. Select **Admin \\\u003e Data Collectors** in the navigation pane.\n\n This displays the Data Collectors pane.\n\n The pane shown above is empty because no data collectors have been created yet. At\n this point, you can create a new data collector. Once some data collectors have been\n created, you can click their names in the pane to edit them.\n3. Click **+ CREATE** to display the **Add data collector** dialog.\n\n4. Add the following information in the dialog:\n - **Name** : A name for the data collector. **Note:** The name for a data collector must begin with `dc_`.\n | **Note:** Do *not* create two data collectors whose names differ only by case, such as `dc_my_data` and `dc_My_Data`, as then exporting data will result in a \"duplicate column names\" error.\n - **Type** : The type of the data to be collected (`Integer`, `String`, and so on).\n - **Description**: An informal description of the data to be collected, possibly including the reason for collecting it. This is for the benefit of other API developers who may be involved in analyzing the data.\n5. Click **Add**.\n\nThe new data collector now appears in the Data collector pane.\n\n\nTo edit or delete a data collector, click the three dots at the end\nof its row under **Actions** ,\nand select either **Edit** or **Delete**.\n\n### Apigee API\n\nYou can create a [data collector](/apigee/docs/reference/apis/apigee/rest/v1/organizations.datacollectors) resource using the Apigee API. For example: \n\n```\ncurl -H \"Authorization: Bearer $(gcloud auth print-access-token)\" -X POST -H \"content-type:application/json\" \\\n -d '\n{\n \"name\": \"dc_data_collector\",\n \"description\": \"Collects data for analysis.\",\n \"type\": \"STRING\",\n}' \\\n \"https://apigee.googleapis.com/v1/organizations/ORG/datacollectors\"\n```\n\nwhere \u003cvar translate=\"no\"\u003eORG\u003c/var\u003e is the name of the organization.\nThis creates a resource named `dc_data_collector`, which you can use in\nthe [DataCapture](/apigee/docs/api-platform/reference/policies/data-capture-policy) policy.\n| **Notes:**\n|\n| - The name of the data collector resource must begin with the prefix `dc_`.\n| - If you use a data collector in multiple DataCapture policies, the captured data will be overwritten by the last policy that executes.\n| **Warning:** Do *not* create two data collectors whose names differ only by case, such as `dc_my_data` and `dc_My_Data`, as then exporting data will result in a \"duplicate column names\" error."]]