Firebase 전화번호 인증 관측 가능성

Firebase PNV은 Cloud Monitoring 및 Cloud Logging과 모두 통합됩니다.

Google Cloud Monitoring

Firebase PNV는 라벨 method, outcome, sms_region이 있는 단일 측정항목 fpnv.googleapis.com/verification_count를 내보냅니다.

측정항목 유형 실행 단계(리소스 계층 구조 수준)
표시 이름
종류, 유형, 단위
모니터링 리소스
설명
라벨
fpnv.googleapis.com/verification_count 베타(프로젝트)
Firebase Phone Number Verification 측정항목
DELTAINT641
fpnv.googleapis.com/App
전화번호 인증 시도 횟수입니다.
method: 사용된 인증 방법입니다. 항상 API입니다.
outcome: 인증 시도의 결과입니다 (SUCCESS, FAILURE, QUOTA_EXCEEDED, BACKEND_ERROR).
sms_region: 요청이 시작된 지역입니다.

Google Cloud Logging

Cloud Logging을 사용하여 특정 전화번호 인증 요청에 관한 자세한 정보를 확인할 수 있습니다. 모든 전화번호 인증 시도는 구조화된 로그 항목을 내보냅니다.

로그 ID: fpnv.googleapis.com/verifications

{
  "resource": {
    "type": "fpnv.googleapis.com/App",
    "labels": [
      "resource_container": /* Your Firebase / Google Cloud project ID: "project/your-project-id" */,
      "app_id": /* The ID of a Firebase app within your project  */
    ]
  },
  "severity": /* DEBUG (for successful verification) or WARNING (for failed verification) */,
  "jsonPayload": {
    "method": /* The method used for the verification attempt: METHOD_UNSPECIFIED, API */,
    "outcome": /* The final outcome of the verification attempt: OUTCOME_UNSPECIFIED, SUCCESS, FAILURE, QUOTA_EXCEEDED, BACKEND_ERROR, DEVICE_INTEGRITY_FAILURE */,
    "nonce": /* Unique ID for the verification attempt, provided to the SDK by the client if using API verification. */,
    "response_code": /* The HTTP response code returned to the client, if the interaction was over HTTP. */,
    "sms_region_code": /* The region from which the request originated. */,
    "error_code": /* A specific error code from the underlying verification service or provider, if available. */,
    "error_message": /* A message describing why the verification failed, if applicable. */
  }
}

예를 들어 특정 앱에서 시작되었으며 어떤 이유로든 실패한 API 기반 확인 시도의 모든 로그를 찾으려면 다음을 실행합니다.

log_id("fpnv.googleapis.com/verifications") AND
resource.type="fpnv.googleapis.com/App" AND
resource.labels.app_id="Your Firebase app ID" AND
severity>=WARNING AND
jsonPayload.method:"API"