[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-11。"],[],[],null,["# View logs and metrics\n\nYou can use\n[Cloud Monitoring](/monitoring)\nand\n[Cloud Logging](/logging)\nwith Service Directory.\n\nMonitor\n-------\n\nMonitoring lets you create dashboards or set up\nalerts. You can access it by visiting\n[Monitoring](https://app.google.stackdriver.com/)\nin Google Cloud console. To view basic monitoring metrics (request\ncount, size, and latency), go to the **Metrics Explorer** and filter by\n`resource_type:consumed_api` and `service:servicedirectory.googleapis.com`.\n\nView logs\n---------\n\nService Directory produces audit logs that you can view through\nLogging.\n\n### Audit logs\n\n[Audit logs](/logging/docs/audit)\ncan help you answer the questions \"Who did what, where, and when?\".\nService Directory writes two types of audit logs: **admin activity** and\n**data access**. Admin activity logs are always enabled and apply to the\nfollowing Service Directory operations:\n\n- CreateNamespace\n- UpdateNamespace\n- DeleteNamespace\n- SetIamPolicy\n\nAll other Service Directory operations are considered data access logs and are\nnot enabled by default. Data access logs are also subject to\nLogging pricing and quota, whereas neither applies to admin\nactivity logs. To enable data access logging, see\n[Configuring Data Access logs](/logging/docs/audit/configure-data-access#config-console).\n\nTo see these logs in\n[Logging](/logging/docs/view/logs-explorer-interface#getting_started),\nselect `Service Directory Namespace` from the **Resource** drop-down menu and\n`cloudaudit.googleapis.com/activity` or `cloudaudit.googleapis.com/data_access`,\nas appropriate, from the **Logs** drop-down.\n\nWhat's next\n-----------\n\n- To get a thorough understanding of Monitoring, see the [Monitoring documentation](/monitoring/docs).\n- To find solutions for common issues that you might encounter when using Service Directory, see [Troubleshooting](/service-directory/docs/troubleshooting)."]]