Reference documentation and code samples for the Stackdriver Error Reporting V1beta1 Client class ServiceContext.
Describes a running service that sends errors.
Its version changes over time and multiple versions can run in parallel.
Generated from protobuf messagegoogle.devtools.clouderrorreporting.v1beta1.ServiceContext
Namespace
Google \ Cloud \ ErrorReporting \ V1beta1
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ service
string
An identifier of the service, such as the name of the executable, job, or Google App Engine service name. This field is expected to have a low number of values that are relatively stable over time, as opposed toversion, which can be changed whenever new code is deployed. Contains the service name for error reports extracted from Google App Engine logs ordefaultif the App Engine default service is used.
↳ version
string
Represents the source code version that the developer provided, which could represent a version label or a Git SHA-1 hash, for example. For App Engine standard environment, the version is set to the version of the app.
An identifier of the service, such as the name of the
executable, job, or Google App Engine service name. This field is expected
to have a low number of values that are relatively stable over time, as
opposed toversion, which can be changed whenever new code is deployed.
Contains the service name for error reports extracted from Google
App Engine logs ordefaultif the App Engine default service is used.
Returns
Type
Description
string
setService
An identifier of the service, such as the name of the
executable, job, or Google App Engine service name. This field is expected
to have a low number of values that are relatively stable over time, as
opposed toversion, which can be changed whenever new code is deployed.
Contains the service name for error reports extracted from Google
App Engine logs ordefaultif the App Engine default service is used.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getVersion
Represents the source code version that the developer provided,
which could represent a version label or a Git SHA-1 hash, for example.
For App Engine standard environment, the version is set to the version of
the app.
Returns
Type
Description
string
setVersion
Represents the source code version that the developer provided,
which could represent a version label or a Git SHA-1 hash, for example.
For App Engine standard environment, the version is set to the version of
the app.
[[["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 Error Reporting V1beta1 Client - Class ServiceContext (0.23.1)\n\nVersion latestkeyboard_arrow_down\n\n- [0.23.1 (latest)](/php/docs/reference/cloud-error-reporting/latest/V1beta1.ServiceContext)\n- [0.23.0](/php/docs/reference/cloud-error-reporting/0.23.0/V1beta1.ServiceContext)\n- [0.22.10](/php/docs/reference/cloud-error-reporting/0.22.10/V1beta1.ServiceContext)\n- [0.21.1](/php/docs/reference/cloud-error-reporting/0.21.1/V1beta1.ServiceContext)\n- [0.20.2](/php/docs/reference/cloud-error-reporting/0.20.2/V1beta1.ServiceContext)\n- [0.19.12](/php/docs/reference/cloud-error-reporting/0.19.12/V1beta1.ServiceContext) \n| **Beta**\n|\n|\n| This library is covered by the [Pre-GA Offerings Terms](/terms/service-terms#1)\n| of the Terms of Service. Pre-GA libraries might have limited support,\n| and changes to pre-GA libraries might not be compatible with other pre-GA versions.\n| For more information, see the\n[launch stage descriptions](/products#product-launch-stages). \nReference documentation and code samples for the Stackdriver Error Reporting V1beta1 Client class ServiceContext.\n\nDescribes a running service that sends errors.\n\nIts version changes over time and multiple versions can run in parallel.\n\nGenerated from protobuf message `google.devtools.clouderrorreporting.v1beta1.ServiceContext`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ ErrorReporting \\\\ V1beta1\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getService\n\nAn identifier of the service, such as the name of the\nexecutable, job, or Google App Engine service name. This field is expected\nto have a low number of values that are relatively stable over time, as\nopposed to `version`, which can be changed whenever new code is deployed.\n\nContains the service name for error reports extracted from Google\nApp Engine logs or `default` if the App Engine default service is used.\n\n### setService\n\nAn identifier of the service, such as the name of the\nexecutable, job, or Google App Engine service name. This field is expected\nto have a low number of values that are relatively stable over time, as\nopposed to `version`, which can be changed whenever new code is deployed.\n\nContains the service name for error reports extracted from Google\nApp Engine logs or `default` if the App Engine default service is used.\n\n### getVersion\n\nRepresents the source code version that the developer provided,\nwhich could represent a version label or a Git SHA-1 hash, for example.\n\nFor App Engine standard environment, the version is set to the version of\nthe app.\n\n### setVersion\n\nRepresents the source code version that the developer provided,\nwhich could represent a version label or a Git SHA-1 hash, for example.\n\nFor App Engine standard environment, the version is set to the version of\nthe app.\n\n### getResourceType\n\nType of the MonitoredResource. List of possible values:\n\u003chttps://cloud.google.com/monitoring/api/resources\u003e\nValue is set automatically for incoming errors and must not be set when\nreporting errors.\n\n### setResourceType\n\nType of the MonitoredResource. List of possible values:\n\u003chttps://cloud.google.com/monitoring/api/resources\u003e\nValue is set automatically for incoming errors and must not be set when\nreporting errors."]]