Un recurso de recopilador de datos te permite recopilar una amplia variedad de datos personalizados del tráfico de API.
Una vez que hayas creado un recopilador de datos, debes especificar los datos que deseas recopilar mediante la política DataCapture.
El recolector de datos es como un carrito de compras, y la política DataCapture es una lista de compras para los datos que deseas capturar.
Para obtener una lista de las cantidades relacionadas con el tráfico de API que puedes capturar con el recurso del recopilador de datos, consulta Métricas.
Crea un recopilador de datos
Puedes crear un recurso de recopilador de datos en la IU de Apigee o con la API de Apigee:
Apigee en la consola de Cloud
Para crear un recurso de recopilador de datos con Apigee en Cloud Console, sigue estos pasos:
Selecciona Administrador > Recopiladores de datos en el panel de navegación.
En la vista Recopiladores de datos, haz clic en Crear.
Haz clic en + Crear para abrir el cuadro de diálogo Agregar colector de datos.
Agrega la siguiente información en el diálogo:
Nombre: Es un nombre para el recolector de datos.
Tipo: el tipo de datos que se recopilarán (Integer, String, etcétera).
Descripción: Una descripción informal de los datos que se recopilarán, aunque puede incluir el motivo de la recopilación. Esto es para beneficio de otros desarrolladores de API que pueden estar involucrados en el análisis de los datos.
Haga clic en AGREGAR.
Apigee clásico
Para crear un recurso de recopilador de datos mediante la versión clásica de Apigee, haz lo siguiente:
Selecciona Administrador > Recopiladores de datos en el panel de navegación.
Se mostrará el panel de recolectores de datos.
El panel que se muestra arriba está vacío porque aún no se han creado los recopiladores de datos. En este punto, puedes crear un nuevo recopilador de datos. Una vez creados los recopiladores de datos, puedes hacer clic en sus nombres en el panel para editarlos.
Haz clic en + CREAR para abrir el cuadro de diálogo Agregar colector de datos.
Agrega la siguiente información en el diálogo:
Nombre: Es un nombre para el recolector de datos.
Tipo: el tipo de datos que se recopilarán (Integer, String, etcétera).
Descripción: Una descripción informal de los datos que se recopilarán, aunque puede incluir el motivo de la recopilación. Esto es para beneficio de otros desarrolladores de API que pueden estar involucrados en el análisis de los datos.
Haga clic en AGREGAR.
El nuevo recopilador de datos aparecerá en el panel Recopilador de datos.
Para editar o borrar un recolector de datos, haz clic en los tres puntos al final de la fila debajo de Acciones, y selecciona Editar o Borrar.
API de Apigee
Puedes crear un recurso de recopilador de datos con la API de Apigee. Por ejemplo:
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"
en el que ORG es el nombre de la organización.
Esto crea un recurso llamado dc_data_collector, que puedes usar en la política DataCapture.
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-09-04 (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."]]