Skip to content

Commit 6eed70a

Browse files
authored
Merge pull request googleapis#2954 from waprin/fix_monitoring_usage
Fix monitoring usage doc
2 parents 172d788 + 11e395e commit 6eed70a

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

docs/monitoring-usage.rst

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -338,14 +338,20 @@ See `Monitored resource types`_ for more information about particular monitored
338338
339339
>>> from google.cloud import monitoring
340340
>>> # Create a Resource object for the desired monitored resource type.
341-
>>> resource = client.resource('gce_instance', labels={
342-
... 'instance_id': '1234567890123456789',
343-
... 'zone': 'us-central1-f'
344-
... })
341+
>>> resource = client.resource(
342+
... 'gce_instance',
343+
... labels={
344+
... 'instance_id': '1234567890123456789',
345+
... 'zone': 'us-central1-f'
346+
... }
347+
... )
345348
>>> # Create a Metric object, specifying the metric type as well as values for any metric labels.
346-
>>> metric = client.metric(type='custom.googleapis.com/my_metric', labels={
347-
... 'status': 'successful'
348-
... })
349+
>>> metric = client.metric(
350+
... type_='custom.googleapis.com/my_metric',
351+
... labels={
352+
... 'status': 'successful'
353+
... }
354+
... )
349355
350356
With a ``Metric`` and ``Resource`` in hand, the :class:`~google.cloud.monitoring.client.Client`
351357
can be used to write :class:`~google.cloud.monitoring.timeseries.Point` values.

0 commit comments

Comments
 (0)