google-cloud-platform - GCP 日志指标资源管理器问题
问题描述
我创建了一个非常简单的基于日志的指标来排除错误。以下是来自指标资源管理器的 JSON 视图
使用自定义指标创建的这个向我显示数据
{
"dataSets": [
{
"timeSeriesFilter": {
"filter": "metric.type=\"logging.googleapis.com/log_entry_count\" resource.type=\"app_script_function\" metric.label.\"severity\"=\"ERROR\"",
"minAlignmentPeriod": "60s",
"aggregations": [
{
"perSeriesAligner": "ALIGN_RATE",
"crossSeriesReducer": "REDUCE_NONE",
"alignmentPeriod": "60s",
"groupByFields": []
},
{
"crossSeriesReducer": "REDUCE_NONE",
"alignmentPeriod": "60s"
}
]
},
"targetAxis": "Y1",
"plotType": "LINE"
}
],
"options": {
"mode": "COLOR"
},
"constantLines": [],
"timeshiftDuration": "0s",
"y1Axis": {
"label": "y1Axis",
"scale": "LINEAR"
}
}
使用自定义指标创建的这个不显示同一时间范围内的数据
{
"dataSets": [
{
"timeSeriesFilter": {
"filter": "metric.type=\"logging.googleapis.com/user/TestApps2\"",
"minAlignmentPeriod": "60s",
"aggregations": [
{
"perSeriesAligner": "ALIGN_RATE",
"crossSeriesReducer": "REDUCE_NONE",
"alignmentPeriod": "60s",
"groupByFields": []
},
{
"crossSeriesReducer": "REDUCE_NONE",
"alignmentPeriod": "60s"
}
]
},
"targetAxis": "Y1",
"plotType": "LINE"
}
],
"options": {
"mode": "COLOR"
},
"constantLines": [],
"timeshiftDuration": "0s",
"y1Axis": {
"label": "y1Axis",
"scale": "LINEAR"
}
}
自定义指标 TestApps2 包含以下附加过滤器:
severity="ERROR"
resource.type="app_script_function"
请注意,在指标创建过程中,上面确实显示了预览日志中的日志。我必须使用自定义指标来添加标签并将其注入电子邮件中。
自定义指标视图失败的可能原因是什么?
解决方案
推荐阅读
- php - 当我尝试使用错误的加密密钥打开文件时,为什么 SQLite 没有给我一个错误?
- c# - Report Services 未能在 Internet 信息服务中显示 Datepicker,但在 Visual Studio 中成功
- asp.net - 如何在 Blazor WASM 中实现预渲染
- nginx - Nginx 阻止每个应用程序与整个服务器的恶意请求
- c# - 用逗号分割字符串并修剪仍然在字符串中留下逗号
- laravel - 如何在 laravel 中为 domPDF 设置 customPaper?
- node.js - 通过flutter中的节点js文件将firebase与我的项目链接时出现错误
- c++ - "// \" Next Line 放这个后在 C++ 中自动注释掉了?
- python - 内核似乎已经死了。它将自动重启。在 miniconda jupyter notebook 中
- svg - 使用自定义 svg 具有多个停靠点的 Imagemagick 对角线线性渐变