Added Appinsights Linux SF telemetry initializer
This commit is contained in:
parent
ace61123e3
commit
dc98e6a4c6
@ -13,6 +13,7 @@
|
||||
<Parameter Name="BasketApi_InstanceCount" DefaultValue="-1" />
|
||||
<Parameter Name="IdentityUrlExternal" DefaultValue="" />
|
||||
<Parameter Name="PicBaseUrl" DefaultValue="" />
|
||||
<Parameter Name="InstrumentationKey" DefaultValue="" />
|
||||
</Parameters>
|
||||
<!-- Import the ServiceManifest from the ServicePackage. The ServiceManifestName and ServiceManifestVersion
|
||||
should match the Name and Version attributes of the ServiceManifest element defined in the
|
||||
@ -23,6 +24,7 @@
|
||||
<!-- Override external urls depending on environment -->
|
||||
<EnvironmentOverrides CodePackageRef="Code">
|
||||
<EnvironmentVariable Name="IdentityUrlExternal" Value="[IdentityUrlExternal]"/>
|
||||
<EnvironmentVariable Name="ApplicationInsights__InstrumentationKey" Value="[InstrumentationKey]"/>
|
||||
</EnvironmentOverrides>
|
||||
<Policies>
|
||||
<ContainerHostPolicies CodePackageRef="Code">
|
||||
@ -34,6 +36,7 @@
|
||||
<ServiceManifestRef ServiceManifestName="LocationsApiPkg" ServiceManifestVersion="1.0.0" />
|
||||
<EnvironmentOverrides CodePackageRef="Code">
|
||||
<EnvironmentVariable Name="IdentityUrlExternal" Value="[IdentityUrlExternal]"/>
|
||||
<EnvironmentVariable Name="ApplicationInsights__InstrumentationKey" Value="[InstrumentationKey]"/>
|
||||
</EnvironmentOverrides>
|
||||
<Policies>
|
||||
<ContainerHostPolicies CodePackageRef="Code">
|
||||
@ -43,7 +46,9 @@
|
||||
</ServiceManifestImport>
|
||||
<ServiceManifestImport>
|
||||
<ServiceManifestRef ServiceManifestName="PaymentApiPkg" ServiceManifestVersion="1.0.0" />
|
||||
<ConfigOverrides />
|
||||
<EnvironmentOverrides CodePackageRef="Code">
|
||||
<EnvironmentVariable Name="ApplicationInsights__InstrumentationKey" Value="[InstrumentationKey]"/>
|
||||
</EnvironmentOverrides>
|
||||
<Policies>
|
||||
<ContainerHostPolicies CodePackageRef="Code">
|
||||
<PortBinding ContainerPort="80" EndpointRef="PaymentApiTypeEndpoint"/>
|
||||
@ -54,6 +59,7 @@
|
||||
<ServiceManifestRef ServiceManifestName="OrderingApiPkg" ServiceManifestVersion="1.0.0" />
|
||||
<EnvironmentOverrides CodePackageRef="Code">
|
||||
<EnvironmentVariable Name="IdentityUrlExternal" Value="[IdentityUrlExternal]"/>
|
||||
<EnvironmentVariable Name="ApplicationInsights__InstrumentationKey" Value="[InstrumentationKey]"/>
|
||||
</EnvironmentOverrides>
|
||||
<Policies>
|
||||
<ContainerHostPolicies CodePackageRef="Code">
|
||||
@ -65,6 +71,7 @@
|
||||
<ServiceManifestRef ServiceManifestName="CatalogApiPkg" ServiceManifestVersion="1.0.0" />
|
||||
<EnvironmentOverrides CodePackageRef="Code">
|
||||
<EnvironmentVariable Name="PicBaseUrl" Value="[PicBaseUrl]"/>
|
||||
<EnvironmentVariable Name="ApplicationInsights__InstrumentationKey" Value="[InstrumentationKey]"/>
|
||||
</EnvironmentOverrides>
|
||||
<Policies>
|
||||
<ContainerHostPolicies CodePackageRef="Code">
|
||||
@ -76,6 +83,7 @@
|
||||
<ServiceManifestRef ServiceManifestName="BasketApiPkg" ServiceManifestVersion="1.0.0" />
|
||||
<EnvironmentOverrides CodePackageRef="Code">
|
||||
<EnvironmentVariable Name="IdentityUrlExternal" Value="[IdentityUrlExternal]"/>
|
||||
<EnvironmentVariable Name="ApplicationInsights__InstrumentationKey" Value="[InstrumentationKey]"/>
|
||||
</EnvironmentOverrides>
|
||||
<Policies>
|
||||
<ContainerHostPolicies CodePackageRef="Code">
|
||||
|
@ -27,6 +27,8 @@
|
||||
<EnvironmentVariable Name="IdentityUrlExternal" Value="http://#{your_sf_dns}#:5105"/>
|
||||
<EnvironmentVariable Name="EventBusConnection" Value="rabbitmq.eshoponservicefabricbus"/>
|
||||
<EnvironmentVariable Name="AzureServiceBusEnabled" Value="False"/>
|
||||
<EnvironmentVariable Name="ApplicationInsights__InstrumentationKey" Value=""/>
|
||||
<EnvironmentVariable Name="OrchestratorType" Value="SF"/>
|
||||
</EnvironmentVariables>
|
||||
</CodePackage>
|
||||
|
||||
@ -43,3 +45,4 @@
|
||||
</Endpoints>
|
||||
</Resources>
|
||||
</ServiceManifest>
|
||||
|
||||
|
@ -30,6 +30,8 @@
|
||||
<EnvironmentVariable Name="AzureStorageEnabled" Value="False"/>
|
||||
<EnvironmentVariable Name="EventBusConnection" Value="rabbitmq.eshoponservicefabricbus"/>
|
||||
<EnvironmentVariable Name="AzureServiceBusEnabled" Value="False"/>
|
||||
<EnvironmentVariable Name="ApplicationInsights__InstrumentationKey" Value=""/>
|
||||
<EnvironmentVariable Name="OrchestratorType" Value="SF"/>
|
||||
</EnvironmentVariables>
|
||||
</CodePackage>
|
||||
|
||||
|
@ -27,7 +27,9 @@
|
||||
<EnvironmentVariable Name="identityUrl" Value="http://identityapi.eshoponservicefabric:5105"/>
|
||||
<EnvironmentVariable Name="IdentityUrlExternal" Value=""/>
|
||||
<EnvironmentVariable Name="EventBusConnection" Value="rabbitmq.eshoponservicefabricbus"/>
|
||||
<EnvironmentVariable Name="AzureServiceBusEnabled" Value="False"/>
|
||||
<EnvironmentVariable Name="AzureServiceBusEnabled" Value="False"/>
|
||||
<EnvironmentVariable Name="ApplicationInsights__InstrumentationKey" Value=""/>
|
||||
<EnvironmentVariable Name="OrchestratorType" Value="SF"/>
|
||||
</EnvironmentVariables>
|
||||
</CodePackage>
|
||||
|
||||
|
@ -34,6 +34,8 @@
|
||||
<EnvironmentVariable Name="MongoConnectionString" Value="mongodb://mongodb.eshoponservicefabricnosql"/>
|
||||
<EnvironmentVariable Name="MongoDatabase" Value="MarketingDb"/>
|
||||
<EnvironmentVariable Name="identityUrl" Value="http://identityapi.eshoponservicefabric:5105"/>
|
||||
<EnvironmentVariable Name="ApplicationInsights__InstrumentationKey" Value=""/>
|
||||
<EnvironmentVariable Name="OrchestratorType" Value="SF"/>
|
||||
</EnvironmentVariables>
|
||||
</CodePackage>
|
||||
|
||||
|
@ -30,6 +30,8 @@
|
||||
<EnvironmentVariable Name="UseCustomizationData" Value="True"/>
|
||||
<EnvironmentVariable Name="GracePeriodTime" Value="1"/>
|
||||
<EnvironmentVariable Name="CheckUpdateTime" Value="30000"/>
|
||||
<EnvironmentVariable Name="ApplicationInsights__InstrumentationKey" Value=""/>
|
||||
<EnvironmentVariable Name="OrchestratorType" Value="SF"/>
|
||||
</EnvironmentVariables>
|
||||
</CodePackage>
|
||||
|
||||
|
@ -23,7 +23,9 @@
|
||||
<EnvironmentVariable Name="ASPNETCORE_ENVIRONMENT" Value="Development"/>
|
||||
<EnvironmentVariable Name="ASPNETCORE_URLS" Value="http://0.0.0.0:80"/>
|
||||
<EnvironmentVariable Name="EventBusConnection" Value="rabbitmq.eshoponservicefabricbus"/>
|
||||
<EnvironmentVariable Name="AzureServiceBusEnabled" Value="False"/>
|
||||
<EnvironmentVariable Name="AzureServiceBusEnabled" Value="False"/>
|
||||
<EnvironmentVariable Name="ApplicationInsights__InstrumentationKey" Value=""/>
|
||||
<EnvironmentVariable Name="OrchestratorType" Value="SF"/>
|
||||
</EnvironmentVariables>
|
||||
</CodePackage>
|
||||
|
||||
|
@ -9,5 +9,6 @@
|
||||
<Parameter Name="BasketApi_InstanceCount" Value="-1" />
|
||||
<Parameter Name="IdentityUrlExternal" Value="http://#{your_sf_dns}#:5105" />
|
||||
<Parameter Name="PicBaseUrl" Value="http://#{your_sf_dns}#:5101/api/v1/catalog/items/[0]/pic/" />
|
||||
<Parameter Name="InstrumentationKey" Value="" />
|
||||
</Parameters>
|
||||
</Application>
|
||||
|
@ -13,6 +13,7 @@
|
||||
<Parameter Name="MarketingApiClient" DefaultValue="" />
|
||||
<Parameter Name="BasketApiClient" DefaultValue="" />
|
||||
<Parameter Name="OrderingApiClient" DefaultValue="" />
|
||||
<Parameter Name="InstrumentationKey" DefaultValue="" />
|
||||
</Parameters>
|
||||
<!-- Import the ServiceManifest from the ServicePackage. The ServiceManifestName and ServiceManifestVersion
|
||||
should match the Name and Version attributes of the ServiceManifest element defined in the
|
||||
@ -28,6 +29,7 @@
|
||||
<EnvironmentVariable Name="MarketingApiClient" Value="[MarketingApiClient]"/>
|
||||
<EnvironmentVariable Name="BasketApiClient" Value="[BasketApiClient]"/>
|
||||
<EnvironmentVariable Name="OrderingApiClient" Value="[OrderingApiClient]"/>
|
||||
<EnvironmentVariable Name="ApplicationInsights__InstrumentationKey" Value="[InstrumentationKey]"/>
|
||||
</EnvironmentOverrides>
|
||||
<Policies>
|
||||
<ContainerHostPolicies CodePackageRef="Code">
|
||||
|
@ -32,6 +32,8 @@
|
||||
<EnvironmentVariable Name="BasketApiClient" Value=""/>
|
||||
<EnvironmentVariable Name="OrderingApiClient" Value=""/>
|
||||
<EnvironmentVariable Name="UseCustomizationData" Value="True"/>
|
||||
<EnvironmentVariable Name="ApplicationInsights__InstrumentationKey" Value=""/>
|
||||
<EnvironmentVariable Name="OrchestratorType" Value="SF"/>
|
||||
</EnvironmentVariables>
|
||||
|
||||
</CodePackage>
|
||||
|
@ -9,5 +9,6 @@
|
||||
<Parameter Name="MarketingApiClient" Value="http://#{your_sf_dns}#:5110" />
|
||||
<Parameter Name="BasketApiClient" Value="http://#{your_sf_dns}#:5103" />
|
||||
<Parameter Name="OrderingApiClient" Value="http://#{your_sf_dns}#:5102" />
|
||||
<Parameter Name="InstrumentationKey" Value="" />
|
||||
</Parameters>
|
||||
</Application>
|
||||
|
@ -7,6 +7,7 @@
|
||||
<Parameters>
|
||||
<Parameter Name="WebMVC_InstanceCount" DefaultValue="-1" />
|
||||
<Parameter Name="IdentityUrl" DefaultValue="" />
|
||||
<Parameter Name="InstrumentationKey" DefaultValue="" />
|
||||
</Parameters>
|
||||
<!-- Import the ServiceManifest from the ServicePackage. The ServiceManifestName and ServiceManifestVersion
|
||||
should match the Name and Version attributes of the ServiceManifest element defined in the
|
||||
@ -15,7 +16,8 @@
|
||||
<ServiceManifestRef ServiceManifestName="WebMVCPkg" ServiceManifestVersion="1.0.0" />
|
||||
<!-- Override external urls depending on environment -->
|
||||
<EnvironmentOverrides CodePackageRef="Code">
|
||||
<EnvironmentVariable Name="IdentityUrl" Value="[IdentityUrl]"/>
|
||||
<EnvironmentVariable Name="IdentityUrl" Value="[IdentityUrl]"/>
|
||||
<EnvironmentVariable Name="ApplicationInsights__InstrumentationKey" Value="[InstrumentationKey]"/>
|
||||
</EnvironmentOverrides>
|
||||
<Policies>
|
||||
<ContainerHostPolicies CodePackageRef="Code">
|
||||
|
@ -28,6 +28,8 @@
|
||||
<EnvironmentVariable Name="IdentityUrl" Value=""/>
|
||||
<EnvironmentVariable Name="MarketingUrl" Value="http://marketingapi.eshoponservicefabric:5110"/>
|
||||
<EnvironmentVariable Name="LocationsUrl" Value="http://locationsapi.eshoponservicefabric:5109"/>
|
||||
<EnvironmentVariable Name="ApplicationInsights__InstrumentationKey" Value=""/>
|
||||
<EnvironmentVariable Name="OrchestratorType" Value="SF"/>
|
||||
</EnvironmentVariables>
|
||||
</CodePackage>
|
||||
|
||||
|
@ -3,5 +3,6 @@
|
||||
<Parameters>
|
||||
<Parameter Name="WebMVC_InstanceCount" Value="-1" />
|
||||
<Parameter Name="IdentityUrl" Value="http://#{your_sf_dns}#:5105" />
|
||||
<Parameter Name="InstrumentationKey" Value="" />
|
||||
</Parameters>
|
||||
</Application>
|
@ -11,6 +11,7 @@
|
||||
<Parameter Name="BasketUrl" DefaultValue="" />
|
||||
<Parameter Name="MarketingUrl" DefaultValue="" />
|
||||
<Parameter Name="IdentityUrl" DefaultValue="" />
|
||||
<Parameter Name="InstrumentationKey" DefaultValue="" />
|
||||
</Parameters>
|
||||
<!-- Import the ServiceManifest from the ServicePackage. The ServiceManifestName and ServiceManifestVersion
|
||||
should match the Name and Version attributes of the ServiceManifest element defined in the
|
||||
@ -24,6 +25,7 @@
|
||||
<EnvironmentVariable Name="BasketUrl" Value="[BasketUrl]"/>
|
||||
<EnvironmentVariable Name="MarketingUrl" Value="[MarketingUrl]"/>
|
||||
<EnvironmentVariable Name="IdentityUrl" Value="[IdentityUrl]"/>
|
||||
<EnvironmentVariable Name="ApplicationInsights__InstrumentationKey" Value="[InstrumentationKey]"/>
|
||||
</EnvironmentOverrides>
|
||||
<Policies>
|
||||
<ContainerHostPolicies CodePackageRef="Code">
|
||||
|
@ -33,6 +33,8 @@
|
||||
<EnvironmentVariable Name="BasketUrlHC" Value="http://basketapi.eshoponservicefabric:5103/hc"/>
|
||||
<EnvironmentVariable Name="MarketingUrlHC" Value="http://marketingapi.eshoponservicefabric:5110/hc"/>
|
||||
<EnvironmentVariable Name="UseCustomizationData" Value="True"/>
|
||||
<EnvironmentVariable Name="ApplicationInsights__InstrumentationKey" Value=""/>
|
||||
<EnvironmentVariable Name="OrchestratorType" Value="SF"/>
|
||||
</EnvironmentVariables>
|
||||
</CodePackage>
|
||||
|
||||
|
@ -7,5 +7,6 @@
|
||||
<Parameter Name="BasketUrl" Value="http://#{your_sf_dns}#:5103" />
|
||||
<Parameter Name="MarketingUrl" Value="http://#{your_sf_dns}#:5110" />
|
||||
<Parameter Name="IdentityUrl" Value="http://#{your_sf_dns}#:5105" />
|
||||
<Parameter Name="InstrumentationKey" Value="" />
|
||||
</Parameters>
|
||||
</Application>
|
||||
|
@ -6,13 +6,16 @@
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<Parameters>
|
||||
<Parameter Name="WebStatus_InstanceCount" DefaultValue="-1" />
|
||||
<Parameter Name="InstrumentationKey" DefaultValue="" />
|
||||
</Parameters>
|
||||
<!-- Import the ServiceManifest from the ServicePackage. The ServiceManifestName and ServiceManifestVersion
|
||||
should match the Name and Version attributes of the ServiceManifest element defined in the
|
||||
ServiceManifest.xml file. -->
|
||||
<ServiceManifestImport>
|
||||
<ServiceManifestRef ServiceManifestName="WebStatusPkg" ServiceManifestVersion="1.0.0" />
|
||||
<ConfigOverrides />
|
||||
<EnvironmentOverrides CodePackageRef="Code">
|
||||
<EnvironmentVariable Name="ApplicationInsights__InstrumentationKey" Value="[InstrumentationKey]"/>
|
||||
</EnvironmentOverrides>
|
||||
<Policies>
|
||||
<ContainerHostPolicies CodePackageRef="Code">
|
||||
<PortBinding ContainerPort="80" EndpointRef="WebStatusTypeEndpoint"/>
|
||||
|
@ -30,6 +30,8 @@
|
||||
<EnvironmentVariable Name="LocationsUrl" Value="http://locationsapi.eshoponservicefabric:5109"/>
|
||||
<EnvironmentVariable Name="mvc" Value="http://webmvc.eshoponservicefabric:5100"/>
|
||||
<EnvironmentVariable Name="spa" Value="http://webspa.eshoponservicefabric:5104"/>
|
||||
<EnvironmentVariable Name="ApplicationInsights__InstrumentationKey" Value=""/>
|
||||
<EnvironmentVariable Name="OrchestratorType" Value="SF"/>
|
||||
</EnvironmentVariables>
|
||||
</CodePackage>
|
||||
|
||||
|
@ -2,5 +2,6 @@
|
||||
<Application Name="fabric:/eShopOnServiceFabricWebStatus" xmlns="http://schemas.microsoft.com/2011/01/fabric" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<Parameters>
|
||||
<Parameter Name="WebStatus_InstanceCount" Value="-1" />
|
||||
<Parameter Name="InstrumentationKey" Value="" />
|
||||
</Parameters>
|
||||
</Application>
|
@ -19,6 +19,7 @@
|
||||
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.1.1" />
|
||||
<PackageReference Include="Microsoft.ApplicationInsights.DependencyCollector" Version="2.4.1" />
|
||||
<PackageReference Include="Microsoft.ApplicationInsights.Kubernetes" Version="1.0.0-beta1" />
|
||||
<PackageReference Include="Microsoft.ApplicationInsights.ServiceFabric" Version="2.0.0-beta1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />
|
||||
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="4.1.0" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="1.0.0" />
|
||||
|
@ -3,6 +3,8 @@ using Autofac.Extensions.DependencyInjection;
|
||||
using Basket.API.Infrastructure.Filters;
|
||||
using Basket.API.IntegrationEvents.EventHandling;
|
||||
using Basket.API.IntegrationEvents.Events;
|
||||
using Microsoft.ApplicationInsights.Extensibility;
|
||||
using Microsoft.ApplicationInsights.ServiceFabric;
|
||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
@ -44,7 +46,7 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API
|
||||
// This method gets called by the runtime. Use this method to add services to the container.
|
||||
public IServiceProvider ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddApplicationInsightsTelemetry(Configuration);
|
||||
RegisterAppInsights(services);
|
||||
|
||||
// Add framework services.
|
||||
services.AddMvc(options =>
|
||||
@ -63,13 +65,7 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API
|
||||
);
|
||||
});
|
||||
|
||||
services.Configure<BasketSettings>(Configuration);
|
||||
|
||||
if(Configuration.GetValue<string>("OrchestratorType").Equals("K8S"))
|
||||
{
|
||||
// Enable K8s telemetry initializer
|
||||
services.EnableKubernetes();
|
||||
}
|
||||
services.Configure<BasketSettings>(Configuration);
|
||||
|
||||
//By connecting here we are making sure that our service
|
||||
//cannot start until redis is ready. This might slow down startup,
|
||||
@ -80,7 +76,7 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API
|
||||
services.AddSingleton<ConnectionMultiplexer>(sp =>
|
||||
{
|
||||
var settings = sp.GetRequiredService<IOptions<BasketSettings>>().Value;
|
||||
var configuration = ConfigurationOptions.Parse(settings.ConnectionString, true);
|
||||
var configuration = ConfigurationOptions.Parse(settings.ConnectionString, true);
|
||||
|
||||
configuration.ResolveDns = true;
|
||||
|
||||
@ -111,7 +107,8 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API
|
||||
HostName = Configuration["EventBusConnection"]
|
||||
};
|
||||
|
||||
if (!string.IsNullOrEmpty(Configuration["EventBusUserName"])) {
|
||||
if (!string.IsNullOrEmpty(Configuration["EventBusUserName"]))
|
||||
{
|
||||
factory.UserName = Configuration["EventBusUserName"];
|
||||
}
|
||||
|
||||
@ -169,7 +166,7 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API
|
||||
services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
|
||||
services.AddTransient<IBasketRepository, RedisBasketRepository>();
|
||||
services.AddTransient<IIdentityService, IdentityService>();
|
||||
|
||||
|
||||
services.AddOptions();
|
||||
|
||||
var container = new ContainerBuilder();
|
||||
@ -177,8 +174,7 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API
|
||||
|
||||
return new AutofacServiceProvider(container.Build());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
|
||||
@ -210,6 +206,23 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API
|
||||
|
||||
}
|
||||
|
||||
private void RegisterAppInsights(IServiceCollection services)
|
||||
{
|
||||
services.AddApplicationInsightsTelemetry(Configuration);
|
||||
|
||||
if (Configuration.GetValue<string>("OrchestratorType").Equals("K8S"))
|
||||
{
|
||||
// Enable K8s telemetry initializer
|
||||
services.EnableKubernetes();
|
||||
}
|
||||
if (Configuration.GetValue<string>("OrchestratorType").Equals("SF"))
|
||||
{
|
||||
// Enable SF telemetry initializer
|
||||
services.AddSingleton<ITelemetryInitializer>((serviceProvider) =>
|
||||
new FabricTelemetryInitializer());
|
||||
}
|
||||
}
|
||||
|
||||
private void ConfigureAuthService(IServiceCollection services)
|
||||
{
|
||||
// prevent from mapping "sub" claim to nameidentifier.
|
||||
|
@ -38,6 +38,7 @@
|
||||
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.1.1" />
|
||||
<PackageReference Include="Microsoft.ApplicationInsights.DependencyCollector" Version="2.4.1" />
|
||||
<PackageReference Include="Microsoft.ApplicationInsights.Kubernetes" Version="1.0.0-beta1" />
|
||||
<PackageReference Include="Microsoft.ApplicationInsights.ServiceFabric" Version="2.0.0-beta1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="1.0.0" />
|
||||
<PackageReference Include="System.IO.Compression.ZipFile" Version="4.3.0" />
|
||||
|
@ -4,6 +4,8 @@
|
||||
using Autofac.Extensions.DependencyInjection;
|
||||
using global::Catalog.API.Infrastructure.Filters;
|
||||
using global::Catalog.API.IntegrationEvents;
|
||||
using Microsoft.ApplicationInsights.Extensibility;
|
||||
using Microsoft.ApplicationInsights.ServiceFabric;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Azure.ServiceBus;
|
||||
@ -41,13 +43,7 @@
|
||||
{
|
||||
// Add framework services.
|
||||
|
||||
services.AddApplicationInsightsTelemetry(Configuration);
|
||||
|
||||
if (Configuration.GetValue<string>("OrchestratorType").Equals("K8S"))
|
||||
{
|
||||
// Enable K8s telemetry initializer
|
||||
services.EnableKubernetes();
|
||||
}
|
||||
RegisterAppInsights(services);
|
||||
|
||||
services.AddHealthChecks(checks =>
|
||||
{
|
||||
@ -208,6 +204,23 @@
|
||||
ConfigureEventBus(app);
|
||||
}
|
||||
|
||||
private void RegisterAppInsights(IServiceCollection services)
|
||||
{
|
||||
services.AddApplicationInsightsTelemetry(Configuration);
|
||||
|
||||
if (Configuration.GetValue<string>("OrchestratorType").Equals("K8S"))
|
||||
{
|
||||
// Enable K8s telemetry initializer
|
||||
services.EnableKubernetes();
|
||||
}
|
||||
if (Configuration.GetValue<string>("OrchestratorType").Equals("SF"))
|
||||
{
|
||||
// Enable SF telemetry initializer
|
||||
services.AddSingleton<ITelemetryInitializer>((serviceProvider) =>
|
||||
new FabricTelemetryInitializer());
|
||||
}
|
||||
}
|
||||
|
||||
private void RegisterEventBus(IServiceCollection services)
|
||||
{
|
||||
if (Configuration.GetValue<bool>("AzureServiceBusEnabled"))
|
||||
|
@ -19,6 +19,7 @@
|
||||
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.1.1" />
|
||||
<PackageReference Include="Microsoft.ApplicationInsights.DependencyCollector" Version="2.4.1" />
|
||||
<PackageReference Include="Microsoft.ApplicationInsights.Kubernetes" Version="1.0.0-beta1" />
|
||||
<PackageReference Include="Microsoft.ApplicationInsights.ServiceFabric" Version="2.0.0-beta1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />
|
||||
<PackageReference Include="IdentityServer4.AspNetIdentity" Version="2.0.0" />
|
||||
<PackageReference Include="IdentityServer4.EntityFramework" Version="2.0.0" />
|
||||
|
@ -1,6 +1,8 @@
|
||||
using Autofac;
|
||||
using Autofac.Extensions.DependencyInjection;
|
||||
using IdentityServer4.Services;
|
||||
using Microsoft.ApplicationInsights.Extensibility;
|
||||
using Microsoft.ApplicationInsights.ServiceFabric;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
@ -31,13 +33,7 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API
|
||||
// This method gets called by the runtime. Use this method to add services to the container.
|
||||
public IServiceProvider ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddApplicationInsightsTelemetry(Configuration);
|
||||
|
||||
if (Configuration.GetValue<string>("OrchestratorType").Equals("K8S"))
|
||||
{
|
||||
// Enable K8s telemetry initializer
|
||||
services.EnableKubernetes();
|
||||
}
|
||||
RegisterAppInsights(services);
|
||||
|
||||
// Add framework services.
|
||||
services.AddDbContext<ApplicationDbContext>(options =>
|
||||
@ -163,5 +159,22 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API
|
||||
template: "{controller=Home}/{action=Index}/{id?}");
|
||||
});
|
||||
}
|
||||
|
||||
private void RegisterAppInsights(IServiceCollection services)
|
||||
{
|
||||
services.AddApplicationInsightsTelemetry(Configuration);
|
||||
|
||||
if (Configuration.GetValue<string>("OrchestratorType").Equals("K8S"))
|
||||
{
|
||||
// Enable K8s telemetry initializer
|
||||
services.EnableKubernetes();
|
||||
}
|
||||
if (Configuration.GetValue<string>("OrchestratorType").Equals("SF"))
|
||||
{
|
||||
// Enable SF telemetry initializer
|
||||
services.AddSingleton<ITelemetryInitializer>((serviceProvider) =>
|
||||
new FabricTelemetryInitializer());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -14,6 +14,7 @@
|
||||
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.1.1" />
|
||||
<PackageReference Include="Microsoft.ApplicationInsights.DependencyCollector" Version="2.4.1" />
|
||||
<PackageReference Include="Microsoft.ApplicationInsights.Kubernetes" Version="1.0.0-beta1" />
|
||||
<PackageReference Include="Microsoft.ApplicationInsights.ServiceFabric" Version="2.0.0-beta1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />
|
||||
<PackageReference Include="mongocsharpdriver" Version="2.4.4" />
|
||||
<PackageReference Include="MongoDB.Bson" Version="2.4.4" />
|
||||
|
@ -1,5 +1,7 @@
|
||||
using Autofac;
|
||||
using Autofac.Extensions.DependencyInjection;
|
||||
using Microsoft.ApplicationInsights.Extensibility;
|
||||
using Microsoft.ApplicationInsights.ServiceFabric;
|
||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
@ -37,13 +39,7 @@ namespace Microsoft.eShopOnContainers.Services.Locations.API
|
||||
|
||||
public IServiceProvider ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddApplicationInsightsTelemetry(Configuration);
|
||||
|
||||
if (Configuration.GetValue<string>("OrchestratorType").Equals("K8S"))
|
||||
{
|
||||
// Enable K8s telemetry initializer
|
||||
services.EnableKubernetes();
|
||||
}
|
||||
RegisterAppInsights(services);
|
||||
|
||||
services.AddMvc(options =>
|
||||
{
|
||||
@ -182,6 +178,23 @@ namespace Microsoft.eShopOnContainers.Services.Locations.API
|
||||
.Wait();
|
||||
}
|
||||
|
||||
private void RegisterAppInsights(IServiceCollection services)
|
||||
{
|
||||
services.AddApplicationInsightsTelemetry(Configuration);
|
||||
|
||||
if (Configuration.GetValue<string>("OrchestratorType").Equals("K8S"))
|
||||
{
|
||||
// Enable K8s telemetry initializer
|
||||
services.EnableKubernetes();
|
||||
}
|
||||
if (Configuration.GetValue<string>("OrchestratorType").Equals("SF"))
|
||||
{
|
||||
// Enable SF telemetry initializer
|
||||
services.AddSingleton<ITelemetryInitializer>((serviceProvider) =>
|
||||
new FabricTelemetryInitializer());
|
||||
}
|
||||
}
|
||||
|
||||
private void ConfigureAuthService(IServiceCollection services)
|
||||
{
|
||||
// prevent from mapping "sub" claim to nameidentifier.
|
||||
|
@ -24,6 +24,7 @@
|
||||
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.1.1" />
|
||||
<PackageReference Include="Microsoft.ApplicationInsights.DependencyCollector" Version="2.4.1" />
|
||||
<PackageReference Include="Microsoft.ApplicationInsights.Kubernetes" Version="1.0.0-beta1" />
|
||||
<PackageReference Include="Microsoft.ApplicationInsights.ServiceFabric" Version="2.0.0-beta1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />
|
||||
<PackageReference Include="mongocsharpdriver" Version="2.4.4" />
|
||||
<PackageReference Include="MongoDB.Bson" Version="2.4.4" />
|
||||
|
@ -21,6 +21,8 @@
|
||||
using Infrastructure.Services;
|
||||
using IntegrationEvents.Events;
|
||||
using Marketing.API.IntegrationEvents.Handlers;
|
||||
using Microsoft.ApplicationInsights.Extensibility;
|
||||
using Microsoft.ApplicationInsights.ServiceFabric;
|
||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||
using Microsoft.EntityFrameworkCore.Diagnostics;
|
||||
using RabbitMQ.Client;
|
||||
@ -44,13 +46,7 @@
|
||||
// This method gets called by the runtime. Use this method to add services to the container.
|
||||
public IServiceProvider ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddApplicationInsightsTelemetry(Configuration);
|
||||
|
||||
if (Configuration.GetValue<string>("OrchestratorType").Equals("K8S"))
|
||||
{
|
||||
// Enable K8s telemetry initializer
|
||||
services.EnableKubernetes();
|
||||
}
|
||||
RegisterAppInsights(services);
|
||||
|
||||
// Add framework services.
|
||||
services.AddMvc(options =>
|
||||
@ -213,6 +209,23 @@
|
||||
ConfigureEventBus(app);
|
||||
}
|
||||
|
||||
private void RegisterAppInsights(IServiceCollection services)
|
||||
{
|
||||
services.AddApplicationInsightsTelemetry(Configuration);
|
||||
|
||||
if (Configuration.GetValue<string>("OrchestratorType").Equals("K8S"))
|
||||
{
|
||||
// Enable K8s telemetry initializer
|
||||
services.EnableKubernetes();
|
||||
}
|
||||
if (Configuration.GetValue<string>("OrchestratorType").Equals("SF"))
|
||||
{
|
||||
// Enable SF telemetry initializer
|
||||
services.AddSingleton<ITelemetryInitializer>((serviceProvider) =>
|
||||
new FabricTelemetryInitializer());
|
||||
}
|
||||
}
|
||||
|
||||
private void ConfigureAuthService(IServiceCollection services)
|
||||
{
|
||||
// prevent from mapping "sub" claim to nameidentifier.
|
||||
|
@ -40,6 +40,7 @@
|
||||
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.1.1" />
|
||||
<PackageReference Include="Microsoft.ApplicationInsights.DependencyCollector" Version="2.4.1" />
|
||||
<PackageReference Include="Microsoft.ApplicationInsights.Kubernetes" Version="1.0.0-beta1" />
|
||||
<PackageReference Include="Microsoft.ApplicationInsights.ServiceFabric" Version="2.0.0-beta1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />
|
||||
<PackageReference Include="MediatR" Version="3.0.1" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="1.0.0" />
|
||||
|
@ -10,6 +10,8 @@
|
||||
using Infrastructure.AutofacModules;
|
||||
using Infrastructure.Filters;
|
||||
using Infrastructure.Services;
|
||||
using Microsoft.ApplicationInsights.Extensibility;
|
||||
using Microsoft.ApplicationInsights.ServiceFabric;
|
||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
@ -46,13 +48,7 @@
|
||||
|
||||
public IServiceProvider ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddApplicationInsightsTelemetry(Configuration);
|
||||
|
||||
if (Configuration.GetValue<string>("OrchestratorType").Equals("K8S"))
|
||||
{
|
||||
// Enable K8s telemetry initializer
|
||||
services.EnableKubernetes();
|
||||
}
|
||||
RegisterAppInsights(services);
|
||||
|
||||
// Add framework services.
|
||||
services.AddMvc(options =>
|
||||
@ -235,6 +231,23 @@
|
||||
ConfigureEventBus(app);
|
||||
}
|
||||
|
||||
private void RegisterAppInsights(IServiceCollection services)
|
||||
{
|
||||
services.AddApplicationInsightsTelemetry(Configuration);
|
||||
|
||||
if (Configuration.GetValue<string>("OrchestratorType").Equals("K8S"))
|
||||
{
|
||||
// Enable K8s telemetry initializer
|
||||
services.EnableKubernetes();
|
||||
}
|
||||
if (Configuration.GetValue<string>("OrchestratorType").Equals("SF"))
|
||||
{
|
||||
// Enable SF telemetry initializer
|
||||
services.AddSingleton<ITelemetryInitializer>((serviceProvider) =>
|
||||
new FabricTelemetryInitializer());
|
||||
}
|
||||
}
|
||||
|
||||
private void ConfigureEventBus(IApplicationBuilder app)
|
||||
{
|
||||
var eventBus = app.ApplicationServices.GetRequiredService<BuildingBlocks.EventBus.Abstractions.IEventBus>();
|
||||
|
@ -11,6 +11,7 @@
|
||||
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.1.1" />
|
||||
<PackageReference Include="Microsoft.ApplicationInsights.DependencyCollector" Version="2.4.1" />
|
||||
<PackageReference Include="Microsoft.ApplicationInsights.Kubernetes" Version="1.0.0-beta1" />
|
||||
<PackageReference Include="Microsoft.ApplicationInsights.ServiceFabric" Version="2.0.0-beta1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="1.0.0" />
|
||||
</ItemGroup>
|
||||
|
@ -17,6 +17,8 @@ using RabbitMQ.Client;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Swashbuckle.AspNetCore.Swagger;
|
||||
using Microsoft.ApplicationInsights.Extensibility;
|
||||
using Microsoft.ApplicationInsights.ServiceFabric;
|
||||
|
||||
namespace Payment.API
|
||||
{
|
||||
@ -31,16 +33,10 @@ namespace Payment.API
|
||||
|
||||
// This method gets called by the runtime. Use this method to add services to the container.
|
||||
public IServiceProvider ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddApplicationInsightsTelemetry(Configuration);
|
||||
|
||||
{
|
||||
services.Configure<PaymentSettings>(Configuration);
|
||||
|
||||
if (Configuration.GetValue<string>("OrchestratorType").Equals("K8S"))
|
||||
{
|
||||
// Enable K8s telemetry initializer
|
||||
services.EnableKubernetes();
|
||||
}
|
||||
RegisterAppInsights(services);
|
||||
|
||||
if (Configuration.GetValue<bool>("AzureServiceBusEnabled"))
|
||||
{
|
||||
@ -111,6 +107,23 @@ namespace Payment.API
|
||||
ConfigureEventBus(app);
|
||||
}
|
||||
|
||||
private void RegisterAppInsights(IServiceCollection services)
|
||||
{
|
||||
services.AddApplicationInsightsTelemetry(Configuration);
|
||||
|
||||
if (Configuration.GetValue<string>("OrchestratorType").Equals("K8S"))
|
||||
{
|
||||
// Enable K8s telemetry initializer
|
||||
services.EnableKubernetes();
|
||||
}
|
||||
if (Configuration.GetValue<string>("OrchestratorType").Equals("SF"))
|
||||
{
|
||||
// Enable SF telemetry initializer
|
||||
services.AddSingleton<ITelemetryInitializer>((serviceProvider) =>
|
||||
new FabricTelemetryInitializer());
|
||||
}
|
||||
}
|
||||
|
||||
private void RegisterEventBus(IServiceCollection services)
|
||||
{
|
||||
if (Configuration.GetValue<bool>("AzureServiceBusEnabled"))
|
||||
|
@ -1,4 +1,6 @@
|
||||
using Microsoft.AspNetCore.Authentication.Cookies;
|
||||
using Microsoft.ApplicationInsights.Extensibility;
|
||||
using Microsoft.ApplicationInsights.ServiceFabric;
|
||||
using Microsoft.AspNetCore.Authentication.Cookies;
|
||||
using Microsoft.AspNetCore.Authentication.OpenIdConnect;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
@ -31,13 +33,7 @@ namespace Microsoft.eShopOnContainers.WebMVC
|
||||
// This method gets called by the runtime. Use this method to add services to the container.
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddApplicationInsightsTelemetry(Configuration);
|
||||
|
||||
if (Configuration.GetValue<string>("OrchestratorType").Equals("K8S"))
|
||||
{
|
||||
// Enable K8s telemetry initializer
|
||||
services.EnableKubernetes();
|
||||
}
|
||||
RegisterAppInsights(services);
|
||||
|
||||
services.AddMvc();
|
||||
services.AddSession();
|
||||
@ -180,5 +176,22 @@ namespace Microsoft.eShopOnContainers.WebMVC
|
||||
template: "{controller=Error}/{action=Error}");
|
||||
});
|
||||
}
|
||||
|
||||
private void RegisterAppInsights(IServiceCollection services)
|
||||
{
|
||||
services.AddApplicationInsightsTelemetry(Configuration);
|
||||
|
||||
if (Configuration.GetValue<string>("OrchestratorType").Equals("K8S"))
|
||||
{
|
||||
// Enable K8s telemetry initializer
|
||||
services.EnableKubernetes();
|
||||
}
|
||||
if (Configuration.GetValue<string>("OrchestratorType").Equals("SF"))
|
||||
{
|
||||
// Enable SF telemetry initializer
|
||||
services.AddSingleton<ITelemetryInitializer>((serviceProvider) =>
|
||||
new FabricTelemetryInitializer());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -39,6 +39,7 @@
|
||||
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.1.1" />
|
||||
<PackageReference Include="Microsoft.ApplicationInsights.DependencyCollector" Version="2.4.1" />
|
||||
<PackageReference Include="Microsoft.ApplicationInsights.Kubernetes" Version="1.0.0-beta1" />
|
||||
<PackageReference Include="Microsoft.ApplicationInsights.ServiceFabric" Version="2.0.0-beta1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Fabric.MSBuild" Version="1.6.1" />
|
||||
</ItemGroup>
|
||||
|
@ -1,4 +1,6 @@
|
||||
using eShopOnContainers.WebSPA;
|
||||
using Microsoft.ApplicationInsights.Extensibility;
|
||||
using Microsoft.ApplicationInsights.ServiceFabric;
|
||||
using Microsoft.AspNetCore.Antiforgery;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
@ -36,13 +38,7 @@ namespace eShopConContainers.WebSPA
|
||||
// For more information on how to configure your application, visit http://go.microsoft.com/fwlink/?LinkID=398940
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddApplicationInsightsTelemetry(Configuration);
|
||||
|
||||
if (Configuration.GetValue<string>("OrchestratorType").Equals("K8S"))
|
||||
{
|
||||
// Enable K8s telemetry initializer
|
||||
services.EnableKubernetes();
|
||||
}
|
||||
RegisterAppInsights(services);
|
||||
|
||||
services.AddHealthChecks(checks =>
|
||||
{
|
||||
@ -128,11 +124,28 @@ namespace eShopConContainers.WebSPA
|
||||
await next();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
app.UseDefaultFiles();
|
||||
app.UseStaticFiles();
|
||||
|
||||
app.UseMvcWithDefaultRoute();
|
||||
}
|
||||
|
||||
private void RegisterAppInsights(IServiceCollection services)
|
||||
{
|
||||
services.AddApplicationInsightsTelemetry(Configuration);
|
||||
|
||||
if (Configuration.GetValue<string>("OrchestratorType").Equals("K8S"))
|
||||
{
|
||||
// Enable K8s telemetry initializer
|
||||
services.EnableKubernetes();
|
||||
}
|
||||
if (Configuration.GetValue<string>("OrchestratorType").Equals("SF"))
|
||||
{
|
||||
// Enable SF telemetry initializer
|
||||
services.AddSingleton<ITelemetryInitializer>((serviceProvider) =>
|
||||
new FabricTelemetryInitializer());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -30,6 +30,7 @@
|
||||
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.1.1" />
|
||||
<PackageReference Include="Microsoft.ApplicationInsights.DependencyCollector" Version="2.4.1" />
|
||||
<PackageReference Include="Microsoft.ApplicationInsights.Kubernetes" Version="1.0.0-beta1" />
|
||||
<PackageReference Include="Microsoft.ApplicationInsights.ServiceFabric" Version="2.0.0-beta1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
|
||||
</ItemGroup>
|
||||
|
@ -8,6 +8,8 @@ using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using WebStatus.Extensions;
|
||||
using Microsoft.ApplicationInsights.Extensibility;
|
||||
using Microsoft.ApplicationInsights.ServiceFabric;
|
||||
|
||||
namespace WebStatus
|
||||
{
|
||||
@ -23,13 +25,7 @@ namespace WebStatus
|
||||
// This method gets called by the runtime. Use this method to add services to the container.
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddApplicationInsightsTelemetry(Configuration);
|
||||
|
||||
if (Configuration.GetValue<string>("OrchestratorType").Equals("K8S"))
|
||||
{
|
||||
// Enable K8s telemetry initializer
|
||||
services.EnableKubernetes();
|
||||
}
|
||||
RegisterAppInsights(services);
|
||||
|
||||
services.AddOptions();
|
||||
|
||||
@ -87,5 +83,22 @@ namespace WebStatus
|
||||
template: "{controller=Home}/{action=Index}/{id?}");
|
||||
});
|
||||
}
|
||||
|
||||
private void RegisterAppInsights(IServiceCollection services)
|
||||
{
|
||||
services.AddApplicationInsightsTelemetry(Configuration);
|
||||
|
||||
if (Configuration.GetValue<string>("OrchestratorType").Equals("K8S"))
|
||||
{
|
||||
// Enable K8s telemetry initializer
|
||||
services.EnableKubernetes();
|
||||
}
|
||||
if (Configuration.GetValue<string>("OrchestratorType").Equals("SF"))
|
||||
{
|
||||
// Enable SF telemetry initializer
|
||||
services.AddSingleton<ITelemetryInitializer>((serviceProvider) =>
|
||||
new FabricTelemetryInitializer());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -8,6 +8,7 @@
|
||||
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.1.1" />
|
||||
<PackageReference Include="Microsoft.ApplicationInsights.DependencyCollector" Version="2.4.1" />
|
||||
<PackageReference Include="Microsoft.ApplicationInsights.Kubernetes" Version="1.0.0-beta1" />
|
||||
<PackageReference Include="Microsoft.ApplicationInsights.ServiceFabric" Version="2.0.0-beta1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
Loading…
x
Reference in New Issue
Block a user