Skip to content

Latest commit

 

History

History
77 lines (51 loc) · 2.74 KB

logs.md

File metadata and controls

77 lines (51 loc) · 2.74 KB

Logs

For an overview of this repository and the services in it, go to the top-level README. To view logs from deployed services, follow this guide.

We have the following types of logs:

More background on the infrastructure as a whole can be found at ./infrastructure.md.

Prometheus Logs

Prometheus gathers logs from a Kubernetes cluster. It runs as a kubernetes pod automatically included with Istio, which we use to manage ingress and egress from our Kubernetes cluster.

To view the logs, use one of the following means:

For more on getting started with Prometheus, go to the Prometheus docs, or watch this introductory talk from Prometheus co-founder Julius Volz.

Viewing a cluster Prometheus dashboard locally

You will need to target a specific kubernetes cluster for which you'd like to see logs. See our docs on connection to a Kubernetes cluster.

Once you're targeting a Kubernetes cluster, run the following command to see its logs.

istioctl dashboard prometheus

Viewing Prometheus logs in Azure

Alternatively, to see Prometheus logs, you can run a query in the Azure Log Analytics workspace.

  1. Open the "Log Analytics workspaces" area in the Azure portal.
  2. Open the analytics workspace which is in the same resource group as your cluster.
  3. Click "Logs" in the sidebar.
  4. Run the following the query:
InsightsMetrics
| where Namespace == "prometheus"

Container logs

Using stern

To view all of the logs for the doc-index-updater:

stern -n doc-index-updater doc-index-updater

A useful command for viewing the logs related to a specific correlation id would be to use the -i or --include parameter with a regex which looks for INFO, WARN, and ERROR messages matching that id.

See here, for b9912c04-325e-4f1b-8943-3ef319a88989:

stern doc-index-updater -n doc-index-updater -i 'level.:.(INFO|WARN|ERROR).*b9912c04-325e-4f1b-8943-3ef319a88989'

See the stern docs for more info.