Melihat latensi permintaan aplikasi

Pelajari cara mengumpulkan dan melihat data latensi dari aplikasi Anda:

  1. Buat cluster Google Kubernetes Engine (GKE) menggunakan Google Cloud CLI.

  2. Download dan deploy aplikasi contoh ke cluster Anda.

  3. Buat trace dengan mengirim permintaan HTTP ke aplikasi contoh.

  4. Lihat informasi latensi trace yang Anda buat.

  5. Jalankan pembersihan.


Untuk mengikuti panduan langkah demi langkah untuk tugas ini langsung di Google Cloud konsol, klik Pandu saya:

Pandu saya


Sebelum memulai

  1. Batasan keamanan yang ditentukan oleh organisasi mungkin mencegah Anda menyelesaikan langkah-langkah berikut. Untuk mengetahui informasi pemecahan masalah, lihat Mengembangkan aplikasi di lingkungan yang terbatas. Google Cloud

  2. Login ke akun Anda. Google Cloud Jika Anda baru menggunakan Google Cloud, buat akun untuk mengevaluasi performa produk kami dalam skenario dunia nyata. Pelanggan baru juga mendapatkan kredit gratis senilai $300 untuk menjalankan, menguji, dan men-deploy workload.
  3. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  4. If you're using an existing project for this guide, verify that you have the permissions required to complete this guide. If you created a new project, then you already have the required permissions.

  5. Verify that billing is enabled for your Google Cloud project.

  6. Enable the Google Kubernetes Engine and Cloud Trace APIs.

    Roles required to enable APIs

    To enable APIs, you need the serviceusage.services.enable permission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). Learn how to grant roles.

    Enable the APIs

  7. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  8. If you're using an existing project for this guide, verify that you have the permissions required to complete this guide. If you created a new project, then you already have the required permissions.

  9. Verify that billing is enabled for your Google Cloud project.

  10. Enable the Google Kubernetes Engine and Cloud Trace APIs.

    Roles required to enable APIs

    To enable APIs, you need the serviceusage.services.enable permission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). Learn how to grant roles.

    Enable the APIs

Peran yang diperlukan

Untuk mendapatkan izin yang diperlukan untuk membuat cluster Google Kubernetes Engine dan melihat rentang trace, minta administrator untuk memberi Anda peran IAM berikut di project Anda:

Untuk mengetahui informasi selengkapnya tentang pemberian peran, lihat Mengelola akses ke project, folder, dan organisasi.

Anda mungkin juga bisa mendapatkan izin yang diperlukan melalui peran khusus atau peran bawaan lainnya.

Membuat cluster GKE

Panduan ini membuat cluster GKE standar. Jika Anda menggunakan mode Autopilot untuk Google Kubernetes Engine atau jika Anda mengaktifkan Workload Identity Federation for GKE, Anda harus mengonfigurasi aplikasi untuk menggunakan Workload Identity Federation for GKE.

  1. Di toolbar, klik