Mit einer Daten-Collector-Ressource können Sie eine Vielzahl von benutzerdefinierten Daten vom API-Traffic erfassen.
Nachdem Sie einen Daten-Collector erstellt haben, geben Sie die zu erfassenden Daten mithilfe der DataCapture an.
Der Daten-Collector ist wie ein Einkaufswagen. Die DataCapture-Richtlinie ist eine Einkaufsliste für die Daten, die Sie erfassen möchten.
Eine Liste der Mengenangaben im Zusammenhang mit dem API-Traffic, den Sie mit der Data Collector-Ressource erfassen können, finden Sie unter Messwerte.
Daten-Collector erstellen
Sie können eine Datenerfassungsressource in der Apigee-Benutzeroberfläche oder mit der Apigee API erstellen:
Apigee in der Cloud Console
So erstellen Sie eine Daten-Collector-Ressource mit Apigee in der Cloud Console:
Wählen Sie im Navigationsbereich Management > Daten-Collectors aus.
Klicken Sie in der Ansicht Daten-Collectors auf Erstellen.
Klicken Sie auf + Erstellen, um das Dialogfeld Daten-Collector hinzufügen aufzurufen.
Geben Sie im Dialogfeld die folgenden Informationen ein:
Name: Ein Name für den Daten-Collector.
Typ: Der Typ der zu erfassenden Daten (Integer, String usw.).
Beschreibung: Informelle Beschreibung der zu erfassenden Daten, einschließlich des Grunds für die Erfassung. Das dient den anderen API-Entwicklern, die möglicherweise an der Datenanalyse beteiligt sind.
Klicken Sie auf HINZUFÜGEN.
Klassisches Apigee
So erstellen Sie eine Data Collector-Ressource über das klassische Apigee:
Wählen Sie im Navigationsbereich Admin > Daten-Collectors aus.
Daraufhin wird der Bereich "Daten-Collectors" angezeigt.
Der oben angezeigte Bereich ist leer, da noch keine Daten-Collectors erstellt wurden. An diesem Punkt können Sie einen neuen Daten-Collector erstellen. Nachdem einige Daten-Collectors erstellt wurden, können Sie auf ihre Namen im Fenster klicken, um sie zu bearbeiten.
Klicken Sie auf + ERSTELLEN, um das Dialogfeld Daten-Collector hinzufügen aufzurufen.
Geben Sie im Dialogfeld die folgenden Informationen ein:
Name: Ein Name für den Daten-Collector.
Typ: Der Typ der zu erfassenden Daten (Integer, String usw.).
Beschreibung: Informelle Beschreibung der zu erfassenden Daten, einschließlich des Grunds für die Erfassung. Das dient den anderen API-Entwicklern, die möglicherweise an der Datenanalyse beteiligt sind.
Klicken Sie auf HINZUFÜGEN.
Der neue Daten-Collector wird nun im Bereich "Daten-Collectors" angezeigt.
Klicken Sie zum Bearbeiten oder Löschen eines Daten-Collectors auf das Dreipunkt-Menü am Ende der Zeile unter Aktionen und wählen Sie entweder Bearbeiten oder Löschen auf Ihrem Mobilgerät.
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"
Dabei ist ORG der Name der Organisation.
Dadurch wird eine Ressource mit dem Namen dc_data_collector erstellt, die Sie in der Richtlinie DataCapture verwenden können.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 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."]]