{"id":3357,"date":"2020-05-17T20:40:32","date_gmt":"2020-05-17T18:40:32","guid":{"rendered":"https:\/\/gokhan-gokalp.com\/?p=3357"},"modified":"2020-05-17T21:36:13","modified_gmt":"2020-05-17T19:36:13","slug":"aspnet-core-series-06-monitor-the-health-of-your-applications-by-implementing-health-checks-and-azure-application-insights","status":"publish","type":"post","link":"https:\/\/gokhan-gokalp.com\/tr\/aspnet-core-series-06-monitor-the-health-of-your-applications-by-implementing-health-checks-and-azure-application-insights\/","title":{"rendered":"ASP.NET Core Serisi 06: Health Checks ve Azure Application Insights&#8217;\u0131 Kullanarak Uygulamalar\u0131n\u0131z\u0131n Sa\u011fl\u0131\u011f\u0131n\u0131 Monitor Edin"},"content":{"rendered":"<p>San\u0131r\u0131m &#8220;<em>uygulamalar\u0131m\u0131z\u0131n sa\u011fl\u0131\u011f\u0131<\/em>&#8221; konusu, mimari yakla\u015f\u0131m farketmeksizin hepimiz i\u00e7in her zaman \u00f6nemli ve ortak bir endi\u015fe noktas\u0131 olmu\u015ftur.<\/p>\n<p>Bildi\u011fimiz gibi uygulamalar\u0131m\u0131z\u0131n sa\u011fl\u0131kl\u0131 olup olmad\u0131\u011f\u0131n\u0131 g\u00f6r\u00fcn\u00fcr bir hale getirebilmek veya kolay bir yoldan \u00f6\u011frenebilmek, bir \u00e7ok durum kar\u015f\u0131s\u0131nda uygulaman\u0131n riskini en aza indirgemektedir.<\/p>\n<p><a href=\"\/wp-content\/uploads\/2020\/04\/load-balancer-gg.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-3364 lazyload\" data-src=\"\/wp-content\/uploads\/2020\/04\/load-balancer-gg.jpg\" alt=\"\" width=\"820\" height=\"383\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/04\/load-balancer-gg.jpg 820w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/04\/load-balancer-gg-300x140.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/04\/load-balancer-gg-768x359.jpg 768w\" data-sizes=\"(max-width: 820px) 100vw, 820px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 820px; --smush-placeholder-aspect-ratio: 820\/383;\" \/><\/a><\/p>\n<p>\u00d6zellikle uygulamalar\u0131m\u0131z bir load-balancer arkas\u0131nda multi instance olarak \u00e7al\u0131\u015f\u0131yorsa, trafi\u011fin y\u00f6nlendirilme i\u015flemi veya uygulaman\u0131n yeni bir versiyona update i\u015flemi s\u0131ras\u0131nda, trafi\u011fin hangi instance&#8217;lara g\u00f6nderilip g\u00f6nderilmeyece\u011fi bilgisini load-balancer&#8217;a health check endpoint&#8217;leri ile bildirmemiz gerekmektedir. B\u00f6ylece trafi\u011fin, hen\u00fcz <strong>t\u00fcm ba\u011f\u0131ml\u0131l\u0131klar\u0131<\/strong> ile aya\u011fa kalkmam\u0131\u015f bir instance&#8217;a y\u00f6nlendirilmemesini sa\u011flam\u0131\u015f oluyoruz.<\/p>\n<p>\u00d6rne\u011fin microservice&#8217;lerimizi kubernetes ile orchestrate etmek istiyorsak, kubernetes&#8217;in ilgili container&#8217;\u0131n trafi\u011fi kabul etmeye haz\u0131r olup olmad\u0131\u011f\u0131na karar verebilmesi i\u00e7in uygulaman\u0131n health check endpoint&#8217;ini container&#8217;\u0131n rediness probe&#8217;u i\u00e7erisinde tan\u0131mlamam\u0131z gerekmektedir.<\/p>\n<p>Bu makale kapsam\u0131nda ise, <em>ASP.NET Core 2.2<\/em> den bu yana built-in olarak bizlere sunulan <strong>health checks<\/strong> \u00f6zelli\u011finden bahsedip, <strong>Azure Application Insights<\/strong> ile nas\u0131l entegre bir hale getirebiliriz konusuna de\u011finmeye \u00e7al\u0131\u015faca\u011f\u0131m.<\/p>\n<p><em>ASP.NET Core<\/em><strong> Health Checks<\/strong>,\u00a0&#8220;<em>Sql Server<\/em>&#8220;, &#8220;<em>MySql<\/em>&#8220;, &#8220;<em>Oracle<\/em>&#8220;, &#8220;<em>Mongo<\/em>&#8220;, &#8220;<em>RabbitMQ<\/em>&#8221; veya &#8220;<em>Elasticsearch<\/em>&#8221; gibi uygulaman\u0131n ba\u011f\u0131ml\u0131l\u0131klar\u0131n\u0131 da dikkate alarak, health check&#8217;ler tan\u0131mlayabilmemize olanak sa\u011flayan harika bir \u00f6zelliktir.<\/p>\n<p>Haydi kodlayarak bakal\u0131m.<\/p>\n<h1>ASP.NET Core Health Checks&#8217;in Implementasyonu<\/h1>\n<p>\u00d6ncelikle \u00f6rnek ama\u00e7l\u0131 a\u015fa\u011f\u0131daki gibi bir <em>ASP.NET Core 3.1 Web API<\/em> projesi olu\u015ftural\u0131m.<\/p>\n<pre class=\"lang:default decode:true \">dotnet new webapi -n Todo<\/pre>\n<p>Ard\u0131ndan &#8220;<em>Microsoft.AspNetCore.Diagnostics.HealthChecks<\/em>&#8221; paketini <em>NuGet<\/em> \u00fczerinden projeye dahil edelim.<\/p>\n<pre class=\"lang:default decode:true \">dotnet add package Microsoft.AspNetCore.Diagnostics.HealthChecks<\/pre>\n<p>&#8220;<em>Todo<\/em>&#8221; ismiyle olu\u015fturmu\u015f oldu\u011fumuz bu <em>API<\/em>&#8216;\u0131n, data source olarak <em>MongoDB<\/em> kullanan bir microservice oldu\u011funu varsayal\u0131m.<\/p>\n<p>Bunun i\u00e7in a\u015fa\u011f\u0131daki komut sat\u0131r\u0131n\u0131 kullanarak, <em>Docker<\/em> \u00fczerinde h\u0131zl\u0131ca bir <em>MongoDB<\/em> instance&#8217;\u0131 aya\u011fa kald\u0131ral\u0131m.<\/p>\n<pre class=\"lang:default decode:true \">docker run -d --name my-mongo -p 27017:27017 mongo<\/pre>\n<p>Ard\u0131ndan <em>MongoDB<\/em>&#8216;nin health durumunu g\u00f6zlemleyebilmemiz i\u00e7in, &#8220;<em>AspNetCore.HealthChecks.MongoDb<\/em>&#8221; paketini de <em>NuGet<\/em> \u00fczerinden projeye dahil edelim.<\/p>\n<p>\u015eimdi <em>API<\/em>&#8216;\u0131n &#8220;<em>Startup<\/em>&#8221; class&#8217;\u0131na girelim ve &#8220;<em>ConfigureServices<\/em>&#8221; method&#8217;u i\u00e7ererisinde health checks service&#8217;ini a\u015fa\u011f\u0131daki gibi configure edelim.<\/p>\n<pre class=\"lang:default decode:true\">public void ConfigureServices(IServiceCollection services)\r\n{\r\n    services.AddControllers();\r\n\r\n    string mongoDBConnection = Configuration.GetValue(\"mongoDB:connection\");\r\n\r\n    services.AddHealthChecks()\r\n            .AddMongoDb(mongodbConnectionString: mongoDBConnection,\r\n            name: \"todo-db-check\",\r\n            failureStatus: HealthStatus.Unhealthy,\r\n            tags: new string[] { \"todo-api\", \"mongodb\" });\r\n}<\/pre>\n<p>Yukar\u0131daki kod blo\u011funa bakt\u0131\u011f\u0131m\u0131zda, \u00e7ok basit bir \u015fekilde <em>MongoDB<\/em> i\u00e7in bir health check tan\u0131mlamas\u0131 yapt\u0131\u011f\u0131m\u0131z\u0131 g\u00f6rebiliriz.<\/p>\n<p>App settings i\u00e7erisinde ise <em>MongoDB<\/em> i\u00e7in connection bilgilerini a\u015fa\u011f\u0131daki gibi tan\u0131mlayal\u0131m.<\/p>\n<pre class=\"lang:default decode:true\">\"mongoDB:connection\": \"mongodb:\/\/localhost:27017\"<\/pre>\n<p>\u015eimdi ise health check&#8217;i, &#8220;<strong>\/hc<\/strong>&#8221; path&#8217;i ile a\u015fa\u011f\u0131daki gibi request pipeline&#8217;\u0131na ekleyelim.<\/p>\n<pre class=\"lang:default decode:true\">app.UseEndpoints(endpoints =&gt;\r\n{\r\n    endpoints.MapControllers();\r\n    endpoints.MapHealthChecks(\"\/hc\");\r\n});<\/pre>\n<p>Ard\u0131ndan ilk test i\u015flemini ger\u00e7ekle\u015ftirebilmek i\u00e7in, <em>API<\/em>&#8216;\u0131 \u00e7al\u0131\u015ft\u0131ral\u0131m ve &#8220;<strong>\/hc<\/strong>&#8221; endpoint&#8217;ine browser \u00fczerinden eri\u015felim.<\/p>\n<p><a href=\"\/wp-content\/uploads\/2020\/05\/hc_1.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-3369 lazyload\" data-src=\"\/wp-content\/uploads\/2020\/05\/hc_1.jpg\" alt=\"\" width=\"942\" height=\"377\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/05\/hc_1.jpg 942w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/05\/hc_1-300x120.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/05\/hc_1-768x307.jpg 768w\" data-sizes=\"(max-width: 942px) 100vw, 942px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 942px; --smush-placeholder-aspect-ratio: 942\/377;\" \/><\/a><\/p>\n<p>G\u00f6rd\u00fc\u011f\u00fcm\u00fcz gibi <em>API<\/em>, database&#8217;i ile birlikte sa\u011fl\u0131kl\u0131 bir durumda.<\/p>\n<p>Health check output&#8217;u default olarak &#8220;<em>text\/plain<\/em>&#8221; dir. Bu nedenle sadece &#8220;<em>Healthy<\/em>&#8221;\u00a0 veya &#8220;<em>Unhealthy<\/em>&#8221; gibi bir response g\u00f6r\u00fcr\u00fcz. T\u00fcm ba\u011f\u0131ml\u0131l\u0131klar dahil edilmi\u015f detayl\u0131 bir health check output&#8217;u g\u00f6rebilmek i\u00e7in ise, health check&#8217;i request pipeline&#8217;\u0131na eklerken &#8220;<em>HealthCheckOptions<\/em>&#8221; \u00fczerinden &#8220;<em>ResponseWriter<\/em>&#8221; \u00f6zelli\u011fi ile \u00f6zelle\u015ftirmemiz gerekmektedir.<\/p>\n<p>Custom bir kod yazmamak i\u00e7in ise, &#8220;<em>AspNetCore.HealthChecks.UI.Client<\/em>&#8221; paketi ile gelen &#8220;<em>UIResponseWriter.WriteHealthCheckUIResponse<\/em>&#8221; writer&#8217;\u0131n\u0131 kullanabiliriz.<\/p>\n<p>Bunun i\u00e7in \u00f6ncelikle projeye &#8220;<em>AspNetCore.HealthChecks.UI<\/em>&#8221; paketini <em>NuGet<\/em> \u00fczerinden dahil edelim. Ard\u0131ndan health check&#8217;i request pipeline&#8217;\u0131na eklerken, a\u015fa\u011f\u0131daki gibi configure edelim.<\/p>\n<pre class=\"lang:default decode:true\">app.UseEndpoints(endpoints =&gt;\r\n{\r\n    endpoints.MapControllers();\r\n    endpoints.MapHealthChecks(\"\/hc\", new HealthCheckOptions()\r\n    {\r\n        Predicate = _ =&gt; true,\r\n        ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse\r\n    });\r\n});<\/pre>\n<p>Ard\u0131ndan tekrar <em>API<\/em>&#8216;\u0131 \u00e7al\u0131\u015ft\u0131ral\u0131m ve &#8220;<strong>\/hc<\/strong>&#8221; endpoint&#8217;ine browser \u00fczerinden eri\u015felim.<\/p>\n<p><a href=\"\/wp-content\/uploads\/2020\/05\/hc_2.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-3370 lazyload\" data-src=\"\/wp-content\/uploads\/2020\/05\/hc_2.jpg\" alt=\"\" width=\"947\" height=\"377\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/05\/hc_2.jpg 947w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/05\/hc_2-300x119.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/05\/hc_2-768x306.jpg 768w\" data-sizes=\"(max-width: 947px) 100vw, 947px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 947px; --smush-placeholder-aspect-ratio: 947\/377;\" \/><\/a><\/p>\n<p>G\u00f6rd\u00fc\u011f\u00fcm\u00fcz gibi \u015fimdi daha detayl\u0131 bir health check output&#8217;una sahibiz.<\/p>\n<h2>Kendi Health Check&#8217;imizi Implemente Edelim<\/h2>\n<p><em>MongoDB<\/em>&#8216;nin health durumunu g\u00f6zlemleyebilmek i\u00e7in, bizlere haz\u0131r sunulan &#8220;<em>AspNetCore.HealthChecks.MongoDb<\/em>&#8221; paketini kulland\u0131k.<\/p>\n<blockquote><p><em><strong>NOT<\/strong><\/em>: T\u00fcm haz\u0131r sunulan health checks listesine <em><a href=\"https:\/\/github.com\/Xabaril\/AspNetCore.Diagnostics.HealthChecks#health-checks\" target=\"_blank\" rel=\"noopener noreferrer\">buradan<\/a><\/em> eri\u015febilirsiniz.<\/p><\/blockquote>\n<p>Peki ya custom bir ihtiyac\u0131m\u0131z varsa? Bu gibi durumlar kar\u015f\u0131s\u0131nda ise, &#8220;<em>IHealthCheck<\/em>&#8221; interface&#8217;ini implemente ederek kendi health check&#8217;lerimizi olu\u015fturabilmek m\u00fcmk\u00fcnd\u00fcr.<\/p>\n<p>\u00d6rne\u011fin &#8220;<em>TodoHealthCheck<\/em>&#8221; isminde bir class olu\u015ftural\u0131m ve a\u015fa\u011f\u0131daki gibi implemente edelim.<\/p>\n<pre class=\"lang:default decode:true \">using System.Threading;\r\nusing System.Threading.Tasks;\r\nusing Microsoft.Extensions.Diagnostics.HealthChecks;\r\n\r\nnamespace dotnetcore_healthchecks_sample\r\n{\r\n    public class TodoHealthCheck : IHealthCheck\r\n    {\r\n        public Task CheckHealthAsync(HealthCheckContext context, CancellationToken cancellationToken = default)\r\n        {\r\n            \/\/ ...\r\n\r\n            return Task.FromResult(HealthCheckResult.Healthy());\r\n        }\r\n    }\r\n}<\/pre>\n<p>Ard\u0131ndan health checks service&#8217;ine a\u015fa\u011f\u0131daki gibi dahil edelim.<\/p>\n<pre class=\"lang:default decode:true\">services.AddHealthChecks()\r\n        .AddMongoDb(mongodbConnectionString: mongoDBConnection,\r\n        name: \"todo-db-check\",\r\n        failureStatus: HealthStatus.Unhealthy,\r\n        tags: new string[] { \"todo-api\", \"mongodb\" })\r\n        .AddCheck(\"todo-custom-check\");<\/pre>\n<p>Hepsi bu kadar. \u015eimdi tekrar &#8220;<strong>\/hc<\/strong>&#8221; endpoint&#8217;ine browser \u00fczereinden eri\u015felim.<\/p>\n<p><a href=\"\/wp-content\/uploads\/2020\/05\/hc_3.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-3372 lazyload\" data-src=\"\/wp-content\/uploads\/2020\/05\/hc_3.jpg\" alt=\"\" width=\"945\" height=\"379\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/05\/hc_3.jpg 945w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/05\/hc_3-300x120.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/05\/hc_3-768x308.jpg 768w\" data-sizes=\"(max-width: 945px) 100vw, 945px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 945px; --smush-placeholder-aspect-ratio: 945\/379;\" \/><\/a><\/p>\n<p>G\u00f6rd\u00fc\u011f\u00fcm\u00fcz gibi olu\u015fturmu\u015f oldu\u011fumuz custom health check, health check output&#8217;u i\u00e7erisine &#8220;<em>todo-custom-check<\/em>&#8221; ismi ile dahil edildi.<\/p>\n<h2>G\u00f6rselle\u015ftirelim<\/h2>\n<p>Health check output&#8217;unu g\u00f6rselle\u015ftirebilmemiz i\u00e7in, \u00e7ok da ho\u015f bir <em>UI<\/em> mevcut. Bunun i\u00e7in projeye &#8220;<em>AspNetCore.HealthChecks.UI<\/em>&#8221; paketini <em>NuGet<\/em> \u00fczerinden dahil etmemiz gerekiyor.<\/p>\n<p>Bir \u00f6nceki ad\u0131mda, detayl\u0131 bir health check output&#8217;u elde edebilmek i\u00e7in zaten bu paketi projeye dahil etmi\u015ftik. \u015eimdi ise etkinle\u015ftirebilmek i\u00e7in configure etmemiz gerekmektedir.<\/p>\n<p>\u00d6ncelikle a\u015fa\u011f\u0131daki gibi <em>UI<\/em>&#8216;\u0131, service collection&#8217;\u0131na dahil edelim.<\/p>\n<pre class=\"lang:default decode:true\">services.AddHealthChecksUI(setupSettings: setup =&gt;\r\n{\r\n    setup.AddHealthCheckEndpoint(\"Todo API\", \"https:\/\/localhost:5555\/hc\");\r\n});<\/pre>\n<p>Ard\u0131ndan request pipeline&#8217;\u0131na, &#8220;<em>MapHealthChecksUI<\/em>&#8221; method&#8217;u ile a\u015fa\u011f\u0131daki gibi ekleyelim.<\/p>\n<pre class=\"lang:default decode:true\">app.UseEndpoints(endpoints =&gt;\r\n{\r\n    endpoints.MapControllers();\r\n    endpoints.MapHealthChecks(\"\/hc\", new HealthCheckOptions()\r\n    {\r\n        Predicate = _ =&gt; true,\r\n        ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse\r\n    });\r\n    endpoints.MapHealthChecksUI();\r\n});<\/pre>\n<p>Health Checks <em>UI<\/em> endpoint&#8217;i default olarak, &#8220;<strong>\/healthchecks-ui<\/strong>&#8221; olarak gelmektedir. Dilerseniz bu de\u011feri &#8220;<em>MapHealthChecksUI<\/em>&#8221; method&#8217;u \u00fczerinden \u00f6zelle\u015ftirerek de\u011fi\u015ftirebilirsiniz.<\/p>\n<p>\u015eimdi test edebilmek i\u00e7in, &#8220;<strong>\/healthchecks-ui<\/strong>&#8221; endpoint&#8217;ine browser \u00fczerinden eri\u015felim.<\/p>\n<p><a href=\"\/wp-content\/uploads\/2020\/05\/hc_4.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-3375 lazyload\" data-src=\"\/wp-content\/uploads\/2020\/05\/hc_4.jpg\" alt=\"\" width=\"946\" height=\"427\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/05\/hc_4.jpg 946w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/05\/hc_4-300x135.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/05\/hc_4-768x347.jpg 768w\" data-sizes=\"(max-width: 946px) 100vw, 946px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 946px; --smush-placeholder-aspect-ratio: 946\/427;\" \/><\/a><\/p>\n<p><em>UI<\/em> \u00fczerinden kolay bir \u015fekilde uygulaman\u0131n ve ba\u011f\u0131ml\u0131l\u0131klar\u0131n\u0131n health durumlar\u0131n\u0131 tarihsel olarak g\u00f6rebilmek m\u00fcmk\u00fcn. Ayr\u0131ca <em>UI<\/em> i\u00e7in bir storage provider&#8217;\u0131 da se\u00e7erek, ilgili health check output&#8217;lar\u0131n\u0131 persist edebilmekte m\u00fcmk\u00fcnd\u00fcr. Provider listesine ise, <em><a href=\"https:\/\/github.com\/Xabaril\/AspNetCore.Diagnostics.HealthChecks#ui-storage-providers\" target=\"_blank\" rel=\"noopener noreferrer\">buradan<\/a><\/em> eri\u015febilirsiniz.<\/p>\n<h2>Azure Application Insight&#8217;\u0131n Kullan\u0131m\u0131<\/h2>\n<p>E\u011fer sizde uygulamalar\u0131n\u0131z\u0131 <em>Azure<\/em> \u00fczerinde host ediyorsan\u0131z, health check output&#8217;lar\u0131n\u0131 <em>Azure Application Insight<\/em>&#8216;a g\u00f6ndermek iyi bir se\u00e7enek olacakt\u0131r.<\/p>\n<p>B\u00f6ylece uygulamalar\u0131m\u0131z\u0131n availability durumlar\u0131na \u00f6zel chart&#8217;lar haz\u0131rlayabilir, herhangi bir hata an\u0131nda ise alert&#8217;ler \u00fcretebiliriz.<\/p>\n<p>Bunun i\u00e7in \u00f6ncelikle projeye &#8220;<em>AspNetcore.HealthChecks.Publisher.ApplicationInsights<\/em>&#8221; paketini <em>NuGet<\/em> \u00fczerinden dahil edelim.<\/p>\n<blockquote><p><em><strong>NOT<\/strong><\/em>: E\u011fer <em>Azure Application Insight<\/em>&#8216;a sahip de\u011filseniz, <em><a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/azure-monitor\/app\/create-new-resource?WT.mc_id=DT-MVP-5003382\" target=\"_blank\" rel=\"noopener noreferrer\">buradan<\/a><\/em> olu\u015fturabilirsiniz.<\/p><\/blockquote>\n<p>Ard\u0131ndan health checks service&#8217;ine, <em>Application Insights<\/em> publisher&#8217;\u0131 a\u015fa\u011f\u0131daki gibi dahil edelim.<\/p>\n<pre class=\"lang:default decode:true\">string instrumentationKey = Configuration.GetValue(\"azure:instrumentationKey\");\r\n\r\nservices.AddHealthChecks()\r\n        .AddMongoDb(mongodbConnectionString: mongoDBConnection,\r\n        name: \"todo-db-check\",\r\n        failureStatus: HealthStatus.Unhealthy,\r\n        tags: new string[] { \"todo-api\", \"mongodb\" })\r\n        .AddCheck(\"todo-custom-check\")\r\n        .AddApplicationInsightsPublisher(instrumentationKey: instrumentationKey);<\/pre>\n<p>Publisher&#8217;\u0131 ekledikten sonra ise, <em>Application Insights<\/em>&#8216;\u0131n <em>Azure Portal<\/em> \u00fczerinden bulabilece\u011fimiz &#8220;<em>instrumentationKey<\/em>&#8221; bilgisini, <em>API<\/em>&#8216;\u0131n app settings\u00a0dosyas\u0131na ekleyelim.<\/p>\n<p>Hepsi bu kadar.<\/p>\n<p>\u015eimdi <em>API<\/em>&#8216;\u0131 \u00e7al\u0131\u015ft\u0131ral\u0131m ve ard\u0131ndan <em>Docker<\/em> \u00fczerinde aya\u011fa kald\u0131rm\u0131\u015f oldu\u011fumuz <em>MongoDB<\/em> instance&#8217;\u0131n\u0131, a\u015fa\u011f\u0131daki gibi durdural\u0131m.<\/p>\n<p><a href=\"\/wp-content\/uploads\/2020\/05\/hc_5.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-3379 lazyload\" data-src=\"\/wp-content\/uploads\/2020\/05\/hc_5.jpg\" alt=\"\" width=\"1142\" height=\"124\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/05\/hc_5.jpg 1142w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/05\/hc_5-300x33.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/05\/hc_5-1024x111.jpg 1024w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/05\/hc_5-768x83.jpg 768w\" data-sizes=\"(max-width: 1142px) 100vw, 1142px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1142px; --smush-placeholder-aspect-ratio: 1142\/124;\" \/><\/a><\/p>\n<p>Browser \u00fczerinden &#8220;<strong>\/hc<\/strong>&#8221; endpoint&#8217;ine eri\u015fti\u011fimizde, a\u015fa\u011f\u0131daki gibi bir output g\u00f6r\u00fcyor olmal\u0131y\u0131z.<\/p>\n<p><a href=\"\/wp-content\/uploads\/2020\/05\/hc_7.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-3380 lazyload\" data-src=\"\/wp-content\/uploads\/2020\/05\/hc_7.jpg\" alt=\"\" width=\"947\" height=\"905\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/05\/hc_7.jpg 947w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/05\/hc_7-300x287.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/05\/hc_7-768x734.jpg 768w\" data-sizes=\"(max-width: 947px) 100vw, 947px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 947px; --smush-placeholder-aspect-ratio: 947\/905;\" \/><\/a><\/p>\n<p>G\u00f6rd\u00fc\u011f\u00fcm\u00fcz gibi &#8220;<em>todo-db-check<\/em>&#8221; in durumu &#8220;<em>Unhealthy<\/em>&#8221; oldu\u011fu i\u00e7in, <em>API<\/em>&#8216;\u0131n da genel durumu &#8220;<em>Unhealthy<\/em>&#8220;.<\/p>\n<p>\u015eimdi <em>Azure Portal<\/em> \u00fczerinden, ilgili <em>Application Insights<\/em> instance&#8217;\u0131na eri\u015felim. Ard\u0131ndan &#8220;<em>Monitoring<\/em>&#8221; tab&#8217;\u0131 alt\u0131nda bulunan, &#8220;<em>Metrics<\/em>&#8221; sekmesine t\u0131klayal\u0131m.<\/p>\n<p>Daha sonra filtre k\u0131sm\u0131ndaki &#8220;<em>Metric Namespace<\/em>&#8221; b\u00f6l\u00fcm\u00fcn\u00fc &#8220;<em>azure.applicationinsights<\/em>&#8221; olarak ve ard\u0131ndan &#8220;<em>Metric<\/em>&#8221; b\u00f6l\u00fcm\u00fcn\u00fc &#8220;<em>AspNetCoreHealthCheckStatus<\/em>&#8221; olarak se\u00e7elim. B\u00f6ylece <em>API<\/em>&#8216;\u0131n availability durumunu, a\u015fa\u011f\u0131daki gibi g\u00f6rselle\u015ftirebilece\u011fiz.<\/p>\n<p><a href=\"\/wp-content\/uploads\/2020\/05\/ai-health.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-3383 lazyload\" data-src=\"\/wp-content\/uploads\/2020\/05\/ai-health.jpg\" alt=\"\" width=\"1431\" height=\"737\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/05\/ai-health.jpg 1431w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/05\/ai-health-300x155.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/05\/ai-health-1024x527.jpg 1024w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/05\/ai-health-768x396.jpg 768w\" data-sizes=\"(max-width: 1431px) 100vw, 1431px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1431px; --smush-placeholder-aspect-ratio: 1431\/737;\" \/><\/a>G\u00f6rd\u00fc\u011f\u00fcm\u00fcz gibi <em>API<\/em>&#8216;\u0131n availability durumunu, zaman dilimlerine g\u00f6re g\u00f6rselle\u015ftirebilmekteyiz. <em>MongoDB<\/em> instance&#8217;\u0131n\u0131 durdurdu\u011fumuz zaman diliminde ise, <em>API<\/em>&#8216;\u0131n available olmad\u0131\u011f\u0131n\u0131 yukar\u0131daki graph&#8217;dan g\u00f6rebilmekteyiz.<\/p>\n<p>Ayr\u0131ca &#8220;<em>Monitoring &gt; Logs<\/em>&#8221; sekmesi alt\u0131ndan da daha detayl\u0131 health bilgilerine, a\u015fa\u011f\u0131daki gibi &#8220;<em>customEvents<\/em>&#8221; query&#8217;leri olu\u015fturarak eri\u015febilmek m\u00fcmk\u00fcnd\u00fcr.<\/p>\n<p><a href=\"\/wp-content\/uploads\/2020\/05\/ai-health-2.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-3384 lazyload\" data-src=\"\/wp-content\/uploads\/2020\/05\/ai-health-2.jpg\" alt=\"\" width=\"1202\" height=\"817\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/05\/ai-health-2.jpg 1202w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/05\/ai-health-2-300x204.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/05\/ai-health-2-1024x696.jpg 1024w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/05\/ai-health-2-768x522.jpg 768w\" data-sizes=\"(max-width: 1202px) 100vw, 1202px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1202px; --smush-placeholder-aspect-ratio: 1202\/817;\" \/><\/a><\/p>\n<p><strong>Link<\/strong>: <em><a href=\"https:\/\/github.com\/GokGokalp\/dotnetcore-healthchecks-sample\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/github.com\/GokGokalp\/dotnetcore-healthchecks-sample<\/a><\/em><\/p>\n<h2>Referanslar<\/h2>\n<blockquote><p><em>https:\/\/docs.microsoft.com\/en-us\/aspnet\/core\/host-and-deploy\/health-checks?view=aspnetcore-3.1&amp;WT.mc_id=DT-MVP-5003382<br \/>\nhttps:\/\/github.com\/Xabaril\/AspNetCore.Diagnostics.HealthChecks<br \/>\n<\/em><\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>San\u0131r\u0131m &#8220;uygulamalar\u0131m\u0131z\u0131n sa\u011fl\u0131\u011f\u0131&#8221; konusu, mimari yakla\u015f\u0131m farketmeksizin hepimiz i\u00e7in her zaman \u00f6nemli ve ortak bir endi\u015fe noktas\u0131 olmu\u015ftur. Bildi\u011fimiz gibi uygulamalar\u0131m\u0131z\u0131n sa\u011fl\u0131kl\u0131 olup olmad\u0131\u011f\u0131n\u0131 g\u00f6r\u00fcn\u00fcr bir hale getirebilmek veya kolay bir yoldan \u00f6\u011frenebilmek, bir \u00e7ok durum kar\u015f\u0131s\u0131nda uygulaman\u0131n riskini en aza indirgemektedir. \u00d6zellikle uygulamalar\u0131m\u0131z bir&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/gokhan-gokalp.com\/tr\/aspnet-core-series-06-monitor-the-health-of-your-applications-by-implementing-health-checks-and-azure-application-insights\/\">Devam\u0131n\u0131 okuyun<span class=\"screen-reader-text\">ASP.NET Core Serisi 06: Health Checks ve Azure Application Insights&#8217;\u0131 Kullanarak Uygulamalar\u0131n\u0131z\u0131n Sa\u011fl\u0131\u011f\u0131n\u0131 Monitor Edin<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":3401,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[505,418,433,368,175],"tags":[419,576,548,575,574],"class_list":["post-3357","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-net-core","category-azure","category-logging","category-microservices","category-performans-profiling","tag-asp-net-core","tag-azure-application-insight","tag-dotnet-core","tag-health-check","tag-health-checks","entry"],"translation":{"provider":"WPGlobus","version":"3.0.2","language":"tr","enabled_languages":["en","tr"],"languages":{"en":{"title":true,"content":true,"excerpt":false},"tr":{"title":true,"content":true,"excerpt":false}}},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>ASP.NET Core Serisi 06: Health Checks ve Azure Application Insights&#039;\u0131 Kullanarak Uygulamalar\u0131n\u0131z\u0131n Sa\u011fl\u0131\u011f\u0131n\u0131 Monitor Edin - G\u00f6khan G\u00f6kalp<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/gokhan-gokalp.com\/aspnet-core-series-06-monitor-the-health-of-your-applications-by-implementing-health-checks-and-azure-application-insights\/\" \/>\n<meta property=\"og:locale\" content=\"tr_TR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"ASP.NET Core Serisi 06: Health Checks ve Azure Application Insights&#039;\u0131 Kullanarak Uygulamalar\u0131n\u0131z\u0131n Sa\u011fl\u0131\u011f\u0131n\u0131 Monitor Edin - G\u00f6khan G\u00f6kalp\" \/>\n<meta property=\"og:url\" content=\"https:\/\/gokhan-gokalp.com\/aspnet-core-series-06-monitor-the-health-of-your-applications-by-implementing-health-checks-and-azure-application-insights\/\" \/>\n<meta property=\"og:site_name\" content=\"G\u00f6khan G\u00f6kalp\" \/>\n<meta property=\"article:published_time\" content=\"2020-05-17T18:40:32+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-05-17T19:36:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/05\/dotnetcore-hc-wallpaper.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"675\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"G\u00f6khan G\u00f6kalp\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Yazan:\" \/>\n\t<meta name=\"twitter:data1\" content=\"G\u00f6khan G\u00f6kalp\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tahmini okuma s\u00fcresi\" \/>\n\t<meta name=\"twitter:data2\" content=\"14 dakika\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/aspnet-core-series-06-monitor-the-health-of-your-applications-by-implementing-health-checks-and-azure-application-insights\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/aspnet-core-series-06-monitor-the-health-of-your-applications-by-implementing-health-checks-and-azure-application-insights\\\/\"},\"author\":{\"name\":\"G\u00f6khan G\u00f6kalp\",\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/#\\\/schema\\\/person\\\/7e2a7fa98babd22a5fdae563c4b8cdbe\"},\"headline\":\"ASP.NET Core Serisi 06: Health Checks ve Azure Application Insights&#8217;\u0131 Kullanarak Uygulamalar\u0131n\u0131z\u0131n Sa\u011fl\u0131\u011f\u0131n\u0131 Monitor Edin\",\"datePublished\":\"2020-05-17T18:40:32+00:00\",\"dateModified\":\"2020-05-17T19:36:13+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/aspnet-core-series-06-monitor-the-health-of-your-applications-by-implementing-health-checks-and-azure-application-insights\\\/\"},\"wordCount\":2533,\"commentCount\":6,\"publisher\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/#\\\/schema\\\/person\\\/7e2a7fa98babd22a5fdae563c4b8cdbe\"},\"image\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/aspnet-core-series-06-monitor-the-health-of-your-applications-by-implementing-health-checks-and-azure-application-insights\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/gokhan-gokalp.com\\\/wp-content\\\/uploads\\\/2020\\\/05\\\/dotnetcore-hc-wallpaper.jpg\",\"keywords\":[\"asp.net core\",\"azure application insight\",\"dotnet core\",\"health check\",\"health checks\"],\"articleSection\":[\".NET Core\",\"Azure\",\"Logging\",\"Microservices\",\"Performans (Profiling)\"],\"inLanguage\":\"tr\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/gokhan-gokalp.com\\\/aspnet-core-series-06-monitor-the-health-of-your-applications-by-implementing-health-checks-and-azure-application-insights\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/aspnet-core-series-06-monitor-the-health-of-your-applications-by-implementing-health-checks-and-azure-application-insights\\\/\",\"url\":\"https:\\\/\\\/gokhan-gokalp.com\\\/aspnet-core-series-06-monitor-the-health-of-your-applications-by-implementing-health-checks-and-azure-application-insights\\\/\",\"name\":\"ASP.NET Core Serisi 06: Health Checks ve Azure Application Insights'\u0131 Kullanarak Uygulamalar\u0131n\u0131z\u0131n Sa\u011fl\u0131\u011f\u0131n\u0131 Monitor Edin - G\u00f6khan G\u00f6kalp\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/aspnet-core-series-06-monitor-the-health-of-your-applications-by-implementing-health-checks-and-azure-application-insights\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/aspnet-core-series-06-monitor-the-health-of-your-applications-by-implementing-health-checks-and-azure-application-insights\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/gokhan-gokalp.com\\\/wp-content\\\/uploads\\\/2020\\\/05\\\/dotnetcore-hc-wallpaper.jpg\",\"datePublished\":\"2020-05-17T18:40:32+00:00\",\"dateModified\":\"2020-05-17T19:36:13+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/aspnet-core-series-06-monitor-the-health-of-your-applications-by-implementing-health-checks-and-azure-application-insights\\\/#breadcrumb\"},\"inLanguage\":\"tr\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/gokhan-gokalp.com\\\/aspnet-core-series-06-monitor-the-health-of-your-applications-by-implementing-health-checks-and-azure-application-insights\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"tr\",\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/aspnet-core-series-06-monitor-the-health-of-your-applications-by-implementing-health-checks-and-azure-application-insights\\\/#primaryimage\",\"url\":\"https:\\\/\\\/gokhan-gokalp.com\\\/wp-content\\\/uploads\\\/2020\\\/05\\\/dotnetcore-hc-wallpaper.jpg\",\"contentUrl\":\"https:\\\/\\\/gokhan-gokalp.com\\\/wp-content\\\/uploads\\\/2020\\\/05\\\/dotnetcore-hc-wallpaper.jpg\",\"width\":1200,\"height\":675},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/aspnet-core-series-06-monitor-the-health-of-your-applications-by-implementing-health-checks-and-azure-application-insights\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/gokhan-gokalp.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"ASP.NET Core Series 06: Monitor the Health of Your Applications by Implementing Health Checks and Azure Application Insights\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/#website\",\"url\":\"https:\\\/\\\/gokhan-gokalp.com\\\/\",\"name\":\"G\u00f6khan G\u00f6kalp\",\"description\":\"C# &amp; Python lover\",\"publisher\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/#\\\/schema\\\/person\\\/7e2a7fa98babd22a5fdae563c4b8cdbe\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/gokhan-gokalp.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"tr\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/#\\\/schema\\\/person\\\/7e2a7fa98babd22a5fdae563c4b8cdbe\",\"name\":\"G\u00f6khan G\u00f6kalp\",\"pronouns\":\"he\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"tr\",\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/wp-content\\\/litespeed\\\/avatar\\\/e645f66b6264ced10d7b6d8b1f85509b.jpg?ver=1775565846\",\"url\":\"https:\\\/\\\/gokhan-gokalp.com\\\/wp-content\\\/litespeed\\\/avatar\\\/e645f66b6264ced10d7b6d8b1f85509b.jpg?ver=1775565846\",\"contentUrl\":\"https:\\\/\\\/gokhan-gokalp.com\\\/wp-content\\\/litespeed\\\/avatar\\\/e645f66b6264ced10d7b6d8b1f85509b.jpg?ver=1775565846\",\"caption\":\"G\u00f6khan G\u00f6kalp\"},\"logo\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/wp-content\\\/litespeed\\\/avatar\\\/e645f66b6264ced10d7b6d8b1f85509b.jpg?ver=1775565846\"},\"sameAs\":[\"https:\\\/\\\/gokhan-gokalp.com\"],\"url\":\"https:\\\/\\\/gokhan-gokalp.com\\\/tr\\\/author\\\/gok-gokalp\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"ASP.NET Core Serisi 06: Health Checks ve Azure Application Insights'\u0131 Kullanarak Uygulamalar\u0131n\u0131z\u0131n Sa\u011fl\u0131\u011f\u0131n\u0131 Monitor Edin - G\u00f6khan G\u00f6kalp","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/gokhan-gokalp.com\/aspnet-core-series-06-monitor-the-health-of-your-applications-by-implementing-health-checks-and-azure-application-insights\/","og_locale":"tr_TR","og_type":"article","og_title":"ASP.NET Core Serisi 06: Health Checks ve Azure Application Insights'\u0131 Kullanarak Uygulamalar\u0131n\u0131z\u0131n Sa\u011fl\u0131\u011f\u0131n\u0131 Monitor Edin - G\u00f6khan G\u00f6kalp","og_url":"https:\/\/gokhan-gokalp.com\/aspnet-core-series-06-monitor-the-health-of-your-applications-by-implementing-health-checks-and-azure-application-insights\/","og_site_name":"G\u00f6khan G\u00f6kalp","article_published_time":"2020-05-17T18:40:32+00:00","article_modified_time":"2020-05-17T19:36:13+00:00","og_image":[{"width":1200,"height":675,"url":"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/05\/dotnetcore-hc-wallpaper.jpg","type":"image\/jpeg"}],"author":"G\u00f6khan G\u00f6kalp","twitter_card":"summary_large_image","twitter_misc":{"Yazan:":"G\u00f6khan G\u00f6kalp","Tahmini okuma s\u00fcresi":"14 dakika"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/gokhan-gokalp.com\/aspnet-core-series-06-monitor-the-health-of-your-applications-by-implementing-health-checks-and-azure-application-insights\/#article","isPartOf":{"@id":"https:\/\/gokhan-gokalp.com\/aspnet-core-series-06-monitor-the-health-of-your-applications-by-implementing-health-checks-and-azure-application-insights\/"},"author":{"name":"G\u00f6khan G\u00f6kalp","@id":"https:\/\/gokhan-gokalp.com\/#\/schema\/person\/7e2a7fa98babd22a5fdae563c4b8cdbe"},"headline":"ASP.NET Core Serisi 06: Health Checks ve Azure Application Insights&#8217;\u0131 Kullanarak Uygulamalar\u0131n\u0131z\u0131n Sa\u011fl\u0131\u011f\u0131n\u0131 Monitor Edin","datePublished":"2020-05-17T18:40:32+00:00","dateModified":"2020-05-17T19:36:13+00:00","mainEntityOfPage":{"@id":"https:\/\/gokhan-gokalp.com\/aspnet-core-series-06-monitor-the-health-of-your-applications-by-implementing-health-checks-and-azure-application-insights\/"},"wordCount":2533,"commentCount":6,"publisher":{"@id":"https:\/\/gokhan-gokalp.com\/#\/schema\/person\/7e2a7fa98babd22a5fdae563c4b8cdbe"},"image":{"@id":"https:\/\/gokhan-gokalp.com\/aspnet-core-series-06-monitor-the-health-of-your-applications-by-implementing-health-checks-and-azure-application-insights\/#primaryimage"},"thumbnailUrl":"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/05\/dotnetcore-hc-wallpaper.jpg","keywords":["asp.net core","azure application insight","dotnet core","health check","health checks"],"articleSection":[".NET Core","Azure","Logging","Microservices","Performans (Profiling)"],"inLanguage":"tr","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/gokhan-gokalp.com\/aspnet-core-series-06-monitor-the-health-of-your-applications-by-implementing-health-checks-and-azure-application-insights\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/gokhan-gokalp.com\/aspnet-core-series-06-monitor-the-health-of-your-applications-by-implementing-health-checks-and-azure-application-insights\/","url":"https:\/\/gokhan-gokalp.com\/aspnet-core-series-06-monitor-the-health-of-your-applications-by-implementing-health-checks-and-azure-application-insights\/","name":"ASP.NET Core Serisi 06: Health Checks ve Azure Application Insights'\u0131 Kullanarak Uygulamalar\u0131n\u0131z\u0131n Sa\u011fl\u0131\u011f\u0131n\u0131 Monitor Edin - G\u00f6khan G\u00f6kalp","isPartOf":{"@id":"https:\/\/gokhan-gokalp.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/gokhan-gokalp.com\/aspnet-core-series-06-monitor-the-health-of-your-applications-by-implementing-health-checks-and-azure-application-insights\/#primaryimage"},"image":{"@id":"https:\/\/gokhan-gokalp.com\/aspnet-core-series-06-monitor-the-health-of-your-applications-by-implementing-health-checks-and-azure-application-insights\/#primaryimage"},"thumbnailUrl":"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/05\/dotnetcore-hc-wallpaper.jpg","datePublished":"2020-05-17T18:40:32+00:00","dateModified":"2020-05-17T19:36:13+00:00","breadcrumb":{"@id":"https:\/\/gokhan-gokalp.com\/aspnet-core-series-06-monitor-the-health-of-your-applications-by-implementing-health-checks-and-azure-application-insights\/#breadcrumb"},"inLanguage":"tr","potentialAction":[{"@type":"ReadAction","target":["https:\/\/gokhan-gokalp.com\/aspnet-core-series-06-monitor-the-health-of-your-applications-by-implementing-health-checks-and-azure-application-insights\/"]}]},{"@type":"ImageObject","inLanguage":"tr","@id":"https:\/\/gokhan-gokalp.com\/aspnet-core-series-06-monitor-the-health-of-your-applications-by-implementing-health-checks-and-azure-application-insights\/#primaryimage","url":"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/05\/dotnetcore-hc-wallpaper.jpg","contentUrl":"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2020\/05\/dotnetcore-hc-wallpaper.jpg","width":1200,"height":675},{"@type":"BreadcrumbList","@id":"https:\/\/gokhan-gokalp.com\/aspnet-core-series-06-monitor-the-health-of-your-applications-by-implementing-health-checks-and-azure-application-insights\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/gokhan-gokalp.com\/"},{"@type":"ListItem","position":2,"name":"ASP.NET Core Series 06: Monitor the Health of Your Applications by Implementing Health Checks and Azure Application Insights"}]},{"@type":"WebSite","@id":"https:\/\/gokhan-gokalp.com\/#website","url":"https:\/\/gokhan-gokalp.com\/","name":"G\u00f6khan G\u00f6kalp","description":"C# &amp; Python lover","publisher":{"@id":"https:\/\/gokhan-gokalp.com\/#\/schema\/person\/7e2a7fa98babd22a5fdae563c4b8cdbe"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/gokhan-gokalp.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"tr"},{"@type":["Person","Organization"],"@id":"https:\/\/gokhan-gokalp.com\/#\/schema\/person\/7e2a7fa98babd22a5fdae563c4b8cdbe","name":"G\u00f6khan G\u00f6kalp","pronouns":"he","image":{"@type":"ImageObject","inLanguage":"tr","@id":"https:\/\/gokhan-gokalp.com\/wp-content\/litespeed\/avatar\/e645f66b6264ced10d7b6d8b1f85509b.jpg?ver=1775565846","url":"https:\/\/gokhan-gokalp.com\/wp-content\/litespeed\/avatar\/e645f66b6264ced10d7b6d8b1f85509b.jpg?ver=1775565846","contentUrl":"https:\/\/gokhan-gokalp.com\/wp-content\/litespeed\/avatar\/e645f66b6264ced10d7b6d8b1f85509b.jpg?ver=1775565846","caption":"G\u00f6khan G\u00f6kalp"},"logo":{"@id":"https:\/\/gokhan-gokalp.com\/wp-content\/litespeed\/avatar\/e645f66b6264ced10d7b6d8b1f85509b.jpg?ver=1775565846"},"sameAs":["https:\/\/gokhan-gokalp.com"],"url":"https:\/\/gokhan-gokalp.com\/tr\/author\/gok-gokalp\/"}]}},"_links":{"self":[{"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/posts\/3357","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/comments?post=3357"}],"version-history":[{"count":5,"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/posts\/3357\/revisions"}],"predecessor-version":[{"id":3402,"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/posts\/3357\/revisions\/3402"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/media\/3401"}],"wp:attachment":[{"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/media?parent=3357"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/categories?post=3357"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/tags?post=3357"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}