#[non_exhaustive]pub enum AgentMetadata {
#[non_exhaustive] Ec2AgentMetadata {
aws_account_id: String,
aws_region_id: String,
ec2_instance_id: String,
ec2_instance_type: String,
},
#[non_exhaustive] FargateAgentMetadata {
aws_account_id: String,
aws_region_id: String,
ecs_task_arn: String,
ecs_cluster_arn: String,
cpu_limit: Option<OrderedF64>,
memory_limit: Option<u64>,
},
Other,
NoMetadata,
}Expand description
Host Metadata, which describes a host that runs a profiling agent. The current set of supported agent metadata is AWS-specific. If you are not running on AWS, you can use AgentMetadata::NoMetadata.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
#[non_exhaustive]Ec2AgentMetadata
Metadata for an EC2 instance running on AWS
Fields
This variant is marked as non-exhaustive
#[non_exhaustive]FargateAgentMetadata
Metadata for a Fargate task running on AWS.
Fields
This variant is marked as non-exhaustive
ecs_task_arn: StringThe ECS task ARN
For example, arn:aws:ecs:us-east-1:123456789012:task/profiler-metadata-cluster/5261e761e0e2a3d92da3f02c8e5bab1f
See the ECS documentation for more details
ecs_cluster_arn: StringThe ECS cluster ARN
For example, arn:aws:ecs:us-east-1:123456789012:cluster/profiler-metadata-cluster
See the ECS documentation for more details
cpu_limit: Option<OrderedF64>__unstable-fargate-cpu-count only.The CPU limit for the Fargate cluster
For example, Some(0.25). This will be None if the CPU limit is not specified.
See the ECS documentation for more details
Other
Metadata for a host that is neither an EC2 nor a Fargate
NoMetadata
A placeholder when a host has no metadata, or when a reporter does not use metadata.
Implementations§
Source§impl AgentMetadata
impl AgentMetadata
Sourcepub fn ec2_agent_metadata(
aws_account_id: String,
aws_region_id: String,
ec2_instance_id: String,
) -> Ec2AgentMetadataBuilder
pub fn ec2_agent_metadata( aws_account_id: String, aws_region_id: String, ec2_instance_id: String, ) -> Ec2AgentMetadataBuilder
Create a builder for EC2 agent metadata
Normally, for real-world use, you would get the metadata using
autodetection via
aws::load_agent_metadata,
aws::load_agent_metadata,
this function is intended for use in tests.
§Example
let metadata = AgentMetadata::ec2_agent_metadata(
"123456789012".to_string(),
"us-east-1".to_string(),
"i-1234567890abcdef0".to_string(),
).build();Sourcepub fn fargate_agent_metadata(
aws_account_id: String,
aws_region_id: String,
ecs_task_arn: String,
ecs_cluster_arn: String,
) -> FargateAgentMetadataBuilder
pub fn fargate_agent_metadata( aws_account_id: String, aws_region_id: String, ecs_task_arn: String, ecs_cluster_arn: String, ) -> FargateAgentMetadataBuilder
Create a builder for Fargate agent metadata
Normally, for real-world use, you would get the metadata using
autodetection via
aws::load_agent_metadata,
aws::load_agent_metadata,
this function is intended for use in tests.
§Example
let metadata = AgentMetadata::fargate_agent_metadata(
"123456789012".to_string(),
"us-east-1".to_string(),
"arn:aws:ecs:us-east-1:123456789012:task/cluster/5261e761e0e2a3d92da3f02c8e5bab1f".to_string(),
"arn:aws:ecs:us-east-1:123456789012:cluster/profiler-metadata-cluster".to_string(),
)
.with_cpu_limit(0.25)
.with_memory_limit(2048)
.build();Trait Implementations§
Source§impl Clone for AgentMetadata
impl Clone for AgentMetadata
Source§fn clone(&self) -> AgentMetadata
fn clone(&self) -> AgentMetadata
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AgentMetadata
impl Debug for AgentMetadata
Source§impl PartialEq for AgentMetadata
impl PartialEq for AgentMetadata
impl Eq for AgentMetadata
impl StructuralPartialEq for AgentMetadata
Auto Trait Implementations§
impl Freeze for AgentMetadata
impl RefUnwindSafe for AgentMetadata
impl Send for AgentMetadata
impl Sync for AgentMetadata
impl Unpin for AgentMetadata
impl UnwindSafe for AgentMetadata
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more