I’m struggling to create a chart with stackdriver monitoring with a log-based metric. My metric is a counter one with no unit by default.
Logs are available for my log-based metric but when I create a chart with my metric, it says no data is available for the...
.
Here’s my metric which does work (called isOperatorAllowed):
resource.type="container"
resource.labels.namespace_id="default"
jsonPayload.message="CaseForOperator flags"
logName="projects/PROJECT-ID/logs/app"
jsonPayload.caseForOperatorFlags.isOperatorAllowed=true
And here’s my JSON config of my chart
{
"dataSets": [
{
"timeSeriesFilter": {
"filter": "metric.type=\"logging.googleapis.com/user/IsOperatorAllowed\" resource.type=\"gke_container\"",
"perSeriesAligner": "ALIGN_RATE",
"crossSeriesReducer": "REDUCE_NONE",
"secondaryCrossSeriesReducer": "REDUCE_NONE",
"minAlignmentPeriod": "60s",
"groupByFields": [],
"unitOverride": "1"
},
"targetAxis": "Y1",
"plotType": "LINE"
}
],
"options": {
"mode": "COLOR"
},
"constantLines": [],
"timeshiftDuration": "0s",
"y1Axis": {
"label": "y1Axis",
"scale": "LINEAR"
}
}
Does someone know what I’m doing wrong?