Skip to content

Commit

Permalink
Merge pull request #2954 from waprin/fix_monitoring_usage
Browse files Browse the repository at this point in the history
Fix monitoring usage doc
  • Loading branch information
dhermes authored Jan 21, 2017
2 parents 172d788 + 11e395e commit 6eed70a
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions docs/monitoring-usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -338,14 +338,20 @@ See `Monitored resource types`_ for more information about particular monitored
>>> from google.cloud import monitoring
>>> # Create a Resource object for the desired monitored resource type.
>>> resource = client.resource('gce_instance', labels={
... 'instance_id': '1234567890123456789',
... 'zone': 'us-central1-f'
... })
>>> resource = client.resource(
... 'gce_instance',
... labels={
... 'instance_id': '1234567890123456789',
... 'zone': 'us-central1-f'
... }
... )
>>> # Create a Metric object, specifying the metric type as well as values for any metric labels.
>>> metric = client.metric(type='custom.googleapis.com/my_metric', labels={
... 'status': 'successful'
... })
>>> metric = client.metric(
... type_='custom.googleapis.com/my_metric',
... labels={
... 'status': 'successful'
... }
... )
With a ``Metric`` and ``Resource`` in hand, the :class:`~google.cloud.monitoring.client.Client`
can be used to write :class:`~google.cloud.monitoring.timeseries.Point` values.
Expand Down

0 comments on commit 6eed70a

Please sign in to comment.