Identity and Access Management(IAM) monitoring.timeSeries.create 권한이 부여된 사용자나 서비스 계정에서 클라이언트 측 측정항목을 사용할 수 있습니다. 이 권한은 다음과 같은 Spanner IAM 역할에 포함되어 있습니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-05(UTC)"],[],[],null,["# View and manage client-side metrics\n\nThis page offers information about viewing and managing client-side metrics.\nClient-side metrics offer latency information about\nthe client's RPC requests to Spanner.\n\nSpanner provides client-side metrics that you can use along\nwith server-side metrics to optimize performance and\ntroubleshoot performance issues if they occur.\n\nClient-side metrics are measured from the time a request leaves your\napplication to the time your application receives the response.\nIn contrast, server-side metrics are measured from the time\nSpanner receives a request until the last byte of data\nis sent to the client.\n\nAccess client-side metrics\n--------------------------\n\nClient-side metrics are available on the following client libraries:\n\n- [Java](/java/docs/reference/google-cloud-spanner/latest/overview) in version 6.81.0 and later.\n- [Go](https://pkg.go.dev/cloud.google.com/go/spanner) in version 1.71.0 and later.\n\nClient-side metrics are available after you enable the\nCloud Monitoring API.\n\n[Enable the Monitoring API](https://console.cloud.google.com/flows/enableapi?apiid=monitoring.googleapis.com)\n\nClient-side metrics are available for users or service\naccounts that are granted the Identity and Access Management (IAM) `monitoring.timeSeries.create`\npermission. This permission is included in the following Spanner\nIAM roles:\n\n- [Cloud Spanner Admin](/iam/docs/understanding-roles#spanner.admin) (`roles/spanner.admin`)\n- [Cloud Spanner Database Admin](/iam/docs/understanding-roles#spanner.databaseAdmin) (`roles/spanner.databaseAdmin`)\n- [Cloud Spanner Database Reader](/iam/docs/understanding-roles#spanner.databaseReader) (`roles/spanner.databaseReader`)\n- [Cloud Spanner Database User](/iam/docs/understanding-roles#spanner.databaseUser) (`roles/spanner.databaseUser`)\n\nFor more information about granting roles, see\n[Manage access to projects, folders, and organizations](/iam/docs/granting-changing-revoking-access).\n\nYou might also be able to get the required `monitoring.timeSeries.create`\nIAM permission through\n[custom roles](/iam/docs/creating-custom-roles).\n\nView metrics in the Metrics Explorer\n------------------------------------\n\n1. In the Google Cloud console, go to the Metrics Explorer page.\n\n [Go to Metrics Explorer](https://console.cloud.google.com/projectselector/monitoring/metrics-explorer?supportedpurview=project,folder,organizationId)\n2. Select your project.\n\n3. Click **Select a metric**.\n\n4. Search for `spanner.googleapis.com/client`.\n\n5. Select the metric, and then click **Apply**.\n\nFor more information about grouping or aggregating your metric, see\n[Build queries using menus](/monitoring/charts/metrics-selector#basic-advanced-mode).\n\nYour application needs to run for at least a minute before you can view any\npublished metrics.\n\nOpt out of client-side metrics\n------------------------------\n\nIf you are already using OpenTelemetry to capture custom client metrics,\nyou can choose to opt out of using client-side metrics by\nusing the following code: \n\n### Java\n\n Spanner spanner =\n SpannerOptions.newBuilder()\n .setProjectId(\"test-project\")\n .setBuiltInMetricsEnabled(false)\n .build()\n .getService();\n\n### Go\n\n client, err := spanner.NewClientWithConfig(ctx, database, spanner.ClientConfig{\n DisableNativeMetrics: true,\n })\n\nPricing\n-------\n\nThere is no charge to view client-side metrics in Cloud Monitoring.\nUse of the Monitoring API might incur charges.\nFor more information, see [Google Cloud Observability pricing](/stackdriver/pricing).\n\nWhat's next\n-----------\n\n- [Client-side metrics descriptions](/spanner/docs/client-side-metrics-descriptions)\n- [Trace collection overview](/spanner/docs/tracing-overview)"]]