| Chỉ áp dụng cho phiên bản Cloud Firestore Enterprise. |
Tài liệu này mô tả tính năng ghi nhật ký kiểm tra cho Cloud Firestore có khả năng tương thích với MongoDB. Google Cloudtạo nhật ký kiểm tra để ghi lại các hoạt động quản trị và truy cập trong các tài nguyên Google Cloud của bạn.
Để biết thêm thông tin về Nhật ký kiểm tra trên Cloud, hãy xem các nội dung sau:
- Các loại nhật ký kiểm tra
- Cấu trúc mục nhật ký kiểm tra
- Lưu trữ và định tuyến nhật ký kiểm tra
- Cloud Logging bản tóm tắt về giá
- Bật nhật ký kiểm tra quyền truy cập dữ liệu
Lưu ý
Khi định cấu hình tính năng ghi nhật ký kiểm tra, hãy sử dụng tên dịch vụ datastore.googleapis.com để định cấu hình cả datastore.googleapis.com và firestore.googleapis.com.
Once configured, logs for the Cloud Firestore with MongoDB compatibility API include the service namefirestore.googleapis.com`.
Để xem thời gian cần thiết để xử lý một yêu cầu DATA_READ hoặc DATA_WRITE, hãy xem trường processing_duration trong đối tượng metadata của một AuditLog.
Trường processing_duration mô tả thời gian cơ sở dữ liệu cần để xử lý một yêu cầu. Độ trễ này nhỏ hơn độ trễ của người dùng cuối. Cụ thể, chỉ số này không bao gồm chi phí mạng.
Tên dịch vụ
Nhật ký kiểm tra Cloud Firestore sử dụng tên dịch vụ firestore.googleapis.com.
Lọc theo dịch vụ này:
protoPayload.serviceName="firestore.googleapis.com"
Các phương thức theo loại quyền
Mỗi quyền IAM đều có một thuộc tính type, giá trị của thuộc tính này là một enum có thể là một trong 4 giá trị: ADMIN_READ, ADMIN_WRITE, DATA_READ hoặc DATA_WRITE. Khi bạn gọi một phương thức, Cloud Firestore sẽ tạo một nhật ký kiểm tra có danh mục phụ thuộc vào thuộc tính type của quyền cần thiết để thực hiện phương thức.
Các phương thức yêu cầu quyền IAM có giá trị thuộc tính type là DATA_READ, DATA_WRITE hoặc ADMIN_READ sẽ tạo nhật ký kiểm tra Quyền truy cập dữ liệu.
Các phương thức yêu cầu quyền IAM có giá trị thuộc tính type là ADMIN_WRITE tạo sẽ tạo nhật ký kiểm tra Hoạt động của quản trị viên.
| Loại quyền | Phương thức |
|---|---|
ADMIN_READ |
google.cloud.location.Locations.GetLocationgoogle.cloud.location.Locations.ListLocationsgoogle.firestore.admin.v1.FirestoreAdmin.GetBackupgoogle.firestore.admin.v1.FirestoreAdmin.GetBackupSchedulegoogle.firestore.admin.v1.FirestoreAdmin.GetDatabasegoogle.firestore.admin.v1.FirestoreAdmin.GetFieldgoogle.firestore.admin.v1.FirestoreAdmin.GetIndexgoogle.firestore.admin.v1.FirestoreAdmin.ListBackupSchedulesgoogle.firestore.admin.v1.FirestoreAdmin.ListBackupsgoogle.firestore.admin.v1.FirestoreAdmin.ListDatabasesgoogle.firestore.admin.v1.FirestoreAdmin.ListFieldsgoogle.firestore.admin.v1.FirestoreAdmin.ListIndexesgoogle.firestore.admin.v1beta1.FirestoreAdmin.GetIndexgoogle.firestore.admin.v1.MongoDBCompatible.ListIndexesgoogle.firestore.admin.v1.MongoDBCompatible.ListDatabases
|
ADMIN_WRITE |
google.firestore.admin.v1.FirestoreAdmin.CreateBackupSchedulegoogle.firestore.admin.v1.FirestoreAdmin.CreateDatabasegoogle.firestore.admin.v1.FirestoreAdmin.CreateIndexgoogle.firestore.admin.v1.FirestoreAdmin.DeleteBackupgoogle.firestore.admin.v1.FirestoreAdmin.DeleteBackupSchedulegoogle.firestore.admin.v1.FirestoreAdmin.DeleteDatabasegoogle.firestore.admin.v1.FirestoreAdmin.DeleteIndexgoogle.firestore.admin.v1.FirestoreAdmin.RestoreDatabasegoogle.firestore.admin.v1.FirestoreAdmin.UpdateBackupSchedulegoogle.firestore.admin.v1.FirestoreAdmin.UpdateDatabasegoogle.firestore.admin.v1.FirestoreAdmin.UpdateFieldgoogle.longrunning.Operations.CancelOperationgoogle.longrunning.Operations.DeleteOperation
|
DATA_READ |
google.firestore.v1.MongoDBCompatible.Findgoogle.firestore.v1.MongoDBCompatible.Aggregategoogle.firestore.v1.MongoDBCompatible.GetMoregoogle.firestore.v1.MongoDBCompatible.ListCollectionsgoogle.firestore.v1.MongoDBCompatible.Countgoogle.firestore.v1.MongoDBCompatible.Distinctgoogle.firestore.v1.MongoDBCompatible.CommitTransactiongoogle.firestore.v1.MongoDBCompatible.AbortTransactiongoogle.firestore.v1.MongoDBCompatible.EndSessionsgoogle.firestore.v1.MongoDBCompatible.KillCursors
|
DATA_WRITE |
google.firestore.v1.MongoDBCompatible.Insertgoogle.firestore.v1.MongoDBCompatible.Updategoogle.firestore.v1.MongoDBCompatible.Deletegoogle.firestore.v1.MongoDBCompatible.FindAndModifygoogle.firestore.v1.MongoDBCompatible.CreateCollection
|
Xác định người gọi yêu cầu
Các mục trong Nhật ký kiểm tra bao gồm thông tin về danh tính của người thực hiện thao tác được ghi nhật ký. Để xác định người gọi yêu cầu, hãy xem các trường sau trong đối tượng AuditLog:
Danh tính của người gọi được lưu giữ trong trường
AuthenticationInfo. Thông tin này có thể bao gồmprincipalEmailcủa người dùng. Thông tin này đôi khi bị che khuất.Trường
callerIptrong đối tượngrequestMetadatacủa mụcAuditLogbao gồm địa chỉ IP của người gọi.