Enables enrichment and PromQL access for CloudWatch vended metrics for supported Amazon Web Services resources in the account. Once enabled, metrics that contain a resource identifier dimension (for example, EC2 CPUUtilization with an InstanceId dimension) are enriched with resource ARN and resource tag labels and become queryable using PromQL.
Before calling this operation, you must enable resource tags on telemetry for your account. For more information, see Enable resource tags on telemetry.
Optionally, IncludeFilters and ExcludeFilters limit enrichment to a subset of the account's metrics. These filters are stored only when this operation starts enrichment. Calling StartOTelEnrichment for an account where enrichment is already running has no effect and does not modify the filters that are applied. To change them, use UpdateOTelEnrichment.
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:
-
ValidationException
–
The request failed validation. One or more input parameters do not satisfy the constraints that the operation requires.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_cloudwatch/_services/async_cloud_watch.py
| async def start_o_tel_enrichment(
self,
*,
config_overrides: Optional[AsyncCloudWatchClientConfig] = 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.start_o_tel_enrichment_output.StartOTelEnrichmentOutput"
):
"""<p>Enables enrichment and PromQL access for CloudWatch vended metrics for <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/UsingResourceTagsForTelemetry.html">supported Amazon Web Services resources</a> in the account. Once enabled, metrics that contain a resource identifier dimension (for example, EC2 <code>CPUUtilization</code> with an <code>InstanceId</code> dimension) are enriched with resource ARN and resource tag labels and become queryable using PromQL.</p> <p>Before calling this operation, you must enable resource tags on telemetry for your account. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/EnableResourceTagsOnTelemetry.html">Enable resource tags on telemetry</a>.</p> <p>Optionally, <code>IncludeFilters</code> and <code>ExcludeFilters</code> limit enrichment to a subset of the account's metrics. These filters are stored only when this operation starts enrichment. Calling <code>StartOTelEnrichment</code> for an account where enrichment is already running has no effect and does not modify the filters that are applied. To change them, use <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_UpdateOTelEnrichment.html">UpdateOTelEnrichment</a>.</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.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.
"""
async def _handler(
req: "AsyncOperationRequest[capo_cloudwatch.types.start_o_tel_enrichment_input.StartOTelEnrichmentInput]",
) -> AsyncOperationResponse[
"capo_cloudwatch.types.start_o_tel_enrichment_output.StartOTelEnrichmentOutput"
]:
import capo_cloudwatch._operations.granite_service_version20100801.start_o_tel_enrichment
(
output,
http_response,
) = await capo_cloudwatch._operations.granite_service_version20100801.start_o_tel_enrichment.async_start_o_tel_enrichment(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("StartOTelEnrichment")
)
input_: capo_cloudwatch.types.start_o_tel_enrichment_input.StartOTelEnrichmentInput = {}
if include_filters is not None:
input_["include_filters"] = include_filters
if exclude_filters is not None:
input_["exclude_filters"] = exclude_filters
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|