Skip to main content

services

Creates, updates, deletes, gets or lists a services resource.

Overview

Nameservices
TypeResource
Idgoogle.monitoring.services

Fields

NameDatatypeDescription
namestringIdentifier. Resource name for this Service. The format is: projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]
appEngineobjectApp Engine service. Learn more at https://cloud.google.com/appengine.
basicServiceobjectA well-known service type, defined by its service type and service labels. Documentation and examples here (https://cloud.google.com/stackdriver/docs/solutions/slo-monitoring/api/api-structures#basic-svc-w-basic-sli).
cloudEndpointsobjectCloud Endpoints service. Learn more at https://cloud.google.com/endpoints.
cloudRunobjectCloud Run service. Learn more at https://cloud.google.com/run.
clusterIstioobjectIstio 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.
customobjectUse a custom service to designate a service that you want to monitor when none of the other service types (like App Engine, Cloud Run, or a GKE type) matches your intended service.
displayNamestringName used for UI elements listing this Service.
gkeNamespaceobjectGKE 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).
gkeServiceobjectGKE Service. The "service" here represents a Kubernetes service object (https://kubernetes.io/docs/concepts/services-networking/service). The field names correspond to the resource labels on k8s_service monitored resources (https://cloud.google.com/monitoring/api/resources#tag_k8s_service).
gkeWorkloadobjectA 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).
istioCanonicalServiceobjectCanonical service scoped to an Istio mesh. Anthos clusters running ASM >= 1.6.8 will have their services ingested as this type.
meshIstioobjectIstio service scoped to an Istio mesh. Anthos clusters running ASM < 1.6.8 will have their services ingested as this type.
telemetryobjectConfiguration for how to query telemetry on a Service.
userLabelsobjectLabels 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.

Methods

NameAccessible byRequired ParamsDescription
services_listSELECTparent, parentTypeList Services for this Metrics Scope.
services_createINSERTparent, parentTypeCreate a Service.

SELECT examples

List Services for this Metrics Scope.

SELECT
name,
appEngine,
basicService,
cloudEndpoints,
cloudRun,
clusterIstio,
custom,
displayName,
gkeNamespace,
gkeService,
gkeWorkload,
istioCanonicalService,
meshIstio,
telemetry,
userLabels
FROM google.monitoring.services
WHERE parent = '{{ parent }}'
AND parentType = '{{ parentType }}';

INSERT example

Use the following StackQL query and manifest file to create a new services resource.

/*+ create */
INSERT INTO google.monitoring.services (
parent,
parentType,
name,
displayName,
custom,
appEngine,
cloudEndpoints,
clusterIstio,
meshIstio,
istioCanonicalService,
cloudRun,
gkeNamespace,
gkeWorkload,
gkeService,
basicService,
telemetry,
userLabels
)
SELECT
'{{ parent }}',
'{{ parentType }}',
'{{ name }}',
'{{ displayName }}',
'{{ custom }}',
'{{ appEngine }}',
'{{ cloudEndpoints }}',
'{{ clusterIstio }}',
'{{ meshIstio }}',
'{{ istioCanonicalService }}',
'{{ cloudRun }}',
'{{ gkeNamespace }}',
'{{ gkeWorkload }}',
'{{ gkeService }}',
'{{ basicService }}',
'{{ telemetry }}',
'{{ userLabels }}'
;