You’re correct in your understanding. When you create a counter metric in Cloud Logging, it counts the number of log entries that match the specified filter. It does not capture or plot the actual values inside a specific field like jsonPayload.count
.
If you create a counter metric with the filter resource.type="global" AND jsonPayload.count IS NOT NULL
, the metric will increment each time a log entry matches this filter. In Cloud Monitoring, the dashboard will show the number of times this log entry occurred over a specified time period, but it will not show the actual values inside jsonPayload.count
.
If you want to capture and visualize the actual values inside jsonPayload.count
, you would need to use a distribution metric. A distribution metric allows you to create histograms based on the values in specific fields of your log entries. This way, you can see the distribution of values inside jsonPayload.count
over a specified time period.