I'm running a custom Python application. The logging inside the code is written to Stackdriverm, fine. But for specific blocks of code I'm thinking to create custom metrics in Stackdriver. But here's my problem. There are some official docs for that:
All of them are using code that starts like this:
from google.cloud import monitoring
client = monitoring.Client()
descriptor = client.metric_descriptor(
'custom.googleapis.com/my_metric',
metric_kind=monitoring.MetricKind.GAUGE,
value_type=monitoring.ValueType.DOUBLE,
description='This is a simple example of a custom metric.')
My problem is, that I can not reproduce this code. I've installed the following libs:
But when I try the code, it say that there is no Client
in the google-cloud-monitoring
package. Instead there is a MetricServiceClient
, but I can not find any good documentation on how to use that.
PS: my IDE is PyCharm.
And idea?