Replaces the filters that determine which CloudWatch vended metrics are enriched with resource ARN and resource tag labels for the account. Enrichment must already be running for the account. If it is not, this operation returns a ResourceNotFoundException. To start enrichment, use StartOTelEnrichment.
The filters in the request completely replace the stored filters; they are not merged with them. IncludeFilters and ExcludeFilters are replaced as a pair, so a request that specifies only IncludeFilters also clears the stored ExcludeFilters, and a request that specifies neither clears both.
Parameters:
-
include_filters
(Optional[OTelEnrichmentMetricSelectorList], default:
None
)
–
The metric namespaces, and the metric names, to enrich. If this parameter is omitted, every namespace that Amazon CloudWatch supports for enrichment is in scope.
A maximum of 100 filters is allowed across IncludeFilters and ExcludeFilters combined.
-
exclude_filters
(Optional[OTelEnrichmentMetricSelectorList], default:
None
)
–
The metric namespaces, and the metric names, to leave unenriched. If this parameter is omitted, nothing is excluded.
Amazon CloudWatch applies ExcludeFilters after IncludeFilters, so a metric that both parameters match is not enriched.
A maximum of 100 filters is allowed across IncludeFilters and ExcludeFilters combined.
Raises:
Source code in docs_src/capo_cloudwatch/_services/cloud_watch.py
| def update_o_tel_enrichment(
self,
*,
config_overrides: Optional[CloudWatchClientConfig] = None,
include_filters: Optional[
"capo_cloudwatch.types.o_tel_enrichment_metric_selector_list.OTelEnrichmentMetricSelectorList"
] = None,
exclude_filters: Optional[
"capo_cloudwatch.types.o_tel_enrichment_metric_selector_list.OTelEnrichmentMetricSelectorList"
] = None,
) -> "capo_cloudwatch.types.update_o_tel_enrichment_output.UpdateOTelEnrichmentOutput":
"""<p>Replaces the filters that determine which CloudWatch vended metrics are enriched with resource ARN and resource tag labels for the account. Enrichment must already be running for the account. If it is not, this operation returns a <code>ResourceNotFoundException</code>. To start enrichment, use <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_StartOTelEnrichment.html">StartOTelEnrichment</a>.</p> <p>The filters in the request completely replace the stored filters; they are not merged with them. <code>IncludeFilters</code> and <code>ExcludeFilters</code> are replaced as a pair, so a request that specifies only <code>IncludeFilters</code> also clears the stored <code>ExcludeFilters</code>, and a request that specifies neither clears both.</p>
Args:
include_filters: <p>The metric namespaces, and the metric names, to enrich. If this parameter is omitted, every namespace that Amazon CloudWatch supports for enrichment is in scope.</p> <p>A maximum of 100 filters is allowed across <code>IncludeFilters</code> and <code>ExcludeFilters</code> combined.</p>
exclude_filters: <p>The metric namespaces, and the metric names, to leave unenriched. If this parameter is omitted, nothing is excluded.</p> <p>Amazon CloudWatch applies <code>ExcludeFilters</code> after <code>IncludeFilters</code>, so a metric that both parameters match is not enriched.</p> <p>A maximum of 100 filters is allowed across <code>IncludeFilters</code> and <code>ExcludeFilters</code> combined.</p>
Raises:
capo_cloudwatch.errors.resource_not_found_exception.ResourceNotFoundException: <p>The named resource does not exist.</p>
capo_cloudwatch.errors.validation_exception.ValidationException: <p>The request failed validation. One or more input parameters do not satisfy the constraints that the operation requires.</p>
capo_cloudwatch.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_cloudwatch.types.update_o_tel_enrichment_input.UpdateOTelEnrichmentInput]",
) -> OperationResponse[
"capo_cloudwatch.types.update_o_tel_enrichment_output.UpdateOTelEnrichmentOutput"
]:
import capo_cloudwatch._operations.granite_service_version20100801.update_o_tel_enrichment
output, http_response = (
capo_cloudwatch._operations.granite_service_version20100801.update_o_tel_enrichment.update_o_tel_enrichment(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("UpdateOTelEnrichment")
)
input_: capo_cloudwatch.types.update_o_tel_enrichment_input.UpdateOTelEnrichmentInput = {}
if include_filters is not None:
input_["include_filters"] = include_filters
if exclude_filters is not None:
input_["exclude_filters"] = exclude_filters
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|