Interface InstrumentationProps
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
InstrumentationProps.Jsii$Proxy
@Generated(value="jsii-pacmak/1.116.0 (build 0eddcff)",
date="2025-10-24T13:34:49.529Z")
@Stability(Experimental)
public interface InstrumentationProps
extends software.amazon.jsii.JsiiSerializable
(experimental) Interface for instrumentation properties.
Example:
import software.constructs.Construct;
import software.amazon.awscdk.services.applicationsignals.alpha.*;
import software.amazon.awscdk.*;
import software.amazon.awscdk.services.ec2.*;
import software.amazon.awscdk.services.ecs.*;
public class MyStack extends Stack {
public MyStack() {
this(null);
}
public MyStack(Construct scope) {
this(scope, null);
}
public MyStack(Construct scope, String id) {
this(scope, id, StackProps.builder().build());
}
public MyStack(Construct scope, String id, StackProps props) {
super(scope, id, props);
Vpc vpc = Vpc.Builder.create(this, "TestVpc").build();
Cluster cluster = Cluster.Builder.create(this, "TestCluster").vpc(vpc).build();
// Define Task Definition for CloudWatch agent (Daemon)
Ec2TaskDefinition cwAgentTaskDefinition = Ec2TaskDefinition.Builder.create(this, "CloudWatchAgentTaskDefinition")
.networkMode(NetworkMode.HOST)
.build();
CloudWatchAgentIntegration.Builder.create(this, "CloudWatchAgentIntegration")
.taskDefinition(cwAgentTaskDefinition)
.containerName("ecs-cwagent")
.enableLogging(false)
.cpu(128)
.memoryLimitMiB(64)
.portMappings(List.of(PortMapping.builder()
.containerPort(4316)
.hostPort(4316)
.build(), PortMapping.builder()
.containerPort(2000)
.hostPort(2000)
.build()))
.build();
// Create the CloudWatch Agent daemon service
// Create the CloudWatch Agent daemon service
Ec2Service.Builder.create(this, "CloudWatchAgentDaemon")
.cluster(cluster)
.taskDefinition(cwAgentTaskDefinition)
.daemon(true)
.build();
// Define Task Definition for user application
Ec2TaskDefinition sampleAppTaskDefinition = Ec2TaskDefinition.Builder.create(this, "SampleAppTaskDefinition")
.networkMode(NetworkMode.HOST)
.build();
sampleAppTaskDefinition.addContainer("app", ContainerDefinitionOptions.builder()
.image(ContainerImage.fromRegistry("test/sample-app"))
.cpu(0)
.memoryLimitMiB(512)
.build());
// No CloudWatch Agent side car is needed as application container communicates to CloudWatch Agent daemon through host network
// No CloudWatch Agent side car is needed as application container communicates to CloudWatch Agent daemon through host network
ApplicationSignalsIntegration.Builder.create(this, "ApplicationSignalsIntegration")
.taskDefinition(sampleAppTaskDefinition)
.instrumentation(InstrumentationProps.builder()
.sdkVersion(PythonInstrumentationVersion.V0_8_0)
.build())
.serviceName("sample-app")
.build();
Ec2Service.Builder.create(this, "MySampleApp")
.cluster(cluster)
.taskDefinition(sampleAppTaskDefinition)
.desiredCount(1)
.build();
}
}
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forInstrumentationPropsstatic final classAn implementation forInstrumentationProps -
Method Summary
Modifier and TypeMethodDescriptionstatic InstrumentationProps.Builderbuilder()default RuntimePlatform(experimental) The runtime platform of the instrumentation.(experimental) The version of the instrumentation.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getSdkVersion
(experimental) The version of the instrumentation. -
getRuntimePlatform
(experimental) The runtime platform of the instrumentation.Default: - the runtime platform specified through the input TaskDefinition.
-
builder
- Returns:
- a
InstrumentationProps.BuilderofInstrumentationProps
-