Skip to content

Commit 51ac3a5

Browse files
authored
feat(templates): add WithOtlpExporter() to infrastructure resources in AppHost bitfoundation#12336 (bitfoundation#12337)
1 parent aa89337 commit 51ac3a5

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

  • src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.AppHost

src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.AppHost/Program.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//+:cnd:noEmit
1+
//+:cnd:noEmit
22
using Microsoft.Extensions.Hosting;
33

44
var builder = DistributedApplication.CreateBuilder(args);
@@ -8,11 +8,13 @@
88
//#if(redis == true)
99
// Redis cache for FusionCache hybrid caching (L2 cache) and SignalR backplane - no persistence needed
1010
var redisCache = builder.AddRedis("redis-cache")
11+
.WithOtlpExporter()
1112
.WithRedisInsight()
1213
.WithRedisCommander();
1314

1415
// Redis for Hangfire background jobs, and distributed locking - persistent with AOF for durability
1516
var redisPersistent = builder.AddRedis("redis-persistent")
17+
.WithOtlpExporter()
1618
.WithRedisInsight()
1719
.WithRedisCommander()
1820
.WithDataVolume()
@@ -26,13 +28,15 @@
2628

2729
//#if (database == "SqlServer")
2830
var sqlDatabase = builder.AddSqlServer("sqlserver")
31+
.WithOtlpExporter()
2932
.WithDbGate(config => config.WithDataVolume())
3033
.WithDataVolume()
3134
.WithImage("mssql/server", "2025-latest")
3235
.AddDatabase("mssqldb"); // Sql server 2025 supports embedded vector search.
3336

3437
//#elif (database == "PostgreSql")
3538
var postgresDatabase = builder.AddPostgres("postgresserver")
39+
.WithOtlpExporter()
3640
.WithPgAdmin()
3741
.WithV18DataVolume()
3842
.WithOptimizedSetup()
@@ -41,6 +45,7 @@
4145

4246
//#elif (database == "MySql")
4347
var mySqlDatabase = builder.AddMySql("mysqlserver")
48+
.WithOtlpExporter()
4449
.WithPhpMyAdmin()
4550
.WithDataVolume()
4651
.AddDatabase("mysqldb");
@@ -59,11 +64,13 @@
5964

6065
//#elif (filesStorage == "S3")
6166
var s3Storage = builder.AddMinioContainer("s3")
67+
.WithOtlpExporter()
6268
.WithDataVolume();
6369
//#endif
6470

6571
// https://aspire.dev/integrations/security/keycloak/
6672
var keycloak = builder.AddKeycloak("keycloak", 8080)
73+
.WithOtlpExporter()
6774
.WithDataVolume()
6875
.WithRealmImport("./Infrastructure/Realms");
6976

0 commit comments

Comments
 (0)