Skip to main content

services

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

Overview

Nameservices
TypeResource
Idgoogle.monitoring.services

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringIdentifier. Resource name for this Service. The format is: projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]
appEngineobjectType used for App Engine services. (id: AppEngine)
basicServiceobjectMessage that contains the service type and service labels of this service if it is a basic service. Documentation and examples here (https://cloud.google.com/stackdriver/docs/solutions/slo-monitoring/api/api-structures#basic-svc-w-basic-sli). (id: BasicService)
cloudEndpointsobjectType used for Cloud Endpoints services. (id: CloudEndpoints)
cloudRunobjectType used for Cloud Run services. (id: CloudRun)
clusterIstioobjectType used for Istio services that live in a Kubernetes cluster. (id: ClusterIstio)
customobjectCustom service type. (id: Custom)
displayNamestringName used for UI elements listing this Service.
gkeNamespaceobjectType used for GKE Namespaces. (id: GkeNamespace)
gkeServiceobjectType used for GKE Services (the Kubernetes concept of a service). (id: GkeService)
gkeWorkloadobjectType used for GKE Workloads. (id: GkeWorkload)
istioCanonicalServiceobjectType used for canonical services scoped to an Istio mesh. Metrics for Istio are documented here (https://istio.io/latest/docs/reference/config/metrics/) (id: IstioCanonicalService)
meshIstioobjectType used for Istio services scoped to an Istio mesh. (id: MeshIstio)
telemetryobjectConfiguration for how to query telemetry on a Service. (id: Telemetry)
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

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
services_listselectparentType, parentfilter, pageSize, pageTokenList Services for this Metrics Scope.
services_createinsertparentType, parentserviceIdCreate a Service.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
parentstring
parentTypestring
filterstring
pageSizeinteger (int32)
pageTokenstring
serviceIdstring

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 parentType = '{{ parentType }}' -- required
AND parent = '{{ parent }}' -- required
AND filter = '{{ filter }}'
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}';

INSERT examples

Create a Service.

INSERT INTO google.monitoring.services (
data__name,
data__displayName,
data__custom,
data__appEngine,
data__cloudEndpoints,
data__clusterIstio,
data__meshIstio,
data__istioCanonicalService,
data__cloudRun,
data__gkeNamespace,
data__gkeWorkload,
data__gkeService,
data__basicService,
data__telemetry,
data__userLabels,
parentType,
parent,
serviceId
)
SELECT
'{{ name }}',
'{{ displayName }}',
'{{ custom }}',
'{{ appEngine }}',
'{{ cloudEndpoints }}',
'{{ clusterIstio }}',
'{{ meshIstio }}',
'{{ istioCanonicalService }}',
'{{ cloudRun }}',
'{{ gkeNamespace }}',
'{{ gkeWorkload }}',
'{{ gkeService }}',
'{{ basicService }}',
'{{ telemetry }}',
'{{ userLabels }}',
'{{ parentType }}',
'{{ parent }}',
'{{ serviceId }}'
RETURNING
name,
appEngine,
basicService,
cloudEndpoints,
cloudRun,
clusterIstio,
custom,
displayName,
gkeNamespace,
gkeService,
gkeWorkload,
istioCanonicalService,
meshIstio,
telemetry,
userLabels
;