6

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?

kdima
  • 53
  • 4
fkorotkov
  • 348
  • 2
  • 13

1 Answers1

4

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
Ne0t0N
  • 41
  • 1
  • 4