Struct aws_sdk_cloudwatch::client::fluent_builders::PutMetricStream
source · [−]pub struct PutMetricStream { /* private fields */ }
Expand description
Fluent builder constructing a request to PutMetricStream
.
Creates or updates a metric stream. Metric streams can automatically stream CloudWatch metrics to Amazon Web Services destinations including Amazon S3 and to many third-party solutions.
For more information, see Using Metric Streams.
To create a metric stream, you must be logged on to an account that has the iam:PassRole
permission and either the CloudWatchFullAccess
policy or the cloudwatch:PutMetricStream
permission.
When you create or update a metric stream, you choose one of the following:
-
Stream metrics from all metric namespaces in the account.
-
Stream metrics from all metric namespaces in the account, except for the namespaces that you list in
ExcludeFilters
. -
Stream metrics from only the metric namespaces that you list in
IncludeFilters
.
By default, a metric stream always sends the MAX
, MIN
, SUM
, and SAMPLECOUNT
statistics for each metric that is streamed. You can use the StatisticsConfigurations
parameter to have the metric stream also send additional statistics in the stream. Streaming additional statistics incurs additional costs. For more information, see Amazon CloudWatch Pricing.
When you use PutMetricStream
to create a new metric stream, the stream is created in the running
state. If you use it to update an existing stream, the state of the stream is not changed.
Implementations
sourceimpl PutMetricStream
impl PutMetricStream
sourcepub async fn send(
self
) -> Result<PutMetricStreamOutput, SdkError<PutMetricStreamError>>
pub async fn send(
self
) -> Result<PutMetricStreamOutput, SdkError<PutMetricStreamError>>
Sends the request and returns the response.
If an error occurs, an SdkError
will be returned with additional details that
can be matched against.
By default, any retryable failures will be retried twice. Retry behavior is configurable with the RetryConfig, which can be set when configuring the client.
sourcepub fn name(self, input: impl Into<String>) -> Self
pub fn name(self, input: impl Into<String>) -> Self
If you are creating a new metric stream, this is the name for the new stream. The name must be different than the names of other metric streams in this account and Region.
If you are updating a metric stream, specify the name of that stream here.
Valid characters are A-Z, a-z, 0-9, "-" and "_".
sourcepub fn set_name(self, input: Option<String>) -> Self
pub fn set_name(self, input: Option<String>) -> Self
If you are creating a new metric stream, this is the name for the new stream. The name must be different than the names of other metric streams in this account and Region.
If you are updating a metric stream, specify the name of that stream here.
Valid characters are A-Z, a-z, 0-9, "-" and "_".
sourcepub fn include_filters(self, input: MetricStreamFilter) -> Self
pub fn include_filters(self, input: MetricStreamFilter) -> Self
Appends an item to IncludeFilters
.
To override the contents of this collection use set_include_filters
.
If you specify this parameter, the stream sends only the metrics from the metric namespaces that you specify here.
You cannot include IncludeFilters
and ExcludeFilters
in the same operation.
sourcepub fn set_include_filters(self, input: Option<Vec<MetricStreamFilter>>) -> Self
pub fn set_include_filters(self, input: Option<Vec<MetricStreamFilter>>) -> Self
If you specify this parameter, the stream sends only the metrics from the metric namespaces that you specify here.
You cannot include IncludeFilters
and ExcludeFilters
in the same operation.
sourcepub fn exclude_filters(self, input: MetricStreamFilter) -> Self
pub fn exclude_filters(self, input: MetricStreamFilter) -> Self
Appends an item to ExcludeFilters
.
To override the contents of this collection use set_exclude_filters
.
If you specify this parameter, the stream sends metrics from all metric namespaces except for the namespaces that you specify here.
You cannot include ExcludeFilters
and IncludeFilters
in the same operation.
sourcepub fn set_exclude_filters(self, input: Option<Vec<MetricStreamFilter>>) -> Self
pub fn set_exclude_filters(self, input: Option<Vec<MetricStreamFilter>>) -> Self
If you specify this parameter, the stream sends metrics from all metric namespaces except for the namespaces that you specify here.
You cannot include ExcludeFilters
and IncludeFilters
in the same operation.
sourcepub fn firehose_arn(self, input: impl Into<String>) -> Self
pub fn firehose_arn(self, input: impl Into<String>) -> Self
The ARN of the Amazon Kinesis Firehose delivery stream to use for this metric stream. This Amazon Kinesis Firehose delivery stream must already exist and must be in the same account as the metric stream.
sourcepub fn set_firehose_arn(self, input: Option<String>) -> Self
pub fn set_firehose_arn(self, input: Option<String>) -> Self
The ARN of the Amazon Kinesis Firehose delivery stream to use for this metric stream. This Amazon Kinesis Firehose delivery stream must already exist and must be in the same account as the metric stream.
sourcepub fn role_arn(self, input: impl Into<String>) -> Self
pub fn role_arn(self, input: impl Into<String>) -> Self
The ARN of an IAM role that this metric stream will use to access Amazon Kinesis Firehose resources. This IAM role must already exist and must be in the same account as the metric stream. This IAM role must include the following permissions:
-
firehose:PutRecord
-
firehose:PutRecordBatch
sourcepub fn set_role_arn(self, input: Option<String>) -> Self
pub fn set_role_arn(self, input: Option<String>) -> Self
The ARN of an IAM role that this metric stream will use to access Amazon Kinesis Firehose resources. This IAM role must already exist and must be in the same account as the metric stream. This IAM role must include the following permissions:
-
firehose:PutRecord
-
firehose:PutRecordBatch
sourcepub fn output_format(self, input: MetricStreamOutputFormat) -> Self
pub fn output_format(self, input: MetricStreamOutputFormat) -> Self
The output format for the stream. Valid values are json
and opentelemetry0.7
. For more information about metric stream output formats, see Metric streams output formats.
sourcepub fn set_output_format(self, input: Option<MetricStreamOutputFormat>) -> Self
pub fn set_output_format(self, input: Option<MetricStreamOutputFormat>) -> Self
The output format for the stream. Valid values are json
and opentelemetry0.7
. For more information about metric stream output formats, see Metric streams output formats.
Appends an item to Tags
.
To override the contents of this collection use set_tags
.
A list of key-value pairs to associate with the metric stream. You can associate as many as 50 tags with a metric stream.
Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.
You can use this parameter only when you are creating a new metric stream. If you are using this operation to update an existing metric stream, any tags you specify in this parameter are ignored. To change the tags of an existing metric stream, use TagResource or UntagResource.
A list of key-value pairs to associate with the metric stream. You can associate as many as 50 tags with a metric stream.
Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.
You can use this parameter only when you are creating a new metric stream. If you are using this operation to update an existing metric stream, any tags you specify in this parameter are ignored. To change the tags of an existing metric stream, use TagResource or UntagResource.
sourcepub fn statistics_configurations(
self,
input: MetricStreamStatisticsConfiguration
) -> Self
pub fn statistics_configurations(
self,
input: MetricStreamStatisticsConfiguration
) -> Self
Appends an item to StatisticsConfigurations
.
To override the contents of this collection use set_statistics_configurations
.
By default, a metric stream always sends the MAX
, MIN
, SUM
, and SAMPLECOUNT
statistics for each metric that is streamed. You can use this parameter to have the metric stream also send additional statistics in the stream. This array can have up to 100 members.
For each entry in this array, you specify one or more metrics and the list of additional statistics to stream for those metrics. The additional statistics that you can stream depend on the stream's OutputFormat
. If the OutputFormat
is json
, you can stream any additional statistic that is supported by CloudWatch, listed in CloudWatch statistics definitions. If the OutputFormat
is opentelemetry0.7
, you can stream percentile statistics such as p95, p99.9 and so on.
sourcepub fn set_statistics_configurations(
self,
input: Option<Vec<MetricStreamStatisticsConfiguration>>
) -> Self
pub fn set_statistics_configurations(
self,
input: Option<Vec<MetricStreamStatisticsConfiguration>>
) -> Self
By default, a metric stream always sends the MAX
, MIN
, SUM
, and SAMPLECOUNT
statistics for each metric that is streamed. You can use this parameter to have the metric stream also send additional statistics in the stream. This array can have up to 100 members.
For each entry in this array, you specify one or more metrics and the list of additional statistics to stream for those metrics. The additional statistics that you can stream depend on the stream's OutputFormat
. If the OutputFormat
is json
, you can stream any additional statistic that is supported by CloudWatch, listed in CloudWatch statistics definitions. If the OutputFormat
is opentelemetry0.7
, you can stream percentile statistics such as p95, p99.9 and so on.
Trait Implementations
sourceimpl Clone for PutMetricStream
impl Clone for PutMetricStream
sourcefn clone(&self) -> PutMetricStream
fn clone(&self) -> PutMetricStream
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl !RefUnwindSafe for PutMetricStream
impl Send for PutMetricStream
impl Sync for PutMetricStream
impl Unpin for PutMetricStream
impl !UnwindSafe for PutMetricStream
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more