Skip to content

Commit 344ce93

Browse files
committed
chore: update profiling configuration
1 parent 31a0e19 commit 344ce93

4 files changed

Lines changed: 22 additions & 7 deletions

File tree

docker-compose.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,10 @@ services:
342342
DD_TRACE_OTEL_ENABLED: "true"
343343
DD_LOGS_INJECTION: "true"
344344
DD_RUNTIME_METRICS_ENABLED: "true"
345-
# The .NET profile does not support ARM64, this won't work if running on Apple Silicon Macs
345+
# The .NET profiler does not support ARM64, this won't work if running on Apple Silicon Macs
346346
DD_PROFILING_ENABLED: "true"
347+
# Required for Datadog .NET Continuous Profiler (x64 only)
348+
LD_PRELOAD: /opt/datadog/linux-x64/Datadog.Linux.ApiWrapper.x64.so
347349
# Application configuration
348350
ASPNETCORE_ENVIRONMENT: Development
349351
DRIVING: AGNOSTIC
@@ -389,8 +391,10 @@ services:
389391
DD_TRACE_OTEL_ENABLED: "true"
390392
DD_LOGS_INJECTION: "true"
391393
DD_RUNTIME_METRICS_ENABLED: "true"
392-
# The .NET profile does not support ARM64, this won't work if running on Apple Silicon Macs
394+
# The .NET profiler does not support ARM64, this won't work if running on Apple Silicon Macs
393395
DD_PROFILING_ENABLED: "true"
396+
# Required for Datadog .NET Continuous Profiler (x64 only)
397+
LD_PRELOAD: /opt/datadog/linux-x64/Datadog.Linux.ApiWrapper.x64.so
394398
ASPNETCORE_ENVIRONMENT: Development
395399
DRIVING: AGNOSTIC
396400
DRIVEN: AGNOSTIC
@@ -418,8 +422,10 @@ services:
418422
DD_TRACE_OTEL_ENABLED: "true"
419423
DD_LOGS_INJECTION: "true"
420424
DD_RUNTIME_METRICS_ENABLED: "true"
421-
# The .NET profile does not support ARM64, this won't work if running on Apple Silicon Macs
425+
# The .NET profiler does not support ARM64, this won't work if running on Apple Silicon Macs
422426
DD_PROFILING_ENABLED: "true"
427+
# Required for Datadog .NET Continuous Profiler (x64 only)
428+
LD_PRELOAD: /opt/datadog/linux-x64/Datadog.Linux.ApiWrapper.x64.so
423429
ASPNETCORE_ENVIRONMENT: Development
424430
DRIVING: AGNOSTIC
425431
DRIVEN: AGNOSTIC

user-management/infra/aws/lib/api.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ export class Api extends Construct {
7171
DD_LOGS_INJECTION: "true",
7272
DD_RUNTIME_METRICS_ENABLED: "true",
7373
DD_PROFILING_ENABLED: "true",
74+
// Required for Datadog .NET Continuous Profiler
75+
LD_PRELOAD: "/opt/datadog/linux-x64/Datadog.Linux.ApiWrapper.x64.so",
7476
DEPLOYMENT_HOST_URL: `https://${props.serviceProps.cloudfrontDistribution.distributionDomainName}`,
7577
DRIVING: "ASPNET",
7678
DRIVEN: "AWS",

user-management/infra/aws/lib/background-workers.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,9 @@ export class BackgroundWorkers extends Construct {
187187
DD_LOGS_INJECTION: "true",
188188
DD_RUNTIME_METRICS_ENABLED: "true",
189189
DD_PROFILING_ENABLED: "true",
190+
// Required for Datadog .NET Continuous Profiler
191+
LD_PRELOAD:
192+
"/opt/datadog/linux-x64/Datadog.Linux.ApiWrapper.x64.so",
190193
POWERTOOLS_SERVICE_NAME: props.sharedProps.serviceName,
191194
POWERTOOLS_LOG_LEVEL:
192195
props.sharedProps.environment === "prod" ? "WARN" : "INFO",
@@ -202,20 +205,22 @@ export class BackgroundWorkers extends Construct {
202205
},
203206
secrets: {
204207
DD_API_KEY: Secret.fromSsmParameter(
205-
props.sharedProps.datadog.apiKeyParameter
208+
props.sharedProps.datadog.apiKeyParameter,
206209
),
207-
ConnectionStrings__database: props.serviceProps.databaseCredentials.getConnectionStringEcsSecret()!,
210+
ConnectionStrings__database:
211+
props.serviceProps.databaseCredentials.getConnectionStringEcsSecret()!,
208212
...props.serviceProps.messagingConfiguration.asSecrets(),
209213
},
210214
serviceDiscoveryNamespace: props.serviceDiscoveryNamespace,
211215
serviceDiscoveryName: props.serviceDiscoveryName,
212216
deployInPrivateSubnet: props.deployInPrivateSubnet,
217+
// .NET profiler only works in x86.
213218
runtimePlatform: {
214-
cpuArchitecture: CpuArchitecture.ARM64,
219+
cpuArchitecture: CpuArchitecture.X86_64,
215220
operatingSystemFamily: OperatingSystemFamily.LINUX,
216221
},
217222
serviceDependencies: props.serviceProps.serviceDependencies,
218-
}
223+
},
219224
);
220225
}
221226
}

user-management/infra/aws/lib/user-service-stack.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ export class UserServiceStack extends cdk.Stack {
8484
DD_LOGS_INJECTION: "true",
8585
DD_RUNTIME_METRICS_ENABLED: "true",
8686
DD_PROFILING_ENABLED: "true",
87+
// Required for Datadog .NET Continuous Profiler
88+
LD_PRELOAD: "/opt/datadog/linux-x64/Datadog.Linux.ApiWrapper.x64.so",
8789
DEPLOYMENT_HOST_URL: `https://${sharedResources.cloudfrontDistribution.distributionDomainName}`,
8890
DRIVING: "ASPNET",
8991
DRIVEN: "AWS",

0 commit comments

Comments
 (0)