If your application errors are not showing up in Error Reporting, then use the following steps to troubleshoot.

Before you begin

  1. Verify that Error Reporting can analyze your logs.

    Error Reporting is a global service built on Cloud Logging and can analyze log entries when all of the following are true:

    • The log entries are stored in a log bucket in the global location.
    • Customer-managed encryption keys (CMEK) are disabled on the log bucket. For information about how to determine the CMEK configuration for a log bucket, see Verify key enablement.
    • The log bucket satisfies one of the following:
      • The log bucket is stored in the same project where the logs originated.
      • The logs were routed to a project, and then that project stored those logs in a log bucket that it owns.

    To see if Error Reporting can analyze your logs, verify that you are storing your logs in buckets in the global region where the source and destination Google Cloud projects are the same.

    To see a list of sinks you have configured, run the following command:

    gcloud logging sinks list

    The command returns an output similar to the following:

    NAME               DESTINATION                                                                                                FILTER
    _Default                           NOT LOG_ID("") AND NOT LOG_ID("") AND NOT LOG_ID("") AND NOT LOG_ID("") AND NOT LOG_ID("") AND NOT LOG_ID("")
    _Required                         LOG_ID("") OR LOG_ID("") OR LOG_ID("") OR LOG_ID("") OR LOG_ID("") OR LOG_ID("")
    logs-from-samples                     (empty filter)
    regional_logs    (empty filter)
    test-logs                        (empty filter)

    In this example, the source Google Cloud project of the logs is my-team-project. As a result:

    • Error Reporting can analyze the logs routed by the _Default, _Required, and logs-from-samples sinks because they are routing logs to buckets that are in the global region within the same project.
    • Error Reporting can't analyze the logs stored in the log bucket named test-logs because the sink in my-team-project routes the logs to a log bucket in a different project.
    • Error Reporting can't analyze logs routed by the regional_logs sink because it routes logs to a regional bucket in the europe-west1 region.
  2. Ensure that you have the Google Cloud CLI installed.

  3. Ensure that you have the beta component enabled for the gcloud CLI.

When using logs

This section provides troubleshooting support when your error data is written to Cloud Logging buckets, and you rely on Error Reporting to automatically analyze those log buckets.

Generate a sample log entry

To confirm your project settings, you can programmatically generate a log entry that will be picked up by Error Reporting with the following gcloud command:

gcloud logging write --payload-type=json test-errors-log \
    {"service": "manual-testing"},
    "message": "Test Error\n at /test.js:42:42",
    "context": {"httpRequest":
      {"url": "/test","method": "GET","responseStatusCode": 500}}}'

Then open Error Reporting and confirm that you see the newly created error.

Confirm the log entry format

Navigate to the Cloud Logging page and locate a log entry that contains exception data sent from your application.

Confirm that the log entry uses the expected format.

When using the Error Reporting API

  1. Enable the required API.

    Enable the API

  2. Send a test error

    Try sending an error to the service manually.

    You can report a test error to Error Reporting using the following gcloud command:

    gcloud beta error-reporting events report --service Manual --service-version test1 \
      --message "java.lang.TestError: msg
        at com.example.TestClass.test(
        at com.example.AnotherClass("

    You can use a cURL command to test your REST API calls. Replace PROJECT_ID and API_KEY with your valid values before sending the following command:

    curl -X POST -H "Content-Type: application/json" \
      -d '{"message":"java.lang.TestError: msg\n\tat com.example.TestClass.test(\n\tat com.example.AnotherClass(","serviceContext":{"service":"manual-testing"}}' \
  3. Confirm the sent payload

    Ensure that your application is sending exception data to the API in the correct format and that it contains the required attributes.