You can use
[Cloud Monitoring](https://docs.cloud.google.com/monitoring)
and
[Cloud Logging](https://docs.cloud.google.com/logging)
with Service Directory.

## Monitor

Monitoring lets you create dashboards or set up
alerts. You can access it by visiting
[Monitoring](https://app.google.stackdriver.com/)
in Google Cloud console. To view basic monitoring metrics (request
count, size, and latency), go to the **Metrics Explorer** and filter by
`resource_type:consumed_api` and `service:servicedirectory.googleapis.com`.

## View logs

Service Directory produces audit logs that you can view through
Logging.

### Audit logs

[Audit logs](https://docs.cloud.google.com/logging/docs/audit.md.txt)
can help you answer the questions "Who did what, where, and when?".
Service Directory writes two types of audit logs: **admin activity** and
**data access**. Admin activity logs are always enabled and apply to the
following Service Directory operations:

- CreateNamespace
- UpdateNamespace
- DeleteNamespace
- SetIamPolicy

All other Service Directory operations are considered data access logs and are
not enabled by default. Data access logs are also subject to
Logging pricing and quota, whereas neither applies to admin
activity logs. To enable data access logging, see
[Configuring Data Access logs](https://docs.cloud.google.com/logging/docs/audit/configure-data-access.md.txt#config-console).

To see these logs in
[Logging](https://docs.cloud.google.com/logging/docs/view/logs-explorer-interface.md.txt#getting_started),
select `Service Directory Namespace` from the **Resource** drop-down menu and
`cloudaudit.googleapis.com/activity` or `cloudaudit.googleapis.com/data_access`,
as appropriate, from the **Logs** drop-down.

## What's next

- To get a thorough understanding of Monitoring, see the [Monitoring documentation](https://docs.cloud.google.com/monitoring/docs.md.txt).
- To find solutions for common issues that you might encounter when using Service Directory, see [Troubleshooting](https://docs.cloud.google.com/service-directory/docs/troubleshooting.md.txt).