goc
goc

Reputation: 33

Is it possible to store pod logs in Azure Monitor or Application Insights?

I am looking for a way to store and query logs generated by Kubernetes pods (using the command kubectl logs -n ) directly in Azure Monitor or Application Insights. Does anyone know if it's possible to integrate these services with Kubernetes logs? What options or configurations should I consider to achieve this?

Upvotes: -1

Views: 72

Answers (1)

Jahnavi
Jahnavi

Reputation: 8018

To store and query logs generated by Kubernetes pods directly in Azure Monitor or Application Insights, you need to enable container logs under Azure Monitor section while creating the cluster as shown below. Once it is enabled, all the logs will be integrated and managed by Prometheus and Grafana workspaces as well.

enter image description here

Once the cluster creation is done, you can go to Monitor >> Managed Services to view the pods and the respective logs as shown below.

enter image description here

enter image description here

Also, when it is linked to Azure Monitor while creation of the cluster, there will be a specific workspace attached to it which will also collect the logs as shown below.

I have executed below sample query to view the pods logs and was successful.

KubePodInventory
| project Name

enter image description here

Upvotes: 0

Related Questions