Kemampuan pengamatan Verifikasi Nomor Telepon Firebase

Firebase PNV terintegrasi dengan Cloud Monitoring dan Cloud Logging.

Google Cloud Monitoring

Firebase PNV mengekspor satu metrik, fpnv.googleapis.com/verification_count, dengan label method, outcome, dan sms_region:

Jenis metrik Tahap peluncuran(Tingkatan hierarki resource)
Nama tampilan
Jenis, Tipe, Unit
Resource yang dimonitor
Deskripsi
Label
fpnv.googleapis.com/verification_count BETA(project) Metrik
Firebase Phone Number Verification
DELTAINT641
fpnv.googleapis.com/App
Jumlah upaya verifikasi nomor telepon.
method: Metode verifikasi yang digunakan. Selalu API.
outcome: Hasil upaya verifikasi (SUCCESS, FAILURE, QUOTA_EXCEEDED, BACKEND_ERROR).
sms_region: Region asal permintaan.

Google Cloud Logging

Anda dapat menggunakan Cloud Logging untuk mendapatkan informasi selengkapnya tentang permintaan verifikasi nomor telepon tertentu. Setiap upaya verifikasi nomor telepon akan memancarkan entri log terstruktur:

ID Log: 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. */
  }
}

Misalnya, untuk menemukan semua log upaya verifikasi berbasis API yang berasal dari aplikasi tertentu dan gagal karena alasan apa pun:

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"