Google 會運用 AI 技術將內容翻譯成你偏好的語言,但可能會出錯。
MonitoredResource
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
這是一個物件,代表可用於監控、記錄、計費或其他用途的資源。相關範例包括:虛擬機器執行個體、資料庫,以及儲存裝置 (例如磁碟)。type 欄位會識別說明資源結構定義的 MonitoredResourceDescriptor 物件。labels 欄位中的資訊會根據結構定義,識別實際資源及其屬性。舉例來說,特定 Compute Engine VM 執行個體可由下列物件表示,因為 "gce_instance" 的 MonitoredResourceDescriptor 具有 "project_id"、"instance_id" 和 "zone" 標籤:
{ "type": "gce_instance",
"labels": { "project_id": "my-project",
"instance_id": "12345678901234",
"zone": "us-central1-a" }}
| JSON 表示法 |
{
"type": string,
"labels": {
string: string,
...
}
} |
| 欄位 |
type |
string
這是必要旗標,受監控的資源類型。這個欄位必須與 MonitoredResourceDescriptor 物件的 type 欄位相符。舉例來說,Compute Engine VM 執行個體的類型為 gce_instance。部分描述元會在類型中加入服務名稱,例如 Datastream 串流的類型為 datastream.googleapis.com/Stream。
|
labels |
map (key: string, value: string)
這是必要旗標,相關聯的受監控資源描述元中列出的所有標籤的值。舉例來說,Compute Engine VM 執行個體會使用 "project_id"、"instance_id" 和 "zone" 標籤。
|
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2026-06-02 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2026-06-02 (世界標準時間)。"],[],[]]