Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Arithmetic operations for Stackdriver monitoring charts

I'm trying to setup a Stackdriver dashboard for my custom metrics that my services provide.

In particular I'm starting with general custom/grpc/time_ms metric that is a gauge and have status label on it. I'd love to be able to set up a chart and alert for success rate of the metric(something like count:custom/grpc/time_ms{status:OK} / count:custom/grpc/time_ms{*}).

With my previous project I used Datadog and it was pretty easy to do so there. But I don't see any similar functionality neither in the UI nor in Stackdriver documentation. So I was wondering if it's not documented or simply not supported?

like image 397
fkorotkov Avatar asked Nov 15 '17 04:11

fkorotkov


People also ask

What is Stackdriver monitoring?

Google Cloud's operations suite (formerly Stackdriver) Integrated monitoring, logging, and trace managed services for applications and systems running on Google Cloud and beyond.

What tool provides monitoring services in GCP?

Opsview's Google Cloud Platform monitoring tools provides an easy way to monitor performance metrics for: Compute Engine Instances, Cloud Storage Buckets, and Cloud SQL Database Instances.

What is GCP operations management?

It offers integrated capabilities for monitoring, logging, and advanced observability services like trace, debugger and profiler. The end-to-end operations solution includes built-in telemetry, out-of-box dashboards, recommendations, alerts and more: Capturing signals. Monitoring systems. Managing incidents.

What are the features of Google Stackdriver?

Stackdriver Logging allows you to store, search, analyze, monitor, and alert on log data and events from Google Cloud Platform and Amazon Web Services. It includes storage for logs, a user interface called the Logs Viewer, and an API to manage logs programmatically.


1 Answers

This question is quite old, however, still might be useful for new users of Google Cloud.

In 'Metrics Explorer' in Google Cloud Console there is an option to write a query with MQL (click Query Editor button). MQL supports expressions which are described in detail here.

The simplest example for dividing one metric by another would look like this:

{ fetch
    your_resource_type ::
    your_metric_1
; fetch
    your_resource_type ::
    your_metric_2 
}
| join
| div
like image 56
Ne0t0N Avatar answered Oct 20 '22 15:10

Ne0t0N