REST Resource: services

Resource: Service

A Service is a discrete, autonomous, and network-accessible unit, designed to solve an individual concern (Wikipedia). In Cloud Monitoring, a Service acts as the root resource under which operational aspects of the service are accessible.

JSON representation
{
  "name": string,
  "displayName": string,
  "telemetry": {
    object (Telemetry)
  },
  "userLabels": {
    string: string,
    ...
  },

  // Union field identifier can be only one of the following:
  "custom": {
    object (Custom)
  },
  "appEngine": {
    object (AppEngine)
  },
  "clusterIstio": {
    object (ClusterIstio)
  },
  "meshIstio": {
    object (MeshIstio)
  },
  "istioCanonicalService": {
    object (IstioCanonicalService)
  },
  "cloudRun": {
    object (CloudRun)
  },
  "gkeNamespace": {
    object (GkeNamespace)
  },
  "gkeWorkload": {
    object (GkeWorkload)
  },
  "gkeService": {
    object (GkeService)
  }
  // End of list of possible types for union field identifier.
}
Fields
name

string

Resource name for this Service. The format is:

projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]
displayName

string

Name used for UI elements listing this Service.

telemetry

object (Telemetry)

Configuration for how to query telemetry on a Service.

userLabels

map (key: string, value: string)

Labels which have been used to annotate the service. Label keys must start with a letter. Label keys and values may contain lowercase letters, numbers, underscores, and dashes. Label keys and values have a maximum length of 63 characters, and must be less than 128 bytes in size. Up to 64 label entries may be stored. For labels which do not have a semantic value, the empty string may be supplied for the label value.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

Union field identifier. REQUIRED. Service-identifying atoms specifying the underlying service. identifier can be only one of the following:
custom

object (Custom)

Custom service type.

appEngine

object (AppEngine)

Type used for App Engine services.

clusterIstio

object (ClusterIstio)

Type used for Istio services that live in a Kubernetes cluster.

meshIstio

object (MeshIstio)

Type used for Istio services scoped to an Istio mesh.

istioCanonicalService

object (IstioCanonicalService)

Type used for canonical services scoped to an Istio mesh. Metrics for Istio are documented here

cloudRun

object (CloudRun)

Type used for Cloud Run services.

gkeNamespace

object (GkeNamespace)

Type used for GKE Namespaces.

gkeWorkload

object (GkeWorkload)

Type used for GKE Workloads.

gkeService

object (GkeService)

Type used for GKE Services (the Kubernetes concept of a service).

Custom

Custom view of service telemetry. Currently a place-holder pending final design.

AppEngine

App Engine service. Learn more at https://cloud.google.com/appengine.

JSON representation
{
  "moduleId": string
}
Fields
moduleId

string

The ID of the App Engine module underlying this service. Corresponds to the moduleId resource label in the gae_app monitored resource.

ClusterIstio

Istio service scoped to a single Kubernetes cluster. Learn more at https://istio.io. Clusters running OSS Istio will have their services ingested as this type.

JSON representation
{
  "location": string,
  "clusterName": string,
  "serviceNamespace": string,
  "serviceName": string
}
Fields
location

string

The location of the Kubernetes cluster in which this Istio service is defined. Corresponds to the location resource label in k8s_cluster resources.

clusterName

string

The name of the Kubernetes cluster in which this Istio service is defined. Corresponds to the clusterName resource label in k8s_cluster resources.

serviceNamespace

string

The namespace of the Istio service underlying this service. Corresponds to the destination_service_namespace metric label in Istio metrics.

serviceName

string

The name of the Istio service underlying this service. Corresponds to the destination_service_name metric label in Istio metrics.

MeshIstio

Istio service scoped to an Istio mesh. Anthos clusters running ASM < 1.6.8 will have their services ingested as this type.

JSON representation
{
  "meshUid": string,
  "serviceNamespace": string,
  "serviceName": string
}
Fields
meshUid

string

Identifier for the mesh in which this Istio service is defined. Corresponds to the meshUid metric label in Istio metrics.

serviceNamespace

string

The namespace of the Istio service underlying this service. Corresponds to the destination_service_namespace metric label in Istio metrics.

serviceName

string

The name of the Istio service underlying this service. Corresponds to the destination_service_name metric label in Istio metrics.

IstioCanonicalService

Canonical service scoped to an Istio mesh. Anthos clusters running ASM >= 1.6.8 will have their services ingested as this type.

JSON representation
{
  "meshUid": string,
  "canonicalServiceNamespace": string,
  "canonicalService": string
}
Fields
meshUid

string

Identifier for the Istio mesh in which this canonical service is defined. Corresponds to the meshUid metric label in Istio metrics.

canonicalServiceNamespace

string

The namespace of the canonical service underlying this service. Corresponds to the destination_canonical_service_namespace metric label in Istio metrics.

canonicalService

string

The name of the canonical service underlying this service. Corresponds to the destination_canonical_service_name metric label in label in Istio metrics.

CloudRun

Cloud Run service. Learn more at https://cloud.google.com/run.

JSON representation
{
  "serviceName": string,
  "location": string
}
Fields
serviceName

string

The name of the Cloud Run service. Corresponds to the serviceName resource label in the cloud_run_revision monitored resource.

location

string

The location the service is run. Corresponds to the location resource label in the cloud_run_revision monitored resource.

GkeNamespace

GKE Namespace. The field names correspond to the resource metadata labels on monitored resources that fall under a namespace (for example, k8s_container or k8s_pod).

JSON representation
{
  "projectId": string,
  "location": string,
  "clusterName": string,
  "namespaceName": string
}
Fields
projectId

string

Output only. The project this resource lives in. For legacy services migrated from the Custom type, this may be a distinct project from the one parenting the service itself.

location

string

The location of the parent cluster. This may be a zone or region.

clusterName

string

The name of the parent cluster.

namespaceName

string

The name of this namespace.

GkeWorkload

A GKE Workload (Deployment, StatefulSet, etc). The field names correspond to the metadata labels on monitored resources that fall under a workload (for example, k8s_container or k8s_pod).

JSON representation
{
  "projectId": string,
  "location": string,
  "clusterName": string,
  "namespaceName": string,
  "topLevelControllerType": string,
  "topLevelControllerName": string
}
Fields
projectId

string

Output only. The project this resource lives in. For legacy services migrated from the Custom type, this may be a distinct project from the one parenting the service itself.

location

string

The location of the parent cluster. This may be a zone or region.

clusterName

string

The name of the parent cluster.

namespaceName

string

The name of the parent namespace.

topLevelControllerType

string

The type of this workload (for example, "Deployment" or "DaemonSet")

topLevelControllerName

string

The name of this workload.

GkeService

GKE Service. The "service" here represents a Kubernetes service object. The field names correspond to the resource labels on k8s_service monitored resources.

JSON representation
{
  "projectId": string,
  "location": string,
  "clusterName": string,
  "namespaceName": string,
  "serviceName": string
}
Fields
projectId

string

Output only. The project this resource lives in. For legacy services migrated from the Custom type, this may be a distinct project from the one parenting the service itself.

location

string

The location of the parent cluster. This may be a zone or region.

clusterName

string

The name of the parent cluster.

namespaceName

string

The name of the parent namespace.

serviceName

string

The name of this service.

Telemetry

Configuration for how to query telemetry on a Service.

JSON representation
{
  "resourceName": string
}
Fields
resourceName

string

The full name of the resource that defines this service. Formatted as described in https://cloud.google.com/apis/design/resourceNames.

Methods

create

Create a Service.

delete

Soft delete this Service.

get

Get the named Service.

list

List Services for this Metrics Scope.

patch

Update this Service.