Reputation: 33
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
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.
Once the cluster creation is done, you can go to Monitor >> Managed Services
to view the pods and the respective logs as shown below.
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
Upvotes: 0