Reputation: 495
Is there a metric that can be used to determine how many times an object has been downloaded from a GCP bucket?
Upvotes: 1
Views: 379
Reputation: 109
You can use the Audit logs to track storage activity from authenticated users.
For getting how many times an object has been viewed, you have to enable the DATA_READ access logs.
Then, you can search on the Logs Viewer using this advanced filter:
resource.type="gcs_bucket"
resource.labels.bucket_name=[BUCKET_NAME]
logName="projects/[project_id]/logs/cloudaudit.googleapis.com%2Fdata_access"
protoPayload.resourceName="projects/_/buckets/[bucket_name]/objects/[object_name]"
Note that this only works if the object has not public access.
Upvotes: 1
Reputation: 2520
It may be Metrics on Stackdriver Monitoring.
See https://cloud.google.com/monitoring/api/metrics_gcp?hl=ja#gcp-storage .
Upvotes: 1