Crea una instancia para la supervisión y el registro del agente de operaciones
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
El Agente de operaciones recopila datos de telemetría de las instancias que puedes usar para solucionar problemas y ajustar el rendimiento.
Antes de comenzar
Si aún no lo hiciste, configura la autenticación.
La autenticación es el proceso mediante el cual se verifica tu identidad para acceder a los servicios y las APIs de Google Cloud .
Para ejecutar código o muestras desde un entorno de desarrollo local, puedes autenticarte en Compute Engine seleccionando una de las siguientes opciones:
Select the tab for how you plan to use the samples on this page:
Console
When you use the Google Cloud console to access Google Cloud services and
APIs, you don't need to set up authentication.
gcloud
Instala Google Cloud CLI.
Después de la instalación,
inicializa Google Cloud CLI ejecutando el siguiente comando:
Si deseas obtener más información, consulta Autentica para usar REST en la Google Cloud documentación de autenticación.
Roles obligatorios
Para obtener los permisos que
necesitas para crear una instancia para el registro y la supervisión del agente de operaciones,
pídele a tu administrador que te otorgue los
siguientes roles de IAM en el proyecto:
Crea una instancia para la supervisión y el registro del agente de operaciones
Solo puedes crear una instancia configurada para la supervisión y el registro del agente de operaciones con la consola de Google Cloud . En esta sección, se describe brevemente cómo instalar el Agente de operaciones mientras se crea una instancia. Para obtener más información, consulta Instala el agente de operaciones durante la creación de la instancia.
En la consola de Google Cloud , ve a la página Crear una instancia.
Si se te solicita, selecciona el proyecto y haz clic en Continuar.
Aparecerá la página Crear una instancia y se mostrará el panel Configuración de la máquina.
En el panel de navegación, haz clic en Observabilidad. Aparecerá el panel Observabilidad.
En la sección Agente de operaciones, selecciona la casilla de verificación Instalar el Agente de operaciones para Monitoring y Logging.
Si seleccionas esta casilla de verificación, se habilitará VM Manager en modo de capacidad limitada y se creará una asignación de política del SO para instalar el Agente de operaciones en la instancia.
Para crear y, luego, iniciar la instancia, haz clic en Crear.
Instala el Agente de operaciones en instancias existentes
Puedes usar la Google Cloud consola, gcloud CLI o una herramienta de automatización para instalar el agente de operaciones en una flota de instancias o en instancias individuales.
Si deseas obtener instrucciones detalladas, consulta Instala el agente de operaciones.
[[["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-08-19 (UTC)"],[[["\u003cp\u003eThe Ops Agent collects telemetry data for instances, aiding in troubleshooting and performance tuning.\u003c/p\u003e\n"],["\u003cp\u003eAuthentication to Google Cloud services and APIs is necessary, and can be done through the Google Cloud console, gcloud CLI, or REST API.\u003c/p\u003e\n"],["\u003cp\u003eCreating an instance for Ops Agent monitoring and logging can be done via the Google Cloud console by enabling the "Install the Ops Agent for Monitoring and Logging" option during instance creation.\u003c/p\u003e\n"],["\u003cp\u003eThe Ops Agent can also be installed on existing instances using the Google Cloud console, gcloud CLI, or an automation tool.\u003c/p\u003e\n"],["\u003cp\u003eTo install the agent, required roles include Compute Instance Admin (v1) and OSPolicyAssignment Editor.\u003c/p\u003e\n"]]],[],null,["*** ** * ** ***\n\nThe [Ops Agent](/stackdriver/docs/solutions/agents/ops-agent) collects telemetry data for instances that you can then use for troubleshooting and performance tuning.\n\nBefore you begin\n\n- If you haven't already, set up [authentication](/compute/docs/authentication). Authentication verifies your identity for access to Google Cloud services and APIs. To run code or samples from a local development environment, you can authenticate to Compute Engine by selecting one of the following options:\n\n Select the tab for how you plan to use the samples on this page: \n\n Console\n\n\n When you use the Google Cloud console to access Google Cloud services and\n APIs, you don't need to set up authentication.\n\n gcloud\n 1.\n [Install](/sdk/docs/install) the Google Cloud CLI.\n\n After installation,\n [initialize](/sdk/docs/initializing) the Google Cloud CLI by running the following command:\n\n ```bash\n gcloud init\n ```\n\n\n If you're using an external identity provider (IdP), you must first\n [sign in to the gcloud CLI with your federated identity](/iam/docs/workforce-log-in-gcloud).\n | **Note:** If you installed the gcloud CLI previously, make sure you have the latest version by running `gcloud components update`.\n 2. [Set a default region and zone](/compute/docs/gcloud-compute#set_default_zone_and_region_in_your_local_client).\n\n REST\n\n\n To use the REST API samples on this page in a local development environment, you use the\n credentials you provide to the gcloud CLI.\n 1. [Install](/sdk/docs/install) the Google Cloud CLI. After installation, [initialize](/sdk/docs/initializing) the Google Cloud CLI by running the following command: \n\n ```bash\n gcloud init\n ```\n 2. If you're using an external identity provider (IdP), you must first [sign in to the gcloud CLI with your federated identity](/iam/docs/workforce-log-in-gcloud).\n\n\n For more information, see\n [Authenticate for using REST](/docs/authentication/rest)\n in the Google Cloud authentication documentation.\n\nRequired roles\n\n\nTo get the permissions that\nyou need to create an instance for Ops Agent monitoring and logging,\n\nask your administrator to grant you the\nfollowing IAM roles on the project:\n\n- [Compute Instance Admin (v1)](/iam/docs/roles-permissions/compute#compute.instanceAdmin.v1) (`roles/compute.instanceAdmin.v1`)\n- To install the Ops Agent on the instance: [OSPolicyAssignment Editor](/iam/docs/roles-permissions/osconfig#osconfig.osPolicyAssignmentEditor) (`roles/osconfig.osPolicyAssignmentEditor`)\n\n\nFor more information about granting roles, see [Manage access to projects, folders, and organizations](/iam/docs/granting-changing-revoking-access).\n\n\nYou might also be able to get\nthe required permissions through [custom\nroles](/iam/docs/creating-custom-roles) or other [predefined\nroles](/iam/docs/roles-overview#predefined).\n\nCreate an instance for the Ops Agent monitoring and logging\n\nYou can create an instance that's configured for Ops Agent monitoring and\nlogging only by using the Google Cloud console. This section briefly describes how\nto install the Ops Agent while creating an instance. For more information, also\nsee [Install Ops Agent during instance creation](/stackdriver/docs/solutions/agents/ops-agent/install-agent-vm-creation).\n\n1. In the Google Cloud console, go to the **Create an instance** page.\n\n [Go to Create an instance](https://console.cloud.google.com/compute/instancesAdd)\n\n If prompted, select your project and click **Continue**.\n\n The **Create an instance** page appears and displays the\n **Machine configuration** pane.\n2. In the navigation pane, click **Observability** . The **Observability**\n pane appears.\n\n3. In the **Ops Agent** section, select the\n **Install the Ops Agent for Monitoring and Logging** checkbox.\n\n Selecting this checkbox enables VM Manager in limited\n capability mode and it creates an OS policy assignment for installing\n Ops Agent on the instance.\n4. Optional: Specify other configuration options. For more information, see\n [Configuration options during instance creation](/compute/docs/instances/instance-creation-overview#new-instance-configuration-options).\n\n5. To create and start the instance, click **Create**.\n\nInstall the Ops Agent on existing instances\n\nYou can use the Google Cloud console, the gcloud CLI, or an automation\ntool to install Ops Agent on a fleet of instances or on individual instances.\nFor detailed instructions, see\n[Install the Ops Agent](/stackdriver/docs/solutions/agents/ops-agent/install-index).\n| **Note:** If you install the Ops Agent, then you might be charged for the metrics and logs that the agent sends to your Google Cloud project. For more information, see [Google Cloud Observability pricing](/stackdriver/pricing).\n\nWhat's next\n\n- Learn how to [check the status of an instance](/compute/docs/instances/instance-life-cycle) to see when it is ready to use.\n- Learn how to [connect to your instance0](/compute/docs/instances/connecting-to-instance)."]]