Reference documentation and code samples for the Stackdriver Monitoring V3 Client class Service.
AServiceis a discrete, autonomous, and network-accessible unit, designed
to solve an individual concern
(Wikipedia). In
Cloud Monitoring, aServiceacts as the root resource under which
operational aspects of the service are accessible.
Generated from protobuf messagegoogle.monitoring.v3.Service
Namespace
Google \ Cloud \ Monitoring \ V3
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ name
string
Identifier. Resource name for this Service. The format is: projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]
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.
getName
Identifier. Resource name for this Service. The format is:
projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]
Returns
Type
Description
string
setName
Identifier. Resource name for this Service. The format is:
projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]
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.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Stackdriver Monitoring V3 Client - Class Service (2.1.2)\n\nVersion latestkeyboard_arrow_down\n\n- [2.1.2 (latest)](/php/docs/reference/cloud-monitoring/latest/V3.Service)\n- [2.1.1](/php/docs/reference/cloud-monitoring/2.1.1/V3.Service)\n- [2.0.1](/php/docs/reference/cloud-monitoring/2.0.1/V3.Service)\n- [1.12.1](/php/docs/reference/cloud-monitoring/1.12.1/V3.Service)\n- [1.11.1](/php/docs/reference/cloud-monitoring/1.11.1/V3.Service)\n- [1.10.3](/php/docs/reference/cloud-monitoring/1.10.3/V3.Service)\n- [1.9.0](/php/docs/reference/cloud-monitoring/1.9.0/V3.Service)\n- [1.8.0](/php/docs/reference/cloud-monitoring/1.8.0/V3.Service)\n- [1.7.1](/php/docs/reference/cloud-monitoring/1.7.1/V3.Service)\n- [1.6.0](/php/docs/reference/cloud-monitoring/1.6.0/V3.Service)\n- [1.5.1](/php/docs/reference/cloud-monitoring/1.5.1/V3.Service)\n- [1.4.0](/php/docs/reference/cloud-monitoring/1.4.0/V3.Service)\n- [1.3.2](/php/docs/reference/cloud-monitoring/1.3.2/V3.Service)\n- [1.2.2](/php/docs/reference/cloud-monitoring/1.2.2/V3.Service) \nReference documentation and code samples for the Stackdriver Monitoring V3 Client class Service.\n\nA `Service` is a discrete, autonomous, and network-accessible unit, designed\nto solve an individual concern\n([Wikipedia](https://en.wikipedia.org/wiki/Service-orientation)). In\nCloud Monitoring, a `Service` acts as the root resource under which\noperational aspects of the service are accessible.\n\nGenerated from protobuf message `google.monitoring.v3.Service`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Monitoring \\\\ V3\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getName\n\nIdentifier. Resource name for this Service. The format is:\nprojects/\\[PROJECT_ID_OR_NUMBER\\]/services/\\[SERVICE_ID\\]\n\n### setName\n\nIdentifier. Resource name for this Service. The format is:\nprojects/\\[PROJECT_ID_OR_NUMBER\\]/services/\\[SERVICE_ID\\]\n\n### getDisplayName\n\nName used for UI elements listing this Service.\n\n### setDisplayName\n\nName used for UI elements listing this Service.\n\n### getCustom\n\nCustom service type.\n\n### hasCustom\n\n### setCustom\n\nCustom service type.\n\n### getAppEngine\n\nType used for App Engine services.\n\n### hasAppEngine\n\n### setAppEngine\n\nType used for App Engine services.\n\n### getCloudEndpoints\n\nType used for Cloud Endpoints services.\n\n### hasCloudEndpoints\n\n### setCloudEndpoints\n\nType used for Cloud Endpoints services.\n\n### getClusterIstio\n\nType used for Istio services that live in a Kubernetes cluster.\n\n### hasClusterIstio\n\n### setClusterIstio\n\nType used for Istio services that live in a Kubernetes cluster.\n\n### getMeshIstio\n\nType used for Istio services scoped to an Istio mesh.\n\n### hasMeshIstio\n\n### setMeshIstio\n\nType used for Istio services scoped to an Istio mesh.\n\n### getIstioCanonicalService\n\nType used for canonical services scoped to an Istio mesh.\n\nMetrics for Istio are\n[documented here](https://istio.io/latest/docs/reference/config/metrics/)\n\n### hasIstioCanonicalService\n\n### setIstioCanonicalService\n\nType used for canonical services scoped to an Istio mesh.\n\nMetrics for Istio are\n[documented here](https://istio.io/latest/docs/reference/config/metrics/)\n\n### getCloudRun\n\nType used for Cloud Run services.\n\n### hasCloudRun\n\n### setCloudRun\n\nType used for Cloud Run services.\n\n### getGkeNamespace\n\nType used for GKE Namespaces.\n\n### hasGkeNamespace\n\n### setGkeNamespace\n\nType used for GKE Namespaces.\n\n### getGkeWorkload\n\nType used for GKE Workloads.\n\n### hasGkeWorkload\n\n### setGkeWorkload\n\nType used for GKE Workloads.\n\n### getGkeService\n\nType used for GKE Services (the Kubernetes concept of a service).\n\n### hasGkeService\n\n### setGkeService\n\nType used for GKE Services (the Kubernetes concept of a service).\n\n### getBasicService\n\nMessage that contains the service type and service labels of this service\nif it is a basic service.\n\nDocumentation and examples\n[here](https://cloud.google.com/stackdriver/docs/solutions/slo-monitoring/api/api-structures#basic-svc-w-basic-sli).\n\n### hasBasicService\n\n### clearBasicService\n\n### setBasicService\n\nMessage that contains the service type and service labels of this service\nif it is a basic service.\n\nDocumentation and examples\n[here](https://cloud.google.com/stackdriver/docs/solutions/slo-monitoring/api/api-structures#basic-svc-w-basic-sli).\n\n### getTelemetry\n\nConfiguration for how to query telemetry on a Service.\n\n### hasTelemetry\n\n### clearTelemetry\n\n### setTelemetry\n\nConfiguration for how to query telemetry on a Service.\n\n### getUserLabels\n\nLabels which have been used to annotate the service. Label keys must start\nwith a letter. Label keys and values may contain lowercase letters,\nnumbers, underscores, and dashes. Label keys and values have a maximum\nlength of 63 characters, and must be less than 128 bytes in size. Up to 64\nlabel entries may be stored. For labels which do not have a semantic value,\nthe empty string may be supplied for the label value.\n\n### setUserLabels\n\nLabels which have been used to annotate the service. Label keys must start\nwith a letter. Label keys and values may contain lowercase letters,\nnumbers, underscores, and dashes. Label keys and values have a maximum\nlength of 63 characters, and must be less than 128 bytes in size. Up to 64\nlabel entries may be stored. For labels which do not have a semantic value,\nthe empty string may be supplied for the label value.\n\n### getIdentifier"]]