Setting up Stackdriver Error Reporting to show detailed information -
i have basic setup working sent logs gke , format them according rules stackdriver error reporting.
i can see stacktraces additional information user, version, ... missing. see: error reporting detail view
when click on show logs can see formated log entry , seems me in right format... log entry in stackdriver logging example looks this:
{ insertid: "vd0zy9g5mw3iof" jsonpayload: { message: { context: { reportlocation: { functionname: "error_router" filepath: "/usr/local/lib/python2.7/site-packages/flask_restplus/api.py" linenumber: 554 } httprequest: { method: "post" remoteip: "213.47.170.171" referrer: "https://api-staging.smaxtec.com/api/v1/" useragent: "mozilla/5.0 (windows nt 10.0; win64; x64) applewebkit/537.36 (khtml, gecko) chrome/57.0.2987.133 safari/537.36" url: "https://api-staging.smaxtec.com/api/v1/device/update_name" responsestatuscode: 404 } user: "569e0bcda80a5f1c07b542be" } message: "traceback (most recent call last): file "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1612, in full_dispatch_request rv = self.dispatch_request() file "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1598, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) file "/usr/local/lib/python2.7/site-packages/flask_restplus/api.py", line 313, in wrapper resp = resource(*args, **kwargs) file "/usr/local/lib/python2.7/site-packages/flask/views.py", line 84, in view return self.dispatch_request(*args, **kwargs) file "/usr/local/lib/python2.7/site-packages/flask_restplus/resource.py", line 44, in dispatch_request resp = meth(*args, **kwargs) file "/usr/local/lib/python2.7/site-packages/webargs/core.py", line 445, in wrapper return func(*new_args, **kwargs) file "/app/anthilldata/core/restapi/namespace.py", line 154, in dump_wrapper response = func(*args, **kwargs) file "/app/anthilldata/api/publicv1/base.py", line 144, in decorated return f(*args, auth=auth, **kwargs) file "/app/anthilldata/api/publicv1/device.py", line 98, in post dev = devices.getbyid(device_id) file "/app/anthilldata/devices/__init__.py", line 102, in getbyid device = self._getbyid(id) file "/app/anthilldata/core/__init__.py", line 171, in _getbyid self.__model__.__name__, id)) notfounderror: device(strisdfsdfsdfsdfsdfsdfng) not found " servicecontext: { version: "v1.20-25-gf94b2b7" service: "anthilldata" } } thread: 140663840671488 } resource: { type: "container" labels: { pod_id: "api-staging-deployment-3325000162-npq9r" zone: "europe-west1-d" project_id: "smaxtec-system" cluster_name: "kuhbernetes1" container_name: "anthilldata" namespace_id: "default" instance_id: "4882784730069069317" } } timestamp: "2017-04-07t08:06:30.247392892z" severity: "error" labels: { container.googleapis.com/container_name: "anthilldata" compute.googleapis.com/resource_name: "fluentd-cloud-logging-gke-kuhbernetes1-default-pool-b875e508-7x" container.googleapis.com/instance_id: "4882784730069069317" container.googleapis.com/pod_name: "api-staging-deployment-3325000162-npq9r" container.googleapis.com/stream: "stderr" container.googleapis.com/namespace_name: "default" compute.googleapis.com/resource_type: "instance" compute.googleapis.com/resource_id: "4882784730069069317" container.googleapis.com/cluster_name: "kuhbernetes1" } logname: "projects/smaxtec-system/logs/anthilldata" }
the user, httpcontext , other context attributes in json log. missing result shown in example can see effected user , http request?
the entry payload in example has structure like
jsonpayload: { message: { context: {...}, message: "...", servicecontext: {...} } }
and intermediate message
structure causing problems. want
jsonpayload: { context: {...}, message: "...", servicecontext: {...} }
error reporting still able parse out exception message, expecting other fields @ specific json paths.
i tried writing 2 messages stackdriver logging, , without message
nesting. both appeared in error reporting, 1 without included service, version, user, etc in sample.
Comments
Post a Comment