Cloud Monitoring की मदद से डेटाबेस मॉनिटर करना

इस दस्तावेज़ में, Cloud Firestore के लिए ऑडिट लॉगिंग के बारे में बताया गया है. Google Cloud सेवाएं, ऑडिट लॉग जनरेट करती हैं. इनमें, आपके Google Cloud संसाधनों में की गई एडमिन और ऐक्सेस से जुड़ी गतिविधियां रिकॉर्ड होती हैं.

Cloud Audit Logs के बारे में ज़्यादा जानने के लिए, यह लेख पढ़ें:

नोट

ऑडिट लॉगिंग कॉन्फ़िगर करते समय, datastore.googleapis.com और firestore.googleapis.com. Once configured, logs for the Cloud Firestore API include the service namefirestore.googleapis.com`, दोनों को कॉन्फ़िगर करने के लिए, सेवा के नाम datastore.googleapis.com का इस्तेमाल करें.

DATA_READ या DATA_WRITE अनुरोध को प्रोसेस करने में लगने वाला समय देखने के लिए, AuditLog के metadata ऑब्जेक्ट में मौजूद processing_duration फ़ील्ड देखें. processing_duration फ़ील्ड में, किसी अनुरोध को प्रोसेस करने में डेटाबेस को लगने वाले समय के बारे में जानकारी होती है. यह एंड-यूज़र की लेटेन्सी से कम होता है. खास तौर पर, इसमें नेटवर्क ओवरहेड शामिल नहीं होता.

सेवा का नाम

Cloud Firestore ऑडिट लॉग, सेवा के नाम firestore.googleapis.com का इस्तेमाल करते हैं. इस सेवा के लिए फ़िल्टर करें:

protoPayload.serviceName="firestore.googleapis.com"

अनुमति के टाइप के हिसाब से तरीके

हर IAM अनुमति में एक type प्रॉपर्टी होती है. इसकी वैल्यू एक एनम होती है, जो इन चार वैल्यू में से कोई एक हो सकती है: ADMIN_READ, ADMIN_WRITE, DATA_READ या DATA_WRITE. किसी तरीके को कॉल करने पर, Cloud Firestore एक ऑडिट लॉग जनरेट करता है. इसकी कैटगरी, उस तरीके को पूरा करने के लिए ज़रूरी अनुमति की type प्रॉपर्टी पर निर्भर करती है.

जिन तरीकों के लिए, type प्रॉपर्टी वैल्यू DATA_READ, DATA_WRITE या ADMIN_READ वाली IAM अनुमति की ज़रूरत होती है उनके लिए, डेटा ऐक्सेस के ऑडिट लॉग जनरेट होते हैं.

जिन तरीकों के लिए, type प्रॉपर्टी की वैल्यू ADMIN_WRITE वाली IAM अनुमति की ज़रूरत होती है उनके लिए, एडमिन की गतिविधि के ऑडिट लॉग जनरेट होते हैं.

अनुमति का टाइप तरीके
ADMIN_READ google.cloud.location.Locations.GetLocation
google.cloud.location.Locations.ListLocations
google.firestore.admin.v1.FirestoreAdmin.GetBackup
google.firestore.admin.v1.FirestoreAdmin.GetBackupSchedule
google.firestore.admin.v1.FirestoreAdmin.GetDatabase
google.firestore.admin.v1.FirestoreAdmin.GetField
google.firestore.admin.v1.FirestoreAdmin.GetIndex
google.firestore.admin.v1.FirestoreAdmin.ListBackupSchedules
google.firestore.admin.v1.FirestoreAdmin.ListBackups
google.firestore.admin.v1.FirestoreAdmin.ListDatabases
google.firestore.admin.v1.FirestoreAdmin.ListFields
google.firestore.admin.v1.FirestoreAdmin.ListIndexes
google.firestore.admin.v1beta1.FirestoreAdmin.GetIndex
google.firestore.admin.v1.MongoDBCompatible.ListIndexes
google.firestore.admin.v1.MongoDBCompatible.ListDatabases
ADMIN_WRITE google.firestore.admin.v1.FirestoreAdmin.CreateBackupSchedule
google.firestore.admin.v1.FirestoreAdmin.CreateDatabase
google.firestore.admin.v1.FirestoreAdmin.CreateIndex
google.firestore.admin.v1.FirestoreAdmin.DeleteBackup
google.firestore.admin.v1.FirestoreAdmin.DeleteBackupSchedule
google.firestore.admin.v1.FirestoreAdmin.DeleteDatabase
google.firestore.admin.v1.FirestoreAdmin.DeleteIndex
google.firestore.admin.v1.FirestoreAdmin.RestoreDatabase
google.firestore.admin.v1.FirestoreAdmin.UpdateBackupSchedule
google.firestore.admin.v1.FirestoreAdmin.UpdateDatabase
google.firestore.admin.v1.FirestoreAdmin.UpdateField
google.longrunning.Operations.CancelOperation
google.longrunning.Operations.DeleteOperation
DATA_READ google.firestore.v1.MongoDBCompatible.Find
google.firestore.v1.MongoDBCompatible.Aggregate
google.firestore.v1.MongoDBCompatible.GetMore
google.firestore.v1.MongoDBCompatible.ListCollections
google.firestore.v1.MongoDBCompatible.Count
google.firestore.v1.MongoDBCompatible.Distinct
google.firestore.v1.MongoDBCompatible.CommitTransaction
google.firestore.v1.MongoDBCompatible.AbortTransaction
google.firestore.v1.MongoDBCompatible.EndSessions
google.firestore.v1.MongoDBCompatible.KillCursors
DATA_WRITE google.firestore.v1.MongoDBCompatible.Insert
google.firestore.v1.MongoDBCompatible.Update
google.firestore.v1.MongoDBCompatible.Delete
google.firestore.v1.MongoDBCompatible.FindAndModify
google.firestore.v1.MongoDBCompatible.CreateCollection

अनुरोध करने वाले लोगों की पहचान करना

ऑडिट लॉग की एंट्री में, लॉग की गई कार्रवाई करने वाली पहचान के बारे में जानकारी शामिल होती है. अनुरोध करने वाले व्यक्ति की पहचान करने के लिए, AuditLog ऑब्जेक्ट में ये फ़ील्ड देखें:

  • अनुरोध करने वाले व्यक्ति की पहचान, AuthenticationInfo फ़ील्ड में सेव होती है. इसमें, उपयोगकर्ता का principalEmail शामिल हो सकता है. कभी-कभी, इस जानकारी को छिपा दिया जाता है.

  • callerIp फ़ील्ड में, requestMetadata ऑब्जेक्ट के AuditLog एंट्री में, अनुरोध करने वाले व्यक्ति का आईपी पता शामिल होता है.