简体   繁体   English

Azure PaaS,用于存储微服务的集中式日志数据

[英]Azure PaaS for Storing Centralized Log Data for Microservices

If we deploy a Microservice in azure AKS, there may be multiple pods and replica of same services. 如果我们在天蓝色的AKS中部署微服务,则可能会有多个Pod和同一服务的副本。 If Microservice want to keep any custom log information about it's flow or errors , where better to store such logs centrally? 如果微服务想要保留有关其流程或错误的任何自定义日志信息,那么最好在哪里集中存储此类日志? Any PaaS services? 有任何PaaS服务吗? eg Azure Storage? 例如Azure存储? Any real experience to share here? 有什么实际经验可以分享吗?

I would suggest Azure Application Insigths . 我建议使用Azure Application Insigths You can enrich your telemetry with aks details using this integration package : 您可以使用此集成包通过aks详细信息丰富遥测:

... when using Microsoft Application Insights for Kubernetes, you will see Kubernetes related properties like Pod-Name, Deployment ... on all your telemetry entries. ...使用Microsoft Application Insights for Kubernetes时,您将在所有遥测条目上看到Kubernetes相关属性,例如Pod-Name,Deployment...。 Proper values will also be set to make use of the rich features like enabling the Application Map to show the multiple micro services on the same map. 还将设置适当的值,以利用丰富的功能,例如使Application Map能够在同一地图上显示多个微服务。

For logging within your application you can use the ILogger interface (if using .net) and pipe it to app insights . 为了在您的应用程序中进行记录,您可以使用ILogger界面(如果使用.net)并将其通过管道传递给应用程序见解

Or you can write your own logging using the sdk , available in selected languages. 或者,您也可以使用sdk编写自己的日志记录,这些语言提供了所选语言。

For java applications, you can pipe your logs as well . 对于Java应用程序,你可以管你的日志,以及 You probably have to manually add pod details to your telemetry using telemetry initializers as the Microsoft Application Insights for Kubernetes package is .Net only. 您可能必须使用遥测初始化程序手动将吊舱详细信息添加到遥测中,因为Kubernetes的Microsoft Application Insights程序包仅.Net。 As far as I know they use the kubernetes rest api to query for details. 据我所知,他们使用kubernetes rest api查询详细信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM