Search code examples
google-cloud-platformstackdrivergoogle-cloud-monitoring

Stackdriver log-based metrics does not display the values as reported by logging


My goal is to base my metrics directly from log values. The problem is when I display them as graph it looks like they are distributed. How can I change it so that it displays the values from the logs?

logging current sessions

values are distributed


Solution

  • Unfortunately Stackdriver doesn't work in that way, you shouldn't expect that Stackdriver shows you "52" in this case. Have a look at the official documentation where "logs-based metrics can be one of two metric types: counter or distribution" and "counter metrics count the number of log entries matching" and "distribution metrics is to track latencies". You have to choose another tool for this task.