Browse Source

Refactored opentelemetry module to a common project

pull/1663/head
Sumit Ghosh 3 years ago
parent
commit
516de21a7e
42 changed files with 372 additions and 344 deletions
  1. +1
    -0
      src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile
  2. +1
    -0
      src/ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile
  3. +117
    -0
      src/OpenTelemetry/Extensions/OpenTelemetryExtensions.cs
  4. +22
    -0
      src/OpenTelemetry/OpenTelemetry.Customization.csproj
  5. +18
    -0
      src/OpenTelemetry/OpenTelemetryConfig.cs
  6. +8
    -0
      src/Services/Basket/Basket.API/Basket.API.csproj
  7. +2
    -0
      src/Services/Basket/Basket.API/Dockerfile
  8. +0
    -69
      src/Services/Basket/Basket.API/Extensions/OpenTelemetryExtensions.cs
  9. +10
    -3
      src/Services/Basket/Basket.API/Startup.cs
  10. +3
    -14
      src/Services/Catalog/Catalog.API/Catalog.API.csproj
  11. +1
    -0
      src/Services/Catalog/Catalog.API/Dockerfile
  12. +0
    -68
      src/Services/Catalog/Catalog.API/Extensions/OpenTelemetryExtensions.cs
  13. +6
    -2
      src/Services/Catalog/Catalog.API/Startup.cs
  14. +1
    -0
      src/Services/Identity/Identity.API/Dockerfile
  15. +0
    -70
      src/Services/Identity/Identity.API/Extensions/OpenTelemetryExtensions.cs
  16. +7
    -11
      src/Services/Identity/Identity.API/Identity.API.csproj
  17. +8
    -2
      src/Services/Identity/Identity.API/Startup.cs
  18. +1
    -0
      src/Services/Ordering/Ordering.API/Dockerfile
  19. +0
    -70
      src/Services/Ordering/Ordering.API/Extensions/OpenTelemetryExtensions.cs
  20. +5
    -0
      src/Services/Ordering/Ordering.API/Ordering.API.csproj
  21. +11
    -3
      src/Services/Ordering/Ordering.API/Startup.cs
  22. +1
    -0
      src/Services/Ordering/Ordering.BackgroundTasks/Dockerfile
  23. +1
    -0
      src/Services/Ordering/Ordering.SignalrHub/Dockerfile
  24. +1
    -0
      src/Services/Payment/Payment.API/Dockerfile
  25. +6
    -8
      src/Services/Payment/Payment.API/Extensions/OpenTelemetryExtensions.cs
  26. +8
    -0
      src/Services/Payment/Payment.API/Payment.API.csproj
  27. +10
    -2
      src/Services/Payment/Payment.API/Startup.cs
  28. +1
    -0
      src/Services/Webhooks/Webhooks.API/Dockerfile
  29. +9
    -0
      src/Services/Webhooks/Webhooks.API/Startup.cs
  30. +1
    -0
      src/Services/Webhooks/Webhooks.API/Webhooks.API.csproj
  31. +1
    -0
      src/Web/WebMVC/Dockerfile
  32. +10
    -2
      src/Web/WebMVC/Startup.cs
  33. +5
    -0
      src/Web/WebMVC/WebMVC.csproj
  34. +1
    -0
      src/Web/WebSPA/Dockerfile
  35. +9
    -2
      src/Web/WebSPA/Startup.cs
  36. +7
    -0
      src/Web/WebSPA/WebSPA.csproj
  37. +1
    -0
      src/Web/WebStatus/Dockerfile
  38. +1
    -0
      src/Web/WebhookClient/Dockerfile
  39. +7
    -7
      src/docker-compose.opentelemetry.jaeger.yml
  40. +3
    -3
      src/docker-compose.opentelemetry.otlp.yml
  41. +13
    -8
      src/docker-compose.opentelemetry.zipkin.yml
  42. +54
    -0
      src/eShopOnContainers-ServicesAndWebApps.sln

+ 1
- 0
src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile View File

@ -38,6 +38,7 @@ COPY "Web/WebhookClient/WebhookClient.csproj" "Web/WebhookClient/WebhookClient.c
COPY "Web/WebMVC/WebMVC.csproj" "Web/WebMVC/WebMVC.csproj"
COPY "Web/WebSPA/WebSPA.csproj" "Web/WebSPA/WebSPA.csproj"
COPY "Web/WebStatus/WebStatus.csproj" "Web/WebStatus/WebStatus.csproj"
COPY "OpenTelemetry/OpenTelemetry.Customization.csproj" "OpenTelemetry/OpenTelemetry.Customization.csproj"
COPY "docker-compose.dcproj" "docker-compose.dcproj"


+ 1
- 0
src/ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile View File

@ -38,6 +38,7 @@ COPY "Web/WebhookClient/WebhookClient.csproj" "Web/WebhookClient/WebhookClient.c
COPY "Web/WebMVC/WebMVC.csproj" "Web/WebMVC/WebMVC.csproj"
COPY "Web/WebSPA/WebSPA.csproj" "Web/WebSPA/WebSPA.csproj"
COPY "Web/WebStatus/WebStatus.csproj" "Web/WebStatus/WebStatus.csproj"
COPY "OpenTelemetry/OpenTelemetry.Customization.csproj" "OpenTelemetry/OpenTelemetry.Customization.csproj"
COPY "docker-compose.dcproj" "docker-compose.dcproj"


+ 117
- 0
src/OpenTelemetry/Extensions/OpenTelemetryExtensions.cs View File

@ -0,0 +1,117 @@
using Microsoft.Extensions.DependencyInjection;
using OpenTelemetry;
using OpenTelemetry.Resources;
using OpenTelemetry.Trace;
using StackExchange.Redis;
using System;
namespace OpenTelemetry.Customization.Extensions
{
public static class OpenTelemetryExtensions
{
public static IServiceCollection AddOpenTelemetry(this IServiceCollection services, OpenTelemetryConfig openTelemetryConfig)
{
if (openTelemetryConfig == null || openTelemetryConfig.ExportType == null)
{
return services;
}
return services.AddOpenTelemetryTracing((serviceProvider, tracerProviderBuilder) =>
{
// Configure resource
tracerProviderBuilder
.SetResourceBuilder(ResourceBuilder.CreateDefault().AddService(openTelemetryConfig.ServiceName));
// Configure instrumentation
tracerProviderBuilder
.AddAspNetCoreInstrumentation()
.AddHttpClientInstrumentation()
.AddGrpcClientInstrumentation()
.AddSqlClientInstrumentation();
// Configure exporter
switch (openTelemetryConfig.ExportType)
{
case "jaeger":
tracerProviderBuilder.AddJaegerExporter(options =>
{
options.AgentHost = openTelemetryConfig.ExportToolEndpoint;
});
break;
case "otlp":
tracerProviderBuilder.AddOtlpExporter(options =>
{
options.Endpoint = new Uri(openTelemetryConfig.ExportToolEndpoint);
var headers = Environment.GetEnvironmentVariable("OTEL_EXPORTER_OTLP_TRACES_HEADERS")
?? Environment.GetEnvironmentVariable("OTEL_EXPORTER_OTLP_HEADERS");
options.Headers = headers;
});
break;
case "zipkin":
tracerProviderBuilder.AddZipkinExporter(options =>
{
options.Endpoint = new Uri(openTelemetryConfig.ExportToolEndpoint);
});
break;
default:
tracerProviderBuilder.AddConsoleExporter();
break;
}
});
}
public static void AddOpenTelemetry(ConnectionMultiplexer connectionMultiplexer, OpenTelemetryConfig openTelemetryConfig)
{
if (openTelemetryConfig == null || openTelemetryConfig.ExportType == null)
{
return;
}
var tracerProviderBuilder = Sdk.CreateTracerProviderBuilder();
// Configure resource
tracerProviderBuilder
.SetResourceBuilder(ResourceBuilder.CreateDefault().AddService(openTelemetryConfig.ServiceName));
// Configure instrumentation
tracerProviderBuilder
.AddAspNetCoreInstrumentation()
.AddHttpClientInstrumentation()
.AddRedisInstrumentation(connectionMultiplexer);
// Configure exporter
switch (openTelemetryConfig.ExportType)
{
case "jaeger":
tracerProviderBuilder.AddJaegerExporter(options =>
{
options.AgentHost = openTelemetryConfig.ExportToolEndpoint;
});
break;
case "otlp":
tracerProviderBuilder.AddOtlpExporter(options =>
{
options.Endpoint = new Uri(openTelemetryConfig.ExportToolEndpoint);
var headers = Environment.GetEnvironmentVariable("OTEL_EXPORTER_OTLP_TRACES_HEADERS")
?? Environment.GetEnvironmentVariable("OTEL_EXPORTER_OTLP_HEADERS");
options.Headers = headers;
});
break;
case "zipkin":
tracerProviderBuilder.AddZipkinExporter(options =>
{
options.Endpoint = new Uri(openTelemetryConfig.ExportToolEndpoint);
});
break;
default:
tracerProviderBuilder.AddConsoleExporter();
break;
}
tracerProviderBuilder.Build();
}
}
}

+ 22
- 0
src/OpenTelemetry/OpenTelemetry.Customization.csproj View File

@ -0,0 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="StackExchange.Redis" Version="2.2.4" />
<PackageReference Include="OpenTelemetry" Version="1.0.1" />
<PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.0.1" />
<PackageReference Include="OpenTelemetry.Exporter.Jaeger" Version="1.0.1" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.0.1" />
<PackageReference Include="OpenTelemetry.Exporter.Zipkin" Version="1.0.1" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.0.0-rc2" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.0.0-rc2" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.0.0-rc2" />
<PackageReference Include="OpenTelemetry.Instrumentation.GrpcNetClient" Version="1.0.0-rc2" />
<PackageReference Include="OpenTelemetry.Instrumentation.SqlClient" Version="1.0.0-rc2" />
<PackageReference Include="OpenTelemetry.Instrumentation.StackExchangeRedis" Version="1.0.0-rc2" />
</ItemGroup>
</Project>

+ 18
- 0
src/OpenTelemetry/OpenTelemetryConfig.cs View File

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OpenTelemetry.Customization
{
public class OpenTelemetryConfig
{
public string ServiceName { get; set; }
public string ExportType { get; set; }
public string ExportToolEndpoint { get; set; }
}
}

+ 8
- 0
src/Services/Basket/Basket.API/Basket.API.csproj View File

@ -9,6 +9,13 @@
<LangVersion>preview</LangVersion>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Extensions\**" />
<Content Remove="Extensions\**" />
<EmbeddedResource Remove="Extensions\**" />
<None Remove="Extensions\**" />
</ItemGroup>
<ItemGroup>
<Content Update="web.config">
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
@ -64,6 +71,7 @@
<ProjectReference Include="..\..\..\BuildingBlocks\EventBus\EventBusRabbitMQ\EventBusRabbitMQ.csproj" />
<ProjectReference Include="..\..\..\BuildingBlocks\EventBus\EventBusServiceBus\EventBusServiceBus.csproj" />
<ProjectReference Include="..\..\..\BuildingBlocks\EventBus\EventBus\EventBus.csproj" />
<ProjectReference Include="..\..\..\OpenTelemetry\OpenTelemetry.Customization.csproj" />
</ItemGroup>
</Project>

+ 2
- 0
src/Services/Basket/Basket.API/Dockerfile View File

@ -38,6 +38,8 @@ COPY "Web/WebhookClient/WebhookClient.csproj" "Web/WebhookClient/WebhookClient.c
COPY "Web/WebMVC/WebMVC.csproj" "Web/WebMVC/WebMVC.csproj"
COPY "Web/WebSPA/WebSPA.csproj" "Web/WebSPA/WebSPA.csproj"
COPY "Web/WebStatus/WebStatus.csproj" "Web/WebStatus/WebStatus.csproj"
COPY "OpenTelemetry/OpenTelemetry.Customization.csproj" "OpenTelemetry/OpenTelemetry.Customization.csproj"
COPY "docker-compose.dcproj" "docker-compose.dcproj"


+ 0
- 69
src/Services/Basket/Basket.API/Extensions/OpenTelemetryExtensions.cs View File

@ -1,69 +0,0 @@
using Microsoft.Extensions.DependencyInjection;
using OpenTelemetry;
using OpenTelemetry.Resources;
using OpenTelemetry.Trace;
using StackExchange.Redis;
using System;
namespace Basket.API.Extensions
{
static class OpenTelemetryExtensions
{
public static void AddOpenTelemetry(ConnectionMultiplexer connectionMultiplexer)
{
var exportType = Environment.GetEnvironmentVariable("OTEL_USE_EXPORTER")?.ToLower();
if (exportType == null)
{
return;
}
var tracerProviderBuilder = Sdk.CreateTracerProviderBuilder();
// Configure resource
tracerProviderBuilder
.SetResourceBuilder(ResourceBuilder.CreateDefault().AddService("Basket.API"));
// Configure instrumentation
tracerProviderBuilder
.AddAspNetCoreInstrumentation()
.AddHttpClientInstrumentation()
.AddRedisInstrumentation(connectionMultiplexer);
// Configure exporter
switch (exportType)
{
case "jaeger":
tracerProviderBuilder.AddJaegerExporter(options =>
{
var agentHost = Environment.GetEnvironmentVariable("OTEL_EXPORTER_JAEGER_AGENTHOST");
options.AgentHost = agentHost;
});
break;
case "otlp":
tracerProviderBuilder.AddOtlpExporter(options =>
{
var endpoint = Environment.GetEnvironmentVariable("OTEL_EXPORTER_OTLP_TRACES_ENDPOINT")
?? Environment.GetEnvironmentVariable("OTEL_EXPORTER_OTLP_ENDPOINT");
options.Endpoint = new Uri(endpoint);
var headers = Environment.GetEnvironmentVariable("OTEL_EXPORTER_OTLP_TRACES_HEADERS")
?? Environment.GetEnvironmentVariable("OTEL_EXPORTER_OTLP_HEADERS");
options.Headers = headers;
});
break;
case "zipkin":
tracerProviderBuilder.AddZipkinExporter(options =>
{
var endpoint = Environment.GetEnvironmentVariable("OTEL_EXPORTER_ZIPKIN_ENDPOINT");
options.Endpoint = new Uri(endpoint);
});
break;
default:
tracerProviderBuilder.AddConsoleExporter();
break;
}
tracerProviderBuilder.Build();
}
}
}

+ 10
- 3
src/Services/Basket/Basket.API/Startup.cs View File

@ -1,6 +1,5 @@
using Autofac;
using Autofac.Extensions.DependencyInjection;
using Basket.API.Extensions;
using Basket.API.Infrastructure.Filters;
using Basket.API.IntegrationEvents.EventHandling;
using Basket.API.IntegrationEvents.Events;
@ -28,6 +27,8 @@ using Microsoft.Extensions.Diagnostics.HealthChecks;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Microsoft.OpenApi.Models;
using OpenTelemetry.Customization;
using OpenTelemetry.Customization.Extensions;
using RabbitMQ.Client;
using StackExchange.Redis;
using System;
@ -187,8 +188,14 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory, ConnectionMultiplexer connectionMultiplexer)
{
OpenTelemetryExtensions.AddOpenTelemetry(connectionMultiplexer);
{
OpenTelemetryExtensions.AddOpenTelemetry(connectionMultiplexer,new OpenTelemetryConfig()
{
ServiceName = "Basket.API",
ExportType = Configuration.GetValue<string>("OTEL_USE_EXPORTER"),
ExportToolEndpoint = Configuration.GetValue<string>("OTEL_EXPORTER_TOOL_ENDPOINT")
});
//loggerFactory.AddAzureWebAppDiagnostics();
//loggerFactory.AddApplicationInsights(app.ApplicationServices, LogLevel.Trace);


+ 3
- 14
src/Services/Catalog/Catalog.API/Catalog.API.csproj View File

@ -27,6 +27,7 @@
<Content Include="Setup\**\*;">
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Compile Remove="Extensions\OpenTelemetryExtensions.cs" />
<Content Remove="Setup\Catalogitems - Copy.zip" />
<None Remove="Setup\Catalogitems - Copy.zip" />
<Compile Include="IntegrationEvents\EventHandling\AnyFutureIntegrationEventHandler.cs.txt" />
@ -66,26 +67,14 @@
<PackageReference Include="Serilog.Sinks.Seq" Version="4.1.0-dev-00166" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.6.3" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.2" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="OpenTelemetry" Version="1.0.1" />
<PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.0.1" />
<PackageReference Include="OpenTelemetry.Exporter.Jaeger" Version="1.0.1" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.0.1" />
<PackageReference Include="OpenTelemetry.Exporter.Zipkin" Version="1.0.1" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.0.0-rc2" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.0.0-rc2" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.0.0-rc2" />
<PackageReference Include="OpenTelemetry.Instrumentation.GrpcNetClient" Version="1.0.0-rc2" />
<PackageReference Include="OpenTelemetry.Instrumentation.SqlClient" Version="1.0.0-rc2" />
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\BuildingBlocks\EventBus\EventBusRabbitMQ\EventBusRabbitMQ.csproj" />
<ProjectReference Include="..\..\..\BuildingBlocks\EventBus\EventBusServiceBus\EventBusServiceBus.csproj" />
<ProjectReference Include="..\..\..\BuildingBlocks\EventBus\EventBus\EventBus.csproj" />
<ProjectReference Include="..\..\..\BuildingBlocks\EventBus\IntegrationEventLogEF\IntegrationEventLogEF.csproj" />
<ProjectReference Include="..\..\..\OpenTelemetry\OpenTelemetry.Customization.csproj" />
</ItemGroup>
<ItemGroup>


+ 1
- 0
src/Services/Catalog/Catalog.API/Dockerfile View File

@ -39,6 +39,7 @@ COPY "Web/WebhookClient/WebhookClient.csproj" "Web/WebhookClient/WebhookClient.c
COPY "Web/WebMVC/WebMVC.csproj" "Web/WebMVC/WebMVC.csproj"
COPY "Web/WebSPA/WebSPA.csproj" "Web/WebSPA/WebSPA.csproj"
COPY "Web/WebStatus/WebStatus.csproj" "Web/WebStatus/WebStatus.csproj"
COPY "OpenTelemetry/OpenTelemetry.Customization.csproj" "OpenTelemetry/OpenTelemetry.Customization.csproj"
COPY "docker-compose.dcproj" "docker-compose.dcproj"


+ 0
- 68
src/Services/Catalog/Catalog.API/Extensions/OpenTelemetryExtensions.cs View File

@ -1,68 +0,0 @@
using Microsoft.Extensions.DependencyInjection;
using OpenTelemetry;
using OpenTelemetry.Resources;
using OpenTelemetry.Trace;
using System;
namespace Catalog.API.Extensions
{
static class OpenTelemetryExtensions
{
public static IServiceCollection AddOpenTelemetry(this IServiceCollection services)
{
var exportType = Environment.GetEnvironmentVariable("OTEL_USE_EXPORTER")?.ToLower();
if (exportType == null)
{
return services;
}
return services.AddOpenTelemetryTracing((serviceProvider, tracerProviderBuilder) =>
{
// Configure resource
tracerProviderBuilder
.SetResourceBuilder(ResourceBuilder.CreateDefault().AddService("Catalog.API"));
// Configure instrumentation
tracerProviderBuilder
.AddAspNetCoreInstrumentation()
.AddHttpClientInstrumentation()
.AddGrpcClientInstrumentation()
.AddSqlClientInstrumentation();
// Configure exporter
switch (exportType)
{
case "jaeger":
tracerProviderBuilder.AddJaegerExporter(options =>
{
var agentHost = Environment.GetEnvironmentVariable("OTEL_EXPORTER_JAEGER_AGENTHOST");
options.AgentHost = agentHost;
});
break;
case "otlp":
tracerProviderBuilder.AddOtlpExporter(options =>
{
var endpoint = Environment.GetEnvironmentVariable("OTEL_EXPORTER_OTLP_TRACES_ENDPOINT")
?? Environment.GetEnvironmentVariable("OTEL_EXPORTER_OTLP_ENDPOINT");
options.Endpoint = new Uri(endpoint);
var headers = Environment.GetEnvironmentVariable("OTEL_EXPORTER_OTLP_TRACES_HEADERS")
?? Environment.GetEnvironmentVariable("OTEL_EXPORTER_OTLP_HEADERS");
options.Headers = headers;
});
break;
case "zipkin":
tracerProviderBuilder.AddZipkinExporter(options =>
{
var endpoint = Environment.GetEnvironmentVariable("OTEL_EXPORTER_ZIPKIN_ENDPOINT");
options.Endpoint = new Uri(endpoint);
});
break;
default:
tracerProviderBuilder.AddConsoleExporter();
break;
}
});
}
}
}

+ 6
- 2
src/Services/Catalog/Catalog.API/Startup.cs View File

@ -26,12 +26,13 @@ using Microsoft.Extensions.Diagnostics.HealthChecks;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Microsoft.OpenApi.Models;
using OpenTelemetry.Customization;
using OpenTelemetry.Customization.Extensions;
using RabbitMQ.Client;
using System;
using System.Data.Common;
using System.IO;
using System.Reflection;
using Catalog.API.Extensions;
namespace Microsoft.eShopOnContainers.Services.Catalog.API
{
@ -55,7 +56,10 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API
.AddEventBus(Configuration)
.AddSwagger(Configuration)
.AddCustomHealthCheck(Configuration)
.AddOpenTelemetry();
.AddOpenTelemetry(new OpenTelemetryConfig() { ServiceName= "Catalog.API",
ExportType= Configuration.GetValue<string>("OTEL_USE_EXPORTER"),
ExportToolEndpoint = Configuration.GetValue<string>("OTEL_EXPORTER_TOOL_ENDPOINT")
});
var container = new ContainerBuilder();
container.Populate(services);


+ 1
- 0
src/Services/Identity/Identity.API/Dockerfile View File

@ -38,6 +38,7 @@ COPY "Web/WebhookClient/WebhookClient.csproj" "Web/WebhookClient/WebhookClient.c
COPY "Web/WebMVC/WebMVC.csproj" "Web/WebMVC/WebMVC.csproj"
COPY "Web/WebSPA/WebSPA.csproj" "Web/WebSPA/WebSPA.csproj"
COPY "Web/WebStatus/WebStatus.csproj" "Web/WebStatus/WebStatus.csproj"
COPY "OpenTelemetry/OpenTelemetry.Customization.csproj" "OpenTelemetry/OpenTelemetry.Customization.csproj"
COPY "docker-compose.dcproj" "docker-compose.dcproj"


+ 0
- 70
src/Services/Identity/Identity.API/Extensions/OpenTelemetryExtensions.cs View File

@ -1,70 +0,0 @@
using Microsoft.Extensions.DependencyInjection;
using OpenTelemetry;
using OpenTelemetry.Resources;
using OpenTelemetry.Trace;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Identity.API.Extensions
{
static class OpenTelemetryExtensions
{
public static IServiceCollection AddOpenTelemetry(this IServiceCollection services)
{
var exportType = Environment.GetEnvironmentVariable("OTEL_USE_EXPORTER")?.ToLower();
if (exportType == null)
{
return services;
}
return services.AddOpenTelemetryTracing((serviceProvider, tracerProviderBuilder) =>
{
// Configure resource
tracerProviderBuilder
.SetResourceBuilder(ResourceBuilder.CreateDefault().AddService("Identity.API"));
// Configure instrumentation
tracerProviderBuilder
.AddAspNetCoreInstrumentation()
.AddHttpClientInstrumentation()
.AddSqlClientInstrumentation();
// Configure exporter
switch (exportType)
{
case "jaeger":
tracerProviderBuilder.AddJaegerExporter(options =>
{
var agentHost = Environment.GetEnvironmentVariable("OTEL_EXPORTER_JAEGER_AGENTHOST");
options.AgentHost = agentHost;
});
break;
case "otlp":
tracerProviderBuilder.AddOtlpExporter(options =>
{
var endpoint = Environment.GetEnvironmentVariable("OTEL_EXPORTER_OTLP_TRACES_ENDPOINT")
?? Environment.GetEnvironmentVariable("OTEL_EXPORTER_OTLP_ENDPOINT");
options.Endpoint = new Uri(endpoint);
var headers = Environment.GetEnvironmentVariable("OTEL_EXPORTER_OTLP_TRACES_HEADERS")
?? Environment.GetEnvironmentVariable("OTEL_EXPORTER_OTLP_HEADERS");
options.Headers = headers;
});
break;
case "zipkin":
tracerProviderBuilder.AddZipkinExporter(options =>
{
var endpoint = Environment.GetEnvironmentVariable("OTEL_EXPORTER_ZIPKIN_ENDPOINT");
options.Endpoint = new Uri(endpoint);
});
break;
default:
tracerProviderBuilder.AddConsoleExporter();
break;
}
});
}
}
}

+ 7
- 11
src/Services/Identity/Identity.API/Identity.API.csproj View File

@ -15,6 +15,10 @@
</Content>
</ItemGroup>
<ItemGroup>
<Compile Remove="Extensions\OpenTelemetryExtensions.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="AspNetCore.HealthChecks.SqlServer" Version="5.0.1" />
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="5.0.1" />
@ -51,21 +55,13 @@
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.6.3" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.2" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="OpenTelemetry" Version="1.0.1" />
<PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.0.1" />
<PackageReference Include="OpenTelemetry.Exporter.Jaeger" Version="1.0.1" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.0.1" />
<PackageReference Include="OpenTelemetry.Exporter.Zipkin" Version="1.0.1" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.0.0-rc2" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.0.0-rc2" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.0.0-rc2" />
<PackageReference Include="OpenTelemetry.Instrumentation.SqlClient" Version="1.0.0-rc2" />
<EmbeddedResource Include="Certificate\idsrv3test.pfx" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Certificate\idsrv3test.pfx" />
<ProjectReference Include="..\..\..\OpenTelemetry\OpenTelemetry.Customization.csproj" />
</ItemGroup>
<ItemGroup>


+ 8
- 2
src/Services/Identity/Identity.API/Startup.cs View File

@ -1,7 +1,6 @@
using Autofac;
using Autofac.Extensions.DependencyInjection;
using HealthChecks.UI.Client;
using Identity.API.Extensions;
using IdentityServer4.Services;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.DataProtection;
@ -22,6 +21,8 @@ using Microsoft.Extensions.Logging;
using StackExchange.Redis;
using System;
using System.Reflection;
using OpenTelemetry.Customization;
using OpenTelemetry.Customization.Extensions;
namespace Microsoft.eShopOnContainers.Services.Identity.API
{
@ -39,7 +40,12 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API
{
RegisterAppInsights(services);
services.AddOpenTelemetry();
services.AddOpenTelemetry(new OpenTelemetryConfig()
{
ServiceName = "Identity.API",
ExportType = Configuration.GetValue<string>("OTEL_USE_EXPORTER"),
ExportToolEndpoint = Configuration.GetValue<string>("OTEL_EXPORTER_TOOL_ENDPOINT")
});
// Add framework services.
services.AddDbContext<ApplicationDbContext>(options =>


+ 1
- 0
src/Services/Ordering/Ordering.API/Dockerfile View File

@ -38,6 +38,7 @@ COPY "Web/WebhookClient/WebhookClient.csproj" "Web/WebhookClient/WebhookClient.c
COPY "Web/WebMVC/WebMVC.csproj" "Web/WebMVC/WebMVC.csproj"
COPY "Web/WebSPA/WebSPA.csproj" "Web/WebSPA/WebSPA.csproj"
COPY "Web/WebStatus/WebStatus.csproj" "Web/WebStatus/WebStatus.csproj"
COPY "OpenTelemetry/OpenTelemetry.Customization.csproj" "OpenTelemetry/OpenTelemetry.Customization.csproj"
COPY "docker-compose.dcproj" "docker-compose.dcproj"


+ 0
- 70
src/Services/Ordering/Ordering.API/Extensions/OpenTelemetryExtensions.cs View File

@ -1,70 +0,0 @@
using Microsoft.Extensions.DependencyInjection;
using OpenTelemetry;
using OpenTelemetry.Resources;
using OpenTelemetry.Trace;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Ordering.API.Extensions
{
static class OpenTelemetryExtensions
{
public static IServiceCollection AddOpenTelemetry(this IServiceCollection services)
{
var exportType = Environment.GetEnvironmentVariable("OTEL_USE_EXPORTER")?.ToLower();
if (exportType == null)
{
return services;
}
return services.AddOpenTelemetryTracing((serviceProvider, tracerProviderBuilder) =>
{
// Configure resource
tracerProviderBuilder
.SetResourceBuilder(ResourceBuilder.CreateDefault().AddService("Order.API"));
// Configure instrumentation
tracerProviderBuilder
.AddAspNetCoreInstrumentation()
.AddHttpClientInstrumentation()
.AddSqlClientInstrumentation();
// Configure exporter
switch (exportType)
{
case "jaeger":
tracerProviderBuilder.AddJaegerExporter(options =>
{
var agentHost = Environment.GetEnvironmentVariable("OTEL_EXPORTER_JAEGER_AGENTHOST");
options.AgentHost = agentHost;
});
break;
case "otlp":
tracerProviderBuilder.AddOtlpExporter(options =>
{
var endpoint = Environment.GetEnvironmentVariable("OTEL_EXPORTER_OTLP_TRACES_ENDPOINT")
?? Environment.GetEnvironmentVariable("OTEL_EXPORTER_OTLP_ENDPOINT");
options.Endpoint = new Uri(endpoint);
var headers = Environment.GetEnvironmentVariable("OTEL_EXPORTER_OTLP_TRACES_HEADERS")
?? Environment.GetEnvironmentVariable("OTEL_EXPORTER_OTLP_HEADERS");
options.Headers = headers;
});
break;
case "zipkin":
tracerProviderBuilder.AddZipkinExporter(options =>
{
var endpoint = Environment.GetEnvironmentVariable("OTEL_EXPORTER_ZIPKIN_ENDPOINT");
options.Endpoint = new Uri(endpoint);
});
break;
default:
tracerProviderBuilder.AddConsoleExporter();
break;
}
});
}
}
}

+ 5
- 0
src/Services/Ordering/Ordering.API/Ordering.API.csproj View File

@ -19,6 +19,10 @@
</Content>
</ItemGroup>
<ItemGroup>
<Compile Remove="Extensions\OpenTelemetryExtensions.cs" />
</ItemGroup>
<ItemGroup>
<Protobuf Include="Proto\ordering.proto" GrpcServices="Server" Generator="MSBuild:Compile" />
@ -32,6 +36,7 @@
<ProjectReference Include="..\..\..\BuildingBlocks\EventBus\EventBus\EventBus.csproj" />
<ProjectReference Include="..\..\..\BuildingBlocks\EventBus\IntegrationEventLogEF\IntegrationEventLogEF.csproj" />
<ProjectReference Include="..\..\..\BuildingBlocks\WebHostCustomization\WebHost.Customization\WebHost.Customization.csproj" />
<ProjectReference Include="..\..\..\OpenTelemetry\OpenTelemetry.Customization.csproj" />
<ProjectReference Include="..\Ordering.Domain\Ordering.Domain.csproj" />
<ProjectReference Include="..\Ordering.Infrastructure\Ordering.Infrastructure.csproj" />
</ItemGroup>


+ 11
- 3
src/Services/Ordering/Ordering.API/Startup.cs View File

@ -38,6 +38,8 @@
using System.IO;
using System.Reflection;
using global::Ordering.API.Extensions;
using OpenTelemetry.Customization;
using OpenTelemetry.Customization.Extensions;
public class Startup
{
@ -56,8 +58,7 @@
{
options.EnableDetailedErrors = true;
})
.Services
.AddOpenTelemetry()
.Services
.AddApplicationInsights(Configuration)
.AddCustomMvc()
.AddHealthChecks(Configuration)
@ -67,7 +68,14 @@
.AddCustomConfiguration(Configuration)
.AddEventBus(Configuration)
.AddCustomAuthentication(Configuration);
services.AddOpenTelemetry(new OpenTelemetryConfig()
{
ServiceName = "Ordering.API",
ExportType = Configuration.GetValue<string>("OTEL_USE_EXPORTER"),
ExportToolEndpoint = Configuration.GetValue<string>("OTEL_EXPORTER_TOOL_ENDPOINT")
});
//configure autofac
var container = new ContainerBuilder();
container.Populate(services);


+ 1
- 0
src/Services/Ordering/Ordering.BackgroundTasks/Dockerfile View File

@ -38,6 +38,7 @@ COPY "Web/WebhookClient/WebhookClient.csproj" "Web/WebhookClient/WebhookClient.c
COPY "Web/WebMVC/WebMVC.csproj" "Web/WebMVC/WebMVC.csproj"
COPY "Web/WebSPA/WebSPA.csproj" "Web/WebSPA/WebSPA.csproj"
COPY "Web/WebStatus/WebStatus.csproj" "Web/WebStatus/WebStatus.csproj"
COPY "OpenTelemetry/OpenTelemetry.Customization.csproj" "OpenTelemetry/OpenTelemetry.Customization.csproj"
COPY "docker-compose.dcproj" "docker-compose.dcproj"


+ 1
- 0
src/Services/Ordering/Ordering.SignalrHub/Dockerfile View File

@ -38,6 +38,7 @@ COPY "Web/WebhookClient/WebhookClient.csproj" "Web/WebhookClient/WebhookClient.c
COPY "Web/WebMVC/WebMVC.csproj" "Web/WebMVC/WebMVC.csproj"
COPY "Web/WebSPA/WebSPA.csproj" "Web/WebSPA/WebSPA.csproj"
COPY "Web/WebStatus/WebStatus.csproj" "Web/WebStatus/WebStatus.csproj"
COPY "OpenTelemetry/OpenTelemetry.Customization.csproj" "OpenTelemetry/OpenTelemetry.Customization.csproj"
COPY "docker-compose.dcproj" "docker-compose.dcproj"


+ 1
- 0
src/Services/Payment/Payment.API/Dockerfile View File

@ -38,6 +38,7 @@ COPY "Web/WebhookClient/WebhookClient.csproj" "Web/WebhookClient/WebhookClient.c
COPY "Web/WebMVC/WebMVC.csproj" "Web/WebMVC/WebMVC.csproj"
COPY "Web/WebSPA/WebSPA.csproj" "Web/WebSPA/WebSPA.csproj"
COPY "Web/WebStatus/WebStatus.csproj" "Web/WebStatus/WebStatus.csproj"
COPY "OpenTelemetry/OpenTelemetry.Customization.csproj" "OpenTelemetry/OpenTelemetry.Customization.csproj"
COPY "docker-compose.dcproj" "docker-compose.dcproj"


+ 6
- 8
src/Services/Payment/Payment.API/Extensions/OpenTelemetryExtensions.cs View File

@ -14,6 +14,8 @@ namespace Payment.API.Extensions
public static IServiceCollection AddOpenTelemetry(this IServiceCollection services)
{
var exportType = Environment.GetEnvironmentVariable("OTEL_USE_EXPORTER")?.ToLower();
var endpoint = Environment.GetEnvironmentVariable("OTEL_EXPORTER_TOOL_ENDPOINT")?.ToLower();
if (exportType == null)
{
return services;
@ -35,16 +37,13 @@ namespace Payment.API.Extensions
{
case "jaeger":
tracerProviderBuilder.AddJaegerExporter(options =>
{
var agentHost = Environment.GetEnvironmentVariable("OTEL_EXPORTER_JAEGER_AGENTHOST");
options.AgentHost = agentHost;
{
options.AgentHost = endpoint;
});
break;
case "otlp":
tracerProviderBuilder.AddOtlpExporter(options =>
{
var endpoint = Environment.GetEnvironmentVariable("OTEL_EXPORTER_OTLP_TRACES_ENDPOINT")
?? Environment.GetEnvironmentVariable("OTEL_EXPORTER_OTLP_ENDPOINT");
{
options.Endpoint = new Uri(endpoint);
var headers = Environment.GetEnvironmentVariable("OTEL_EXPORTER_OTLP_TRACES_HEADERS")
@ -54,8 +53,7 @@ namespace Payment.API.Extensions
break;
case "zipkin":
tracerProviderBuilder.AddZipkinExporter(options =>
{
var endpoint = Environment.GetEnvironmentVariable("OTEL_EXPORTER_ZIPKIN_ENDPOINT");
{
options.Endpoint = new Uri(endpoint);
});
break;


+ 8
- 0
src/Services/Payment/Payment.API/Payment.API.csproj View File

@ -9,6 +9,13 @@
<LangVersion>preview</LangVersion>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Extensions\**" />
<Content Remove="Extensions\**" />
<EmbeddedResource Remove="Extensions\**" />
<None Remove="Extensions\**" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="AspNetCore.HealthChecks.AzureServiceBus" Version="5.0.1" />
<PackageReference Include="AspNetCore.HealthChecks.Rabbitmq" Version="5.0.1" />
@ -44,6 +51,7 @@
<ProjectReference Include="..\..\..\BuildingBlocks\EventBus\EventBusServiceBus\EventBusServiceBus.csproj" />
<ProjectReference Include="..\..\..\BuildingBlocks\EventBus\EventBus\EventBus.csproj" />
<ProjectReference Include="..\..\..\BuildingBlocks\EventBus\IntegrationEventLogEF\IntegrationEventLogEF.csproj" />
<ProjectReference Include="..\..\..\OpenTelemetry\OpenTelemetry.Customization.csproj" />
</ItemGroup>
</Project>

+ 10
- 2
src/Services/Payment/Payment.API/Startup.cs View File

@ -12,7 +12,8 @@ using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Diagnostics.HealthChecks;
using Microsoft.Extensions.Logging;
using Payment.API.Extensions;
using OpenTelemetry.Customization;
using OpenTelemetry.Customization.Extensions;
using Payment.API.IntegrationEvents.EventHandling;
using Payment.API.IntegrationEvents.Events;
using RabbitMQ.Client;
@ -32,7 +33,14 @@ 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.AddOpenTelemetry();
services.AddOpenTelemetry(new OpenTelemetryConfig()
{
ServiceName = "Payment.API",
ExportType = Configuration.GetValue<string>("OTEL_USE_EXPORTER"),
ExportToolEndpoint = Configuration.GetValue<string>("OTEL_EXPORTER_TOOL_ENDPOINT")
});
services.AddCustomHealthCheck(Configuration);
services.Configure<PaymentSettings>(Configuration);


+ 1
- 0
src/Services/Webhooks/Webhooks.API/Dockerfile View File

@ -38,6 +38,7 @@ COPY "Web/WebhookClient/WebhookClient.csproj" "Web/WebhookClient/WebhookClient.c
COPY "Web/WebMVC/WebMVC.csproj" "Web/WebMVC/WebMVC.csproj"
COPY "Web/WebSPA/WebSPA.csproj" "Web/WebSPA/WebSPA.csproj"
COPY "Web/WebStatus/WebStatus.csproj" "Web/WebStatus/WebStatus.csproj"
COPY "OpenTelemetry/OpenTelemetry.Customization.csproj" "OpenTelemetry/OpenTelemetry.Customization.csproj"
COPY "docker-compose.dcproj" "docker-compose.dcproj"


+ 9
- 0
src/Services/Webhooks/Webhooks.API/Startup.cs View File

@ -18,6 +18,8 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Diagnostics.HealthChecks;
using Microsoft.Extensions.Logging;
using Microsoft.OpenApi.Models;
using OpenTelemetry.Customization;
using OpenTelemetry.Customization.Extensions;
using RabbitMQ.Client;
using System;
using System.Collections.Generic;
@ -43,6 +45,13 @@ namespace Webhooks.API
public IServiceProvider ConfigureServices(IServiceCollection services)
{
services.AddOpenTelemetry(new OpenTelemetryConfig()
{
ServiceName = "Webhooks.API",
ExportType = Configuration.GetValue<string>("OTEL_USE_EXPORTER"),
ExportToolEndpoint = Configuration.GetValue<string>("OTEL_EXPORTER_TOOL_ENDPOINT")
});
services
.AddAppInsight(Configuration)
.AddCustomRouting(Configuration)


+ 1
- 0
src/Services/Webhooks/Webhooks.API/Webhooks.API.csproj View File

@ -31,6 +31,7 @@
<ProjectReference Include="..\..\..\BuildingBlocks\EventBus\EventBus\EventBus.csproj" />
<ProjectReference Include="..\..\..\BuildingBlocks\EventBus\IntegrationEventLogEF\IntegrationEventLogEF.csproj" />
<ProjectReference Include="..\..\..\BuildingBlocks\WebHostCustomization\WebHost.Customization\WebHost.Customization.csproj" />
<ProjectReference Include="..\..\..\OpenTelemetry\OpenTelemetry.Customization.csproj" />
</ItemGroup>
</Project>

+ 1
- 0
src/Web/WebMVC/Dockerfile View File

@ -38,6 +38,7 @@ COPY "Web/WebhookClient/WebhookClient.csproj" "Web/WebhookClient/WebhookClient.c
COPY "Web/WebMVC/WebMVC.csproj" "Web/WebMVC/WebMVC.csproj"
COPY "Web/WebSPA/WebSPA.csproj" "Web/WebSPA/WebSPA.csproj"
COPY "Web/WebStatus/WebStatus.csproj" "Web/WebStatus/WebStatus.csproj"
COPY "OpenTelemetry/OpenTelemetry.Customization.csproj" "OpenTelemetry/OpenTelemetry.Customization.csproj"
COPY "docker-compose.dcproj" "docker-compose.dcproj"


+ 10
- 2
src/Web/WebMVC/Startup.cs View File

@ -15,6 +15,8 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Diagnostics.HealthChecks;
using Microsoft.Extensions.Hosting;
using Microsoft.IdentityModel.Logging;
using OpenTelemetry.Customization;
using OpenTelemetry.Customization.Extensions;
using StackExchange.Redis;
using System;
using System.IdentityModel.Tokens.Jwt;
@ -36,13 +38,19 @@ namespace Microsoft.eShopOnContainers.WebMVC
{
services.AddControllersWithViews()
.Services
.AddAppInsight(Configuration)
.AddOpenTelemetry()
.AddAppInsight(Configuration)
.AddHealthChecks(Configuration)
.AddCustomMvc(Configuration)
.AddDevspaces()
.AddHttpClientServices(Configuration);
services.AddOpenTelemetry(new OpenTelemetryConfig()
{
ServiceName = "WebMVC",
ExportType = Configuration.GetValue<string>("OTEL_USE_EXPORTER"),
ExportToolEndpoint = Configuration.GetValue<string>("OTEL_EXPORTER_TOOL_ENDPOINT")
});
IdentityModelEventSource.ShowPII = true; // Caution! Do NOT use in production: https://aka.ms/IdentityModel/PII
services.AddControllers();


+ 5
- 0
src/Web/WebMVC/WebMVC.csproj View File

@ -10,6 +10,10 @@
<LangVersion>preview</LangVersion>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Extensions\OpenTelemetryExtensions.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="Setup\images.zip">
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
@ -61,6 +65,7 @@
<ItemGroup>
<ProjectReference Include="..\..\BuildingBlocks\Devspaces.Support\Devspaces.Support.csproj" />
<ProjectReference Include="..\..\OpenTelemetry\OpenTelemetry.Customization.csproj" />
</ItemGroup>
</Project>

+ 1
- 0
src/Web/WebSPA/Dockerfile View File

@ -46,6 +46,7 @@ COPY "Web/WebhookClient/WebhookClient.csproj" "Web/WebhookClient/WebhookClient.c
COPY "Web/WebMVC/WebMVC.csproj" "Web/WebMVC/WebMVC.csproj"
COPY "Web/WebSPA/WebSPA.csproj" "Web/WebSPA/WebSPA.csproj"
COPY "Web/WebStatus/WebStatus.csproj" "Web/WebStatus/WebStatus.csproj"
COPY "OpenTelemetry/OpenTelemetry.Customization.csproj" "OpenTelemetry/OpenTelemetry.Customization.csproj"
COPY "docker-compose.dcproj" "docker-compose.dcproj"


+ 9
- 2
src/Web/WebSPA/Startup.cs View File

@ -10,10 +10,11 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Diagnostics.HealthChecks;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using OpenTelemetry.Customization;
using OpenTelemetry.Customization.Extensions;
using StackExchange.Redis;
using System;
using System.IO;
using WebSPA.Extensions;
using WebSPA.Infrastructure;
namespace eShopConContainers.WebSPA
@ -39,7 +40,13 @@ namespace eShopConContainers.WebSPA
{
RegisterAppInsights(services);
services.AddOpenTelemetry();
services.AddOpenTelemetry(new OpenTelemetryConfig()
{
ServiceName = "WebSPA",
ExportType = Configuration.GetValue<string>("OTEL_USE_EXPORTER"),
ExportToolEndpoint = Configuration.GetValue<string>("OTEL_EXPORTER_TOOL_ENDPOINT")
});
services.AddHealthChecks()
.AddCheck("self", () => HealthCheckResult.Healthy())
.AddUrlGroup(new Uri(Configuration["IdentityUrlHC"]), name: "identityapi-check", tags: new string[] { "identityapi" });


+ 7
- 0
src/Web/WebSPA/WebSPA.csproj View File

@ -14,7 +14,11 @@
</PropertyGroup>
<ItemGroup>
<Compile Remove="Extensions\**" />
<Compile Remove="node_modules\**\*;Client\**\*" />
<Content Remove="Extensions\**" />
<EmbeddedResource Remove="Extensions\**" />
<None Remove="Extensions\**" />
<None Remove="Client\environments\environment.prod.ts" />
<None Remove="Client\environments\environment.ts" />
<None Remove="Client\guid.ts" />
@ -114,6 +118,9 @@
<ItemGroup>
<Folder Include="wwwroot\assets\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\OpenTelemetry\OpenTelemetry.Customization.csproj" />
</ItemGroup>
<ItemGroup>
<TypeScriptCompile Include="Client\environments\environment.prod.ts" />


+ 1
- 0
src/Web/WebStatus/Dockerfile View File

@ -38,6 +38,7 @@ COPY "Web/WebhookClient/WebhookClient.csproj" "Web/WebhookClient/WebhookClient.c
COPY "Web/WebMVC/WebMVC.csproj" "Web/WebMVC/WebMVC.csproj"
COPY "Web/WebSPA/WebSPA.csproj" "Web/WebSPA/WebSPA.csproj"
COPY "Web/WebStatus/WebStatus.csproj" "Web/WebStatus/WebStatus.csproj"
COPY "OpenTelemetry/OpenTelemetry.Customization.csproj" "OpenTelemetry/OpenTelemetry.Customization.csproj"
COPY "docker-compose.dcproj" "docker-compose.dcproj"


+ 1
- 0
src/Web/WebhookClient/Dockerfile View File

@ -39,6 +39,7 @@ COPY "Web/WebhookClient/WebhookClient.csproj" "Web/WebhookClient/WebhookClient.c
COPY "Web/WebMVC/WebMVC.csproj" "Web/WebMVC/WebMVC.csproj"
COPY "Web/WebSPA/WebSPA.csproj" "Web/WebSPA/WebSPA.csproj"
COPY "Web/WebStatus/WebStatus.csproj" "Web/WebStatus/WebStatus.csproj"
COPY "OpenTelemetry/OpenTelemetry.Customization.csproj" "OpenTelemetry/OpenTelemetry.Customization.csproj"
COPY "docker-compose.dcproj" "docker-compose.dcproj"


+ 7
- 7
src/docker-compose.opentelemetry.jaeger.yml View File

@ -21,34 +21,34 @@ services:
identity-api:
environment:
- OTEL_USE_EXPORTER=jaeger
- OTEL_EXPORTER_JAEGER_AGENTHOST=${OTEL_EXPORTER_JAEGER_AGENTHOST:-jaeger-all-in-one}
- OTEL_EXPORTER_TOOL_ENDPOINT=${OTEL_EXPORTER_TOOL_ENDPOINT:-jaeger-all-in-one}
basket-api:
environment:
- OTEL_USE_EXPORTER=jaeger
- OTEL_EXPORTER_JAEGER_AGENTHOST=${OTEL_EXPORTER_JAEGER_AGENTHOST:-jaeger-all-in-one}
- OTEL_EXPORTER_TOOL_ENDPOINT=${OTEL_EXPORTER_TOOL_ENDPOINT:-jaeger-all-in-one}
catalog-api:
environment:
- OTEL_USE_EXPORTER=jaeger
- OTEL_EXPORTER_JAEGER_AGENTHOST=${OTEL_EXPORTER_JAEGER_AGENTHOST:-jaeger-all-in-one}
- OTEL_EXPORTER_TOOL_ENDPOINT=${OTEL_EXPORTER_TOOL_ENDPOINT:-jaeger-all-in-one}
ordering-api:
environment:
- OTEL_USE_EXPORTER=jaeger
- OTEL_EXPORTER_JAEGER_AGENTHOST=${OTEL_EXPORTER_JAEGER_AGENTHOST:-jaeger-all-in-one}
- OTEL_EXPORTER_TOOL_ENDPOINT=${OTEL_EXPORTER_TOOL_ENDPOINT:-jaeger-all-in-one}
payment-api:
environment:
- OTEL_USE_EXPORTER=jaeger
- OTEL_EXPORTER_JAEGER_AGENTHOST=${OTEL_EXPORTER_JAEGER_AGENTHOST:-jaeger-all-in-one}
- OTEL_EXPORTER_TOOL_ENDPOINT=${OTEL_EXPORTER_TOOL_ENDPOINT:-jaeger-all-in-one}
webmvc:
environment:
- OTEL_USE_EXPORTER=jaeger
- OTEL_EXPORTER_JAEGER_AGENTHOST=${OTEL_EXPORTER_JAEGER_AGENTHOST:-jaeger-all-in-one}
- OTEL_EXPORTER_TOOL_ENDPOINT=${OTEL_EXPORTER_TOOL_ENDPOINT:-jaeger-all-in-one}
webspa:
environment:
- OTEL_USE_EXPORTER=jaeger
- OTEL_EXPORTER_JAEGER_AGENTHOST=${OTEL_EXPORTER_JAEGER_AGENTHOST:-jaeger-all-in-one}
- OTEL_EXPORTER_TOOL_ENDPOINT=${OTEL_EXPORTER_TOOL_ENDPOINT:-jaeger-all-in-one}

+ 3
- 3
src/docker-compose.opentelemetry.otlp.yml View File

@ -17,17 +17,17 @@ services:
basket-api:
environment:
- OTEL_USE_EXPORTER=otlp
- OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=${OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:-http://otel-collector:4317}
- OTEL_EXPORTER_TOOL_ENDPOINT=${OTEL_EXPORTER_TOOL_ENDPOINT:-http://otel-collector:4317}
- OTEL_EXPORTER_OTLP_HEADERS=${OTEL_EXPORTER_OTLP_HEADERS}
catalog-api:
environment:
- OTEL_USE_EXPORTER=otlp
- OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=${OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:-http://otel-collector:4317}
- OTEL_EXPORTER_TOOL_ENDPOINT=${OTEL_EXPORTER_TOOL_ENDPOINT:-http://otel-collector:4317}
- OTEL_EXPORTER_OTLP_HEADERS=${OTEL_EXPORTER_OTLP_HEADERS}
webmvc:
environment:
- OTEL_USE_EXPORTER=otlp
- OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=${OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:-http://otel-collector:4317}
- OTEL_EXPORTER_TOOL_ENDPOINT=${OTEL_EXPORTER_TOOL_ENDPOINT:-http://otel-collector:4317}
- OTEL_EXPORTER_OTLP_HEADERS=${OTEL_EXPORTER_OTLP_HEADERS}

+ 13
- 8
src/docker-compose.opentelemetry.zipkin.yml View File

@ -14,34 +14,39 @@ services:
identity-api:
environment:
- OTEL_USE_EXPORTER=zipkin
- OTEL_EXPORTER_ZIPKIN_ENDPOINT=${OTEL_EXPORTER_ZIPKIN_ENDPOINT:-http://zipkin:9411/api/v2/spans}
- OTEL_EXPORTER_TOOL_ENDPOINT=${OTEL_EXPORTER_TOOL_ENDPOINT:-http://zipkin:9411/api/v2/spans}
basket-api:
environment:
- OTEL_USE_EXPORTER=zipkin
- OTEL_EXPORTER_ZIPKIN_ENDPOINT=${OTEL_EXPORTER_ZIPKIN_ENDPOINT:-http://zipkin:9411/api/v2/spans}
- OTEL_EXPORTER_TOOL_ENDPOINT=${OTEL_EXPORTER_TOOL_ENDPOINT:-http://zipkin:9411/api/v2/spans}
catalog-api:
environment:
- OTEL_USE_EXPORTER=zipkin
- OTEL_EXPORTER_ZIPKIN_ENDPOINT=${OTEL_EXPORTER_ZIPKIN_ENDPOINT:-http://zipkin:9411/api/v2/spans}
- OTEL_EXPORTER_TOOL_ENDPOINT=${OTEL_EXPORTER_TOOL_ENDPOINT:-http://zipkin:9411/api/v2/spans}
ordering-api:
environment:
- OTEL_USE_EXPORTER=zipkin
- OTEL_EXPORTER_ZIPKIN_ENDPOINT=${OTEL_EXPORTER_ZIPKIN_ENDPOINT:-http://zipkin:9411/api/v2/spans}
- OTEL_EXPORTER_TOOL_ENDPOINT=${OTEL_EXPORTER_TOOL_ENDPOINT:-http://zipkin:9411/api/v2/spans}
payment-api:
environment:
- OTEL_USE_EXPORTER=zipkin
- OTEL_EXPORTER_ZIPKIN_ENDPOINT=${OTEL_EXPORTER_ZIPKIN_ENDPOINT:-http://zipkin:9411/api/v2/spans}
- OTEL_EXPORTER_TOOL_ENDPOINT=${OTEL_EXPORTER_TOOL_ENDPOINT:-http://zipkin:9411/api/v2/spans}
webhooks-api:
environment:
- OTEL_USE_EXPORTER=zipkin
- OTEL_EXPORTER_TOOL_ENDPOINT=${OTEL_EXPORTER_TOOL_ENDPOINT:-http://zipkin:9411/api/v2/spans}
webmvc:
environment:
- OTEL_USE_EXPORTER=zipkin
- OTEL_EXPORTER_ZIPKIN_ENDPOINT=${OTEL_EXPORTER_ZIPKIN_ENDPOINT:-http://zipkin:9411/api/v2/spans}
- OTEL_EXPORTER_TOOL_ENDPOINT=${OTEL_EXPORTER_TOOL_ENDPOINT:-http://zipkin:9411/api/v2/spans}
webspa:
environment:
- OTEL_USE_EXPORTER=zipkin
- OTEL_EXPORTER_ZIPKIN_ENDPOINT=${OTEL_EXPORTER_ZIPKIN_ENDPOINT:-http://zipkin:9411/api/v2/spans}
- OTEL_EXPORTER_TOOL_ENDPOINT=${OTEL_EXPORTER_TOOL_ENDPOINT:-http://zipkin:9411/api/v2/spans}

+ 54
- 0
src/eShopOnContainers-ServicesAndWebApps.sln View File

@ -120,6 +120,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Mobile.Bff.Shopping", "Mobi
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mobile.Shopping.HttpAggregator", "ApiGateways\Mobile.Bff.Shopping\aggregator\Mobile.Shopping.HttpAggregator.csproj", "{B62E859F-825E-4C8B-93EC-5966EACFD026}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "OpenTelemetry", "OpenTelemetry", "{D366A1A3-E0BC-4469-95B0-316AE3EF61D5}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.Customization", "OpenTelemetry\OpenTelemetry.Customization.csproj", "{AF60A41F-478A-4DAB-9B7F-8D1BBFCD32BC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Ad-Hoc|Any CPU = Ad-Hoc|Any CPU
@ -1478,6 +1482,54 @@ Global
{B62E859F-825E-4C8B-93EC-5966EACFD026}.Release|x64.Build.0 = Release|Any CPU
{B62E859F-825E-4C8B-93EC-5966EACFD026}.Release|x86.ActiveCfg = Release|Any CPU
{B62E859F-825E-4C8B-93EC-5966EACFD026}.Release|x86.Build.0 = Release|Any CPU
{AF60A41F-478A-4DAB-9B7F-8D1BBFCD32BC}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU
{AF60A41F-478A-4DAB-9B7F-8D1BBFCD32BC}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU
{AF60A41F-478A-4DAB-9B7F-8D1BBFCD32BC}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU
{AF60A41F-478A-4DAB-9B7F-8D1BBFCD32BC}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU
{AF60A41F-478A-4DAB-9B7F-8D1BBFCD32BC}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU
{AF60A41F-478A-4DAB-9B7F-8D1BBFCD32BC}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU
{AF60A41F-478A-4DAB-9B7F-8D1BBFCD32BC}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{AF60A41F-478A-4DAB-9B7F-8D1BBFCD32BC}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU
{AF60A41F-478A-4DAB-9B7F-8D1BBFCD32BC}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU
{AF60A41F-478A-4DAB-9B7F-8D1BBFCD32BC}.Ad-Hoc|x64.Build.0 = Debug|Any CPU
{AF60A41F-478A-4DAB-9B7F-8D1BBFCD32BC}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU
{AF60A41F-478A-4DAB-9B7F-8D1BBFCD32BC}.Ad-Hoc|x86.Build.0 = Debug|Any CPU
{AF60A41F-478A-4DAB-9B7F-8D1BBFCD32BC}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU
{AF60A41F-478A-4DAB-9B7F-8D1BBFCD32BC}.AppStore|Any CPU.Build.0 = Debug|Any CPU
{AF60A41F-478A-4DAB-9B7F-8D1BBFCD32BC}.AppStore|ARM.ActiveCfg = Debug|Any CPU
{AF60A41F-478A-4DAB-9B7F-8D1BBFCD32BC}.AppStore|ARM.Build.0 = Debug|Any CPU
{AF60A41F-478A-4DAB-9B7F-8D1BBFCD32BC}.AppStore|iPhone.ActiveCfg = Debug|Any CPU
{AF60A41F-478A-4DAB-9B7F-8D1BBFCD32BC}.AppStore|iPhone.Build.0 = Debug|Any CPU
{AF60A41F-478A-4DAB-9B7F-8D1BBFCD32BC}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{AF60A41F-478A-4DAB-9B7F-8D1BBFCD32BC}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU
{AF60A41F-478A-4DAB-9B7F-8D1BBFCD32BC}.AppStore|x64.ActiveCfg = Debug|Any CPU
{AF60A41F-478A-4DAB-9B7F-8D1BBFCD32BC}.AppStore|x64.Build.0 = Debug|Any CPU
{AF60A41F-478A-4DAB-9B7F-8D1BBFCD32BC}.AppStore|x86.ActiveCfg = Debug|Any CPU
{AF60A41F-478A-4DAB-9B7F-8D1BBFCD32BC}.AppStore|x86.Build.0 = Debug|Any CPU
{AF60A41F-478A-4DAB-9B7F-8D1BBFCD32BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AF60A41F-478A-4DAB-9B7F-8D1BBFCD32BC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AF60A41F-478A-4DAB-9B7F-8D1BBFCD32BC}.Debug|ARM.ActiveCfg = Debug|Any CPU
{AF60A41F-478A-4DAB-9B7F-8D1BBFCD32BC}.Debug|ARM.Build.0 = Debug|Any CPU
{AF60A41F-478A-4DAB-9B7F-8D1BBFCD32BC}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{AF60A41F-478A-4DAB-9B7F-8D1BBFCD32BC}.Debug|iPhone.Build.0 = Debug|Any CPU
{AF60A41F-478A-4DAB-9B7F-8D1BBFCD32BC}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{AF60A41F-478A-4DAB-9B7F-8D1BBFCD32BC}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{AF60A41F-478A-4DAB-9B7F-8D1BBFCD32BC}.Debug|x64.ActiveCfg = Debug|Any CPU
{AF60A41F-478A-4DAB-9B7F-8D1BBFCD32BC}.Debug|x64.Build.0 = Debug|Any CPU
{AF60A41F-478A-4DAB-9B7F-8D1BBFCD32BC}.Debug|x86.ActiveCfg = Debug|Any CPU
{AF60A41F-478A-4DAB-9B7F-8D1BBFCD32BC}.Debug|x86.Build.0 = Debug|Any CPU
{AF60A41F-478A-4DAB-9B7F-8D1BBFCD32BC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AF60A41F-478A-4DAB-9B7F-8D1BBFCD32BC}.Release|Any CPU.Build.0 = Release|Any CPU
{AF60A41F-478A-4DAB-9B7F-8D1BBFCD32BC}.Release|ARM.ActiveCfg = Release|Any CPU
{AF60A41F-478A-4DAB-9B7F-8D1BBFCD32BC}.Release|ARM.Build.0 = Release|Any CPU
{AF60A41F-478A-4DAB-9B7F-8D1BBFCD32BC}.Release|iPhone.ActiveCfg = Release|Any CPU
{AF60A41F-478A-4DAB-9B7F-8D1BBFCD32BC}.Release|iPhone.Build.0 = Release|Any CPU
{AF60A41F-478A-4DAB-9B7F-8D1BBFCD32BC}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{AF60A41F-478A-4DAB-9B7F-8D1BBFCD32BC}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{AF60A41F-478A-4DAB-9B7F-8D1BBFCD32BC}.Release|x64.ActiveCfg = Release|Any CPU
{AF60A41F-478A-4DAB-9B7F-8D1BBFCD32BC}.Release|x64.Build.0 = Release|Any CPU
{AF60A41F-478A-4DAB-9B7F-8D1BBFCD32BC}.Release|x86.ActiveCfg = Release|Any CPU
{AF60A41F-478A-4DAB-9B7F-8D1BBFCD32BC}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -1534,6 +1586,8 @@ Global
{966B1B0B-2AE0-4438-8741-1C5A05556095} = {3ABEEE8C-35E0-4185-9825-C44326151F5B}
{798BFC44-2CCD-45FA-B37A-5173B03C2B30} = {77849D35-37D4-4802-81DC-9477B2775A40}
{B62E859F-825E-4C8B-93EC-5966EACFD026} = {798BFC44-2CCD-45FA-B37A-5173B03C2B30}
{D366A1A3-E0BC-4469-95B0-316AE3EF61D5} = {932D8224-11F6-4D07-B109-DA28AD288A63}
{AF60A41F-478A-4DAB-9B7F-8D1BBFCD32BC} = {D366A1A3-E0BC-4469-95B0-316AE3EF61D5}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {25728519-5F0F-4973-8A64-0A81EB4EA8D9}


Loading…
Cancel
Save