Reporting Monitoring Metrics

This page describes how to use Google Service Control to enable services to
produce monitoring data to send to service producers and service
consumers. Monitoring provides visibility into the performance, uptime, and
overall health of individual services.

Service Control accepts metrics, which it batches
and aggregates and forwards to Stackdriver Monitoring.
Stackdriver Monitoring ingests these metrics and generates insights via
dashboards, charts, and alerts.

Whereas Stackdriver Monitoring alone allows a service to produce monitoring data
for the sake of the service's producer, Service Control makes it possible to
also produce monitoring data which is intended for the service's consumers.
This makes it possible for service consumers to understand and diagnose use
of the service.

Configuring monitoring

Before you send monitoring data to Service Control, you need to specify three
different bits of information in your service configuration:

Monitored resources: A
Monitored resource
represents a cloud entity that originates some monitoring data or is the subject
of it. Stackdriver Monitoring provides a
well-known set
of monitored resource types that you can chose from.

Metrics: You can report one or more metrics. Each metric represents
a single piece of state whose value is tracked over time. Stackdriver
Monitoring provides a well-known set of metrics you
can chose from.

Monitoring configuration: Lets you specify the metrics associated with
individual monitored resources and the destination (producer or consumer) where
the monitoring data should be sent.

In the following example of service configuration state, we defined a
monitored resource and a metric. A client can invoke the services.report
method to report values on the metric. See
monitoring.proto
for details on service configuration.

Reporting metrics

Once you have configured monitoring in the service configuration
and pushed the configuration to Google Service Management, you can call the
Service Control API to report metrics. The following example uses the gcurl
command to demonstrate the call; see Getting Started
for how to set this up.