This page describes how you can monitor the health of APIs you own using the logs and metrics Google Cloud Endpoints maintains for you automatically. When users make requests to your API, Cloud Endpoints logs information about the requests and responses. Cloud Endpoints also tracks a comprehensive set of metrics for usage and performance of your API, that covers the golden signals that can be tracked by black-box monitoring.
Before you begin
You must deploy your API and send requests to it in order to generate logs and metrics for viewing. If you don't have anything set up yet, try the Cloud Endpoints Quickstart.
When you are debugging an issue with your service or just want to ensure that everything is running fine, you can start right from your Cloud Endpoints dashboard. First navigate to your API's overview:
Open the Cloud Endpoints dashboard for your project:
If you have more than one API, click the one you would like to monitor.
Ensure you are on the Overview tab.
Right at the top are graphs for some of the metrics, so you can spot any spikes and drops right away. You can:
Use the Select graphs drop-down on the top-right of the first graph to show graphs for metrics you are interested in, and remove the ones you don't want. Each entry in the drop-down has a question-mark that you can hover over to see a description of the metric it will display.
Adjust the graphs by selecting from the various time spans using the picker in the top-right corner of the overview. This adjusts the time range of values displayed in these graphs, which also alters the point granularity.
When you are ready to drill down further, scroll down below the graphs and there is a table with metrics for individual methods in your API. You can:
Use the Select columns drop-down on the top-right of the table to show the metrics you are interested in, and remove the ones you don't want shown. Entries here also have the question-mark that you can hover over to see a description.
Pick a time span for the metric-values in the table using the time span picker at the top-right corner of the overview. This picks a time span for both the graphs and the table.
Once you have spotted an issue in the metrics, you can start investigating what happened by going to the logs of requests and responses for your API.
To see logs for individual methods of your API, click the View logs link in the table.
To see logs for all methods in your API, click the View all logs link in the bottom-right corner.
See the Endpoints Logs reference for details on the structure of the logs in the Logs Viewer.
Learn what else you can do with the logs:
- Get started using the Logs Viewer.
- Export your logs using the Logs Viewer. This allows you to stream logs to BigQuery for further analysis, save the raw logs to Google Cloud Storage, or send them to Cloud Pub/Sub messaging topics.
- Use Advanced Log Queries for advanced filtering, such as getting all requests with a latency greater than 300 milliseconds.