Google Stackdriver Error Reporting blank (not set up) - google-cloud-platform

We are starting to enable Stackdriver for our project, but while I have a ubuntu instance with stackdriver logging, and I am getting the logs shipped back (I can see the logs in Stackdriver Logging), when I browse to Error Reporting, it's just a blank screen with a button to "Setup Error Reporting", which takes me to some API documentation which I think is tailored for new application coding. We are running nginx and the logging is working, but I can't for the life of me figure out how to get the Error Reporting to work properly, if that's even doable.

"Setup Error Reporting" should guide you to the setup documentation (not API documentation). Depending on the platform you are using, you might need to perform some changes in your application's code or log format. Read more at https://cloud.google.com/error-reporting/docs/setup/
If you have Stackdriver Logging setup and on Google Compute Engine, the requirement is for your exception stack traces to be log in single log entries.

Related

Logging jobs on a Google Cloud VM

I am using a Google Cloud virtual machine to run several python scripts scheduled on a cron, I am looking for some way to check that they ran.
When I look in my logs I see nothing, so I guess simply running a .py file is not logged? Is there a way to turn on logging at this level? What are the usual approaches for such things?
The technology for recording log information in GCP is called Stackdriver. You have a couple of choices for how to log within your application. The first is to instrument your code with Stackdriver APIs which explicitly write data to the Stackdriver subsytem. Here are the docs for that and here is further recipe.
A second story is that you install the Stackdriver Logging Agent on your Compute Engine. This will then allow you to tap into other sources of logging output such as local syslog.

Google Cloud Platform - Stackdriver Trace List all empty

I have a Google App Engine application that is listed under the Stackdriver Trace, but when I go to trace list there is nothing.
However, the logs and error reporting works.
Is there a special setting you need to set in order to get the traces? I've looked through many tutorials and it seems that the traces automatically appear?
Stackdriver Trace is not automatically setup for Compute Engine, App Engine Flexible or Containers. Stackdriver Trace is automatically enabled for App Engine Standard.
You must instrument your application first, then you can review the Stackdriver Trace logs.
Start with this link. Instrumentation is language specific:
Setting Up Stackdriver Trace

How to get Error logs to appear in Stack Driver Error Reporting?

I am having difficulties integrating with Stackdriver Error Reporting.
When using the stack driver log viewer I can see that it has correctly identified it as an error event due to the orange '!!' on the log line.
The logs are coming from a Java Application in a pod on Kubernetes. I am using SLF4J and logback to control my logging. I realise this is not the example in the docs which suggest fluentd however I would like to avoid changing my logging across all applications.
Following the troubleshooting guide I am able to submit a log line that is picked up and also directly report an error. This makes me think the issue must be permissions related. I have tried adding the "Error Reporting Admin" role onto the compute engine default service account and onto Kubernetes Engine Service Agent but this has not worked.
Am I missing something?
The !! in the logs viewer means that the LogEntry.severity field has a value of ERROR (which is provided by the client that wrote the entry). Entries that land in Error Reporting need to meet a few other criteria: https://cloud.google.com/error-reporting/docs/formatting-error-messages
You might also be interested in the details on how errors are grouped together: https://cloud.google.com/error-reporting/docs/grouping-errors
The "Error Reporting Admin" role would allow someone (or a service account) to perform actions like muting an error group. There are no permissions requirements to get data from logging into Error Reporting.

Google cloud platform view request logs?

I am new to Google Cloud platform, I am trying out Google's Talent Solution APIs and getting 400 and 409 errors. I would like to know how to see the error trace on my google cloud platform console for those requests? I could see those requests in the dashboard, not sure if I can drill down and see the exact error?
If you see these errors in your Developer Console main dashboard in the "Error Reporting" section, you should be able to click on the "Go to Error Reporting" link. There, you'll see a list of errors that happened lately. Clicking on one of them, you'll see more info on that specific error (occurrences, last seen, etc...) and a stack trace sample. Further down, you'll see a list of the last occurrences for that error and their respective link to the logs.
Alternatively, you may go directly to your Dev Console -> Logging section and choose the Talent Solution resource if available or the resource where you call the API from (App Engine, GKE, etc...) and filter the logs by error code to get details about these.

Logging level of Google Cloud Profiler Java agent

How to change the log level of Java profiler? I am running the profiler outside GCP.
Although, Profiler is working fine. It is repeatedly logging following errors:
E0803 12:37:37.677731 22 cloud_env.cc:61] Request to the GCE metadata server failed, status code: 404
E0803 12:37:37.677788 22 cloud_env.cc:148] Failed to read the zone name
How can I disable these logs?
For Stackdriver Logging you can use log exclusion filters to create customised filters for logs you want to exclude.
In the Logs Viewer panel, you can enter a filter expression that matches the log entry you want to exclude. This documentation explains about various interfaces to create filters.
You may also want to export the log entries before excluding them, if you do not want to permanently lose the excluded logs.
With respect to this issue in general (i.e. for third party logging), I went ahead and created a feature request on your behalf. Please star it so that you could receive updates about this feature request and do not hesitate to add additional comments to provide details of the desired implementation. You can track the feature request by following this link.