Skip to content

Commit ff066a8

Browse files
authored
Merge pull request #117 from arielb1/tombstone-fargate-cpu-count
make __unstable-fargate-cpu-count always on
2 parents 20c5c22 + a3e6fd4 commit ff066a8

File tree

5 files changed

+5
-20
lines changed

5 files changed

+5
-20
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ s3-no-defaults = ["dep:aws-config", "dep:aws-sdk-s3"]
5050
aws-metadata = ["aws-metadata-no-defaults", "aws-config/default", "reqwest/rustls-tls"]
5151
# A version of the aws-metadata feature that does not enable AWS default features
5252
aws-metadata-no-defaults = ["dep:reqwest", "dep:aws-config", "dep:aws-arn"]
53-
# *Unstable* feature to allow Fargate CPU count. The feature will be stabilized
54-
# and removed soon.
53+
# Tombstone feature for __unstable-fargate-cpu-count. This feature can no
54+
# longer be disabled.
5555
__unstable-fargate-cpu-count = []
5656

5757
[package.metadata.docs.rs]

DESIGN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,4 +246,4 @@ than the default one and not have the default backend linked in to their executa
246246
- `s3-no-defaults`: S3 reporter without default features (for custom TLS)
247247
- `aws-metadata`: AWS metadata detection with default features
248248
- `aws-metadata-no-defaults`: AWS metadata without default features
249-
- `__unstable-fargate-cpu-count`: Experimental Fargate CPU metrics
249+
- `__unstable-fargate-cpu-count`: Tombstone for experimental Fargate CPU metrics

src/metadata/aws.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ impl super::AgentMetadata {
140140
aws_account_id: imds_ec2_instance_metadata.account_id,
141141
aws_region_id: imds_ec2_instance_metadata.region,
142142
ec2_instance_id: imds_ec2_instance_metadata.instance_id,
143-
#[cfg(feature = "__unstable-fargate-cpu-count")]
144143
ec2_instance_type: imds_ec2_instance_metadata.instance_type,
145144
}
146145
}
@@ -161,12 +160,10 @@ impl super::AgentMetadata {
161160
.to_string(),
162161
ecs_task_arn: fargate_metadata.task_arn,
163162
ecs_cluster_arn: fargate_metadata.cluster,
164-
#[cfg(feature = "__unstable-fargate-cpu-count")]
165163
cpu_limit: fargate_metadata
166164
.limits
167165
.as_ref()
168166
.and_then(|limits| limits.cpu),
169-
#[cfg(feature = "__unstable-fargate-cpu-count")]
170167
memory_limit: fargate_metadata
171168
.limits
172169
.as_ref()
@@ -397,9 +394,7 @@ mod tests {
397394
aws_region_id: "us-east-1".to_owned(),
398395
ecs_task_arn: "arn:aws:ecs:us-east-1:123456789012:task/profiler-metadata-cluster/5261e761e0e2a3d92da3f02c8e5bab1f".to_owned(),
399396
ecs_cluster_arn: "arn:aws:ecs:us-east-1:123456789012:cluster/profiler-metadata-cluster".to_owned(),
400-
#[cfg(feature = "__unstable-fargate-cpu-count")]
401397
cpu_limit: _expected_cpu_limit,
402-
#[cfg(feature = "__unstable-fargate-cpu-count")]
403398
memory_limit: _expected_memory_limit,
404399
}
405400
)

src/metadata/mod.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,22 +43,21 @@ pub enum AgentMetadata {
4343
/// Metadata for an [EC2] instance running on AWS
4444
///
4545
/// [EC2]: https://aws.amazon.com/ec2
46-
#[cfg_attr(feature = "__unstable-fargate-cpu-count", non_exhaustive)]
46+
#[non_exhaustive]
4747
Ec2AgentMetadata {
4848
/// The AWS account id
4949
aws_account_id: String,
5050
/// The AWS region id
5151
aws_region_id: String,
5252
/// The EC2 instance id
5353
ec2_instance_id: String,
54-
#[cfg(feature = "__unstable-fargate-cpu-count")]
5554
/// The EC2 instance type
5655
ec2_instance_type: String,
5756
},
5857
/// Metadata for a [Fargate] task running on AWS.
5958
///
6059
/// [Fargate]: https://aws.amazon.com/fargate
61-
#[cfg_attr(feature = "__unstable-fargate-cpu-count", non_exhaustive)]
60+
#[non_exhaustive]
6261
FargateAgentMetadata {
6362
/// The AWS account id
6463
aws_account_id: String,
@@ -81,14 +80,12 @@ pub enum AgentMetadata {
8180
/// For example, `Some(0.25)`. This will be `None` if the CPU limit is not specified.
8281
///
8382
/// See the ECS documentation for more details
84-
#[cfg(feature = "__unstable-fargate-cpu-count")]
8583
cpu_limit: Option<OrderedF64>,
8684
/// The memory limit for the Fargate cluster (in megabytes)
8785
///
8886
/// For example, `Some(2048)`. This will be `None` if the memory limit is not specified.
8987
///
9088
/// See the ECS documentation for more details
91-
#[cfg(feature = "__unstable-fargate-cpu-count")]
9289
memory_limit: Option<u64>,
9390
},
9491
/// Metadata for a host that is neither an EC2 nor a Fargate
@@ -204,7 +201,6 @@ impl Ec2AgentMetadataBuilder {
204201
aws_account_id: self.aws_account_id,
205202
aws_region_id: self.aws_region_id,
206203
ec2_instance_id: self.ec2_instance_id,
207-
#[cfg(feature = "__unstable-fargate-cpu-count")]
208204
ec2_instance_type: self.ec2_instance_type.unwrap_or_default(),
209205
}
210206
}
@@ -241,9 +237,7 @@ impl FargateAgentMetadataBuilder {
241237
aws_region_id: self.aws_region_id,
242238
ecs_task_arn: self.ecs_task_arn,
243239
ecs_cluster_arn: self.ecs_cluster_arn,
244-
#[cfg(feature = "__unstable-fargate-cpu-count")]
245240
cpu_limit: self.cpu_limit.map(Into::into),
246-
#[cfg(feature = "__unstable-fargate-cpu-count")]
247241
memory_limit: self.memory_limit,
248242
}
249243
}

src/profiler.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1313,7 +1313,6 @@ mod tests {
13131313
aws_account_id: "0".into(),
13141314
aws_region_id: "us-east-1".into(),
13151315
ec2_instance_id: "i-fake".into(),
1316-
#[cfg(feature = "__unstable-fargate-cpu-count")]
13171316
ec2_instance_type: "t3.micro".into(),
13181317
})
13191318
.build();
@@ -1326,7 +1325,6 @@ mod tests {
13261325
aws_account_id: "0".into(),
13271326
aws_region_id: "us-east-1".into(),
13281327
ec2_instance_id: "i-fake".into(),
1329-
#[cfg(feature = "__unstable-fargate-cpu-count")]
13301328
ec2_instance_type: "t3.micro".into(),
13311329
};
13321330
let (agent, mut rx) = make_mock_profiler();
@@ -1351,7 +1349,6 @@ mod tests {
13511349
aws_account_id: "0".into(),
13521350
aws_region_id: "us-east-1".into(),
13531351
ec2_instance_id: "i-fake".into(),
1354-
#[cfg(feature = "__unstable-fargate-cpu-count")]
13551352
ec2_instance_type: "t3.micro".into(),
13561353
};
13571354
let (agent, mut rx) = make_mock_profiler();
@@ -1419,7 +1416,6 @@ mod tests {
14191416
aws_account_id: "0".into(),
14201417
aws_region_id: "us-east-1".into(),
14211418
ec2_instance_id: "i-fake".into(),
1422-
#[cfg(feature = "__unstable-fargate-cpu-count")]
14231419
ec2_instance_type: "t3.micro".into(),
14241420
};
14251421
let (agent, mut rx) = make_mock_profiler();

0 commit comments

Comments
 (0)