Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/google/cloud/errorreporting_v1beta1/types/common.py: 100%
43 statements
« prev ^ index » next coverage.py v7.3.2, created at 2023-12-08 06:45 +0000
« prev ^ index » next coverage.py v7.3.2, created at 2023-12-08 06:45 +0000
1# -*- coding: utf-8 -*-
2# Copyright 2023 Google LLC
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16from __future__ import annotations
18from typing import MutableMapping, MutableSequence
20import proto # type: ignore
22from google.protobuf import timestamp_pb2 # type: ignore
25__protobuf__ = proto.module(
26 package="google.devtools.clouderrorreporting.v1beta1",
27 manifest={
28 "ResolutionStatus",
29 "ErrorGroup",
30 "TrackingIssue",
31 "ErrorEvent",
32 "ServiceContext",
33 "ErrorContext",
34 "HttpRequestContext",
35 "SourceLocation",
36 },
37)
40class ResolutionStatus(proto.Enum):
41 r"""Resolution status of an error group.
43 Values:
44 RESOLUTION_STATUS_UNSPECIFIED (0):
45 Status is unknown. When left unspecified in
46 requests, it is treated like OPEN.
47 OPEN (1):
48 The error group is not being addressed. This
49 is the default for new groups. It is also used
50 for errors re-occurring after marked RESOLVED.
51 ACKNOWLEDGED (2):
52 Error Group manually acknowledged, it can
53 have an issue link attached.
54 RESOLVED (3):
55 Error Group manually resolved, more events
56 for this group are not expected to occur.
57 MUTED (4):
58 The error group is muted and excluded by
59 default on group stats requests.
60 """
61 RESOLUTION_STATUS_UNSPECIFIED = 0
62 OPEN = 1
63 ACKNOWLEDGED = 2
64 RESOLVED = 3
65 MUTED = 4
68class ErrorGroup(proto.Message):
69 r"""Description of a group of similar error events.
71 Attributes:
72 name (str):
73 The group resource name.
74 Example:
75 <code>projects/my-project-123/groups/CNSgkpnppqKCUw</code>
76 group_id (str):
77 Group IDs are unique for a given project. If
78 the same kind of error occurs in different
79 service contexts, it will receive the same group
80 ID.
81 tracking_issues (MutableSequence[google.cloud.errorreporting_v1beta1.types.TrackingIssue]):
82 Associated tracking issues.
83 resolution_status (google.cloud.errorreporting_v1beta1.types.ResolutionStatus):
84 Error group's resolution status.
85 An unspecified resolution status will be
86 interpreted as OPEN
87 """
89 name: str = proto.Field(
90 proto.STRING,
91 number=1,
92 )
93 group_id: str = proto.Field(
94 proto.STRING,
95 number=2,
96 )
97 tracking_issues: MutableSequence["TrackingIssue"] = proto.RepeatedField(
98 proto.MESSAGE,
99 number=3,
100 message="TrackingIssue",
101 )
102 resolution_status: "ResolutionStatus" = proto.Field(
103 proto.ENUM,
104 number=5,
105 enum="ResolutionStatus",
106 )
109class TrackingIssue(proto.Message):
110 r"""Information related to tracking the progress on resolving the
111 error.
113 Attributes:
114 url (str):
115 A URL pointing to a related entry in an issue tracking
116 system. Example:
117 ``https://github.com/user/project/issues/4``
118 """
120 url: str = proto.Field(
121 proto.STRING,
122 number=1,
123 )
126class ErrorEvent(proto.Message):
127 r"""An error event which is returned by the Error Reporting
128 system.
130 Attributes:
131 event_time (google.protobuf.timestamp_pb2.Timestamp):
132 Time when the event occurred as provided in
133 the error report. If the report did not contain
134 a timestamp, the time the error was received by
135 the Error Reporting system is used.
136 service_context (google.cloud.errorreporting_v1beta1.types.ServiceContext):
137 The ``ServiceContext`` for which this error was reported.
138 message (str):
139 The stack trace that was reported or logged
140 by the service.
141 context (google.cloud.errorreporting_v1beta1.types.ErrorContext):
142 Data about the context in which the error
143 occurred.
144 """
146 event_time: timestamp_pb2.Timestamp = proto.Field(
147 proto.MESSAGE,
148 number=1,
149 message=timestamp_pb2.Timestamp,
150 )
151 service_context: "ServiceContext" = proto.Field(
152 proto.MESSAGE,
153 number=2,
154 message="ServiceContext",
155 )
156 message: str = proto.Field(
157 proto.STRING,
158 number=3,
159 )
160 context: "ErrorContext" = proto.Field(
161 proto.MESSAGE,
162 number=5,
163 message="ErrorContext",
164 )
167class ServiceContext(proto.Message):
168 r"""Describes a running service that sends errors.
169 Its version changes over time and multiple versions can run in
170 parallel.
172 Attributes:
173 service (str):
174 An identifier of the service, such as the name of the
175 executable, job, or Google App Engine service name. This
176 field is expected to have a low number of values that are
177 relatively stable over time, as opposed to ``version``,
178 which can be changed whenever new code is deployed.
180 Contains the service name for error reports extracted from
181 Google App Engine logs or ``default`` if the App Engine
182 default service is used.
183 version (str):
184 Represents the source code version that the
185 developer provided, which could represent a
186 version label or a Git SHA-1 hash, for example.
187 For App Engine standard environment, the version
188 is set to the version of the app.
189 resource_type (str):
190 Type of the MonitoredResource. List of
191 possible values:
192 https://cloud.google.com/monitoring/api/resources
194 Value is set automatically for incoming errors
195 and must not be set when reporting errors.
196 """
198 service: str = proto.Field(
199 proto.STRING,
200 number=2,
201 )
202 version: str = proto.Field(
203 proto.STRING,
204 number=3,
205 )
206 resource_type: str = proto.Field(
207 proto.STRING,
208 number=4,
209 )
212class ErrorContext(proto.Message):
213 r"""A description of the context in which an error occurred.
214 This data should be provided by the application when reporting
215 an error, unless the
216 error report has been generated automatically from Google App
217 Engine logs.
219 Attributes:
220 http_request (google.cloud.errorreporting_v1beta1.types.HttpRequestContext):
221 The HTTP request which was processed when the
222 error was triggered.
223 user (str):
224 The user who caused or was affected by the crash. This can
225 be a user ID, an email address, or an arbitrary token that
226 uniquely identifies the user. When sending an error report,
227 leave this field empty if the user was not logged in. In
228 this case the Error Reporting system will use other data,
229 such as remote IP address, to distinguish affected users.
230 See ``affected_users_count`` in ``ErrorGroupStats``.
231 report_location (google.cloud.errorreporting_v1beta1.types.SourceLocation):
232 The location in the source code where the
233 decision was made to report the error, usually
234 the place where it was logged. For a logged
235 exception this would be the source line where
236 the exception is logged, usually close to the
237 place where it was caught.
238 """
240 http_request: "HttpRequestContext" = proto.Field(
241 proto.MESSAGE,
242 number=1,
243 message="HttpRequestContext",
244 )
245 user: str = proto.Field(
246 proto.STRING,
247 number=2,
248 )
249 report_location: "SourceLocation" = proto.Field(
250 proto.MESSAGE,
251 number=3,
252 message="SourceLocation",
253 )
256class HttpRequestContext(proto.Message):
257 r"""HTTP request data that is related to a reported error.
258 This data should be provided by the application when reporting
259 an error, unless the
260 error report has been generated automatically from Google App
261 Engine logs.
263 Attributes:
264 method (str):
265 The type of HTTP request, such as ``GET``, ``POST``, etc.
266 url (str):
267 The URL of the request.
268 user_agent (str):
269 The user agent information that is provided
270 with the request.
271 referrer (str):
272 The referrer information that is provided
273 with the request.
274 response_status_code (int):
275 The HTTP response status code for the
276 request.
277 remote_ip (str):
278 The IP address from which the request
279 originated. This can be IPv4, IPv6, or a token
280 which is derived from the IP address, depending
281 on the data that has been provided in the error
282 report.
283 """
285 method: str = proto.Field(
286 proto.STRING,
287 number=1,
288 )
289 url: str = proto.Field(
290 proto.STRING,
291 number=2,
292 )
293 user_agent: str = proto.Field(
294 proto.STRING,
295 number=3,
296 )
297 referrer: str = proto.Field(
298 proto.STRING,
299 number=4,
300 )
301 response_status_code: int = proto.Field(
302 proto.INT32,
303 number=5,
304 )
305 remote_ip: str = proto.Field(
306 proto.STRING,
307 number=6,
308 )
311class SourceLocation(proto.Message):
312 r"""Indicates a location in the source code of the service for which
313 errors are reported. ``functionName`` must be provided by the
314 application when reporting an error, unless the error report
315 contains a ``message`` with a supported exception stack trace. All
316 fields are optional for the later case.
318 Attributes:
319 file_path (str):
320 The source code filename, which can include a
321 truncated relative path, or a full path from a
322 production machine.
323 line_number (int):
324 1-based. 0 indicates that the line number is
325 unknown.
326 function_name (str):
327 Human-readable name of a function or method. The value can
328 include optional context like the class or package name. For
329 example, ``my.package.MyClass.method`` in case of Java.
330 """
332 file_path: str = proto.Field(
333 proto.STRING,
334 number=1,
335 )
336 line_number: int = proto.Field(
337 proto.INT32,
338 number=2,
339 )
340 function_name: str = proto.Field(
341 proto.STRING,
342 number=4,
343 )
346__all__ = tuple(sorted(__protobuf__.manifest))