google-analytics - 如何在谷歌云存储中启用实时对象访问分析?
问题描述
我正在尝试为存储在谷歌云存储桶中的对象设置实时访问日志。google在此处指定的访问日志每小时生成一次,并且不起作用。
我想要关于对象访问(ip、下载量、client_os)但实时的类似信息。有没有办法在谷歌云平台上做到这一点?
如果使用实时日志将流量路由到另一个点会更好,我将不胜感激有关如何做到这一点以及使用什么工具的建议。最终,我希望在谷歌数据工作室中可视化数据。
解决方案
不幸的是,谷歌存储仅提供以下gcp-storage 指标
- api/request_count
- authz/acl_based_object_access_count
- authz/object_specific_acl_mutation_count
- network/received_bytes_count
- network/sent_bytes_count
- storage/object_count
- storage/total_byte_seconds
- storage/total_bytes
我认为您想要访问存储桶对象的日志,例如图像、视频……等。您也许可以尝试在您的存储桶前使用Google Cloud CDN。因此,您可以通过httpRequest获取所需的访问日志,并从 stackdriver 获取
{
"requestMethod": string,
"requestUrl": string,
"requestSize": string,
"status": number,
"responseSize": string,
"userAgent": string,
"remoteIp": string,
"serverIp": string,
"referer": string,
"latency": string,
"cacheLookup": boolean,
"cacheHit": boolean,
"cacheValidatedWithOriginServer": boolean,
"cacheFillBytes": string,
"protocol": string
}
推荐阅读
- javascript - 如何从参数中获取参数值?
- performance - 在 documentDb 中查询时有效地不存在?
- javascript - 使用 ajax 的 WordPress REST api 中未排除帖子
- reactjs - Google AMP 可以与 ReactJS 应用程序一起使用吗?在这种情况下,服务器端渲染是强制性的吗?
- php - Laravel orderBy 列值错误
- xml - XSL 如何使用 sum 到 foreach 中执行赔率程序?
- python - 使用 DictWriter 将临时字典导出到 .csv
- swift - 将文本从 MKMarkerAnnotation 传递到不同的视图控制器
- python - 简单的 SQLAlchemy SubFactory 示例
- xcode - Xcode 9 项目导航器中没有文件