אתם יכולים להשתמש ב-Observability API או ב-Google Cloud CLI כדי להציג את קטגוריות הנתונים של יכולת התצפית, לבדוק מערכי נתונים ותצוגות וליצור קישורים לניתוח נתוני מעקב מאוחסנים באמצעות SQL.
מידע רקע על המושגים ופרטי האחסון מופיעים במאמרים סקירה כללית על אחסון נתוני מעקב וסכימת מעקב.
לפני שמתחילים
מגדירים את הפרויקט ואת התפקידים בניהול הזהויות והרשאות הגישה (IAM), ובוחרים את הממשק שמתכננים להשתמש בו.
הגדרת הפרויקט והתפקידים
- נכנסים לחשבון Google Cloud . אם אתם משתמשים חדשים ב- Google Cloud, צרו חשבון כדי שתוכלו להעריך את הביצועים של המוצרים שלנו בתרחישים מהעולם האמיתי. לקוחות חדשים מקבלים בחינם גם קרדיט בשווי 300$ להרצה, לבדיקה ולפריסה של עומסי העבודה.
-
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 theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
Enable the Observability API.
Roles required to enable APIs
To enable APIs, you need the
serviceusage.services.enablepermission. 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.-
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 theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
Enable the Observability API.
Roles required to enable APIs
To enable APIs, you need the
serviceusage.services.enablepermission. 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.-
כדי לקבל את ההרשאות שנדרשות להצגת רשימה של קטגוריות, קישורים ותצוגות, צריך לבקש מהאדמין להקצות לכם את תפקיד ה-IAM Observability Viewer (
roles/observability.viewer) בפרויקט. כדי לקרוא הסבר על מתן תפקידים, ראו איך מנהלים את הגישה ברמת הפרויקט, התיקייה והארגון.יכול להיות שאפשר לקבל את ההרשאות הנדרשות גם באמצעות תפקידים בהתאמה אישית או תפקידים מוגדרים מראש.
בחירת הממשק שבו רוצים להשתמש
gcloud
במסוף Google Cloud , מפעילים את Cloud Shell.
בחלק התחתון של Google Cloud המסוף יתחיל סשן של Cloud Shell ותופיע הודעה של שורת הפקודה. Cloud Shell היא סביבת מעטפת שבה ה-CLI של Google Cloud מותקן ומוגדרים ערכים לפרויקט הקיים. הסשן יופעל תוך כמה שניות.
REST
כדי להשתמש בסביבת פיתוח מקומית בדוגמאות של API בארכיטקטורת REST שבדף הזה, צריך להשתמש בפרטי הכניסה שאתם נותנים ל-CLI של gcloud.
התקינו את ה-CLI של Google Cloud.
אם אתם משתמשים בספק זהויות חיצוני (IdP), קודם אתם צריכים להיכנס ל-CLI של gcloud באמצעות המאגר המאוחד לניהול זהויות.
מידע נוסף מופיע במאמר אימות לשימוש ב-REST במסמכי האימות של Google Cloud .
הצגת רשימה של קטגוריות של נתוני Observability
בקטע הזה מוסבר איך מציגים את רשימת מאגרי הנתונים של יכולת הצפייה. באקט של נתונים למטרות ניהול הוא ישות ניהול של מערכי נתונים שמאחסנים נתונים.
gcloud
לפני השימוש בנתוני הפקודה הבאים, צריך להחליף את הנתונים הבאים:
- LOCATION: המיקום של קטגוריות הנתונים של יכולת התצפית. כדי להציג רשימה של כל קטגוריות הנתונים של יכולת הצפייה, בלי קשר למיקום, צריך להגדיר את המיקום למקף (
-). - PROJECT_ID: מזהה הפרויקט.
מריצים את הפקודה gcloud beta observability buckets list:
Linux, macOS או Cloud Shell
gcloud beta observability buckets list \ --location=LOCATION --project=PROJECT_ID
Windows (PowerShell)
gcloud beta observability buckets list ` --location=LOCATION --project=PROJECT_ID