Skip to content

/AWS1/IF_CWT=>STARTOTELENRICHMENT()

About StartOTelEnrichment

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.

Method Signature

METHODS /AWS1/IF_CWT~STARTOTELENRICHMENT
  IMPORTING
    !IT_INCLUDEFILTERS TYPE /AWS1/CL_CWTOTELERCMETELECTOR=>TT_OTELENRCHMNTMETELECTORLIST OPTIONAL
    !IT_EXCLUDEFILTERS TYPE /AWS1/CL_CWTOTELERCMETELECTOR=>TT_OTELENRCHMNTMETELECTORLIST OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_cwtstartotelenrchout
  RAISING
    /AWS1/CX_CWTVLDTNEXCEPTION
    /AWS1/CX_CWTCLIENTEXC
    /AWS1/CX_CWTSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Optional arguments:

it_includefilters TYPE /AWS1/CL_CWTOTELERCMETELECTOR=>TT_OTELENRCHMNTMETELECTORLIST TT_OTELENRCHMNTMETELECTORLIST

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.

it_excludefilters TYPE /AWS1/CL_CWTOTELERCMETELECTOR=>TT_OTELENRCHMNTMETELECTORLIST TT_OTELENRCHMNTMETELECTORLIST

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.

RETURNING

oo_output TYPE REF TO /aws1/cl_cwtstartotelenrchout /AWS1/CL_CWTSTARTOTELENRCHOUT

Examples

Syntax Example

This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.

DATA(lo_result) = lo_client->startotelenrichment(
  it_excludefilters = VALUE /aws1/cl_cwtotelercmetelector=>tt_otelenrchmntmetelectorlist(
    (
      new /aws1/cl_cwtotelercmetelector(
        it_metricnames = VALUE /aws1/cl_cwtotelercmetnamlst_w=>tt_otelenrchmntmetricnamelist(
          ( new /aws1/cl_cwtotelercmetnamlst_w( |string| ) )
        )
        iv_namespace = |string|
      )
    )
  )
  it_includefilters = VALUE /aws1/cl_cwtotelercmetelector=>tt_otelenrchmntmetelectorlist(
    (
      new /aws1/cl_cwtotelercmetelector(
        it_metricnames = VALUE /aws1/cl_cwtotelercmetnamlst_w=>tt_otelenrchmntmetricnamelist(
          ( new /aws1/cl_cwtotelercmetnamlst_w( |string| ) )
        )
        iv_namespace = |string|
      )
    )
  )
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  LOOP AT lo_result->get_includefilters( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_namespace = lo_row_1->get_namespace( ).
      LOOP AT lo_row_1->get_metricnames( ) into lo_row_2.
        lo_row_3 = lo_row_2.
        IF lo_row_3 IS NOT INITIAL.
          lv_metricname = lo_row_3->get_value( ).
        ENDIF.
      ENDLOOP.
    ENDIF.
  ENDLOOP.
  LOOP AT lo_result->get_excludefilters( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_namespace = lo_row_1->get_namespace( ).
      LOOP AT lo_row_1->get_metricnames( ) into lo_row_2.
        lo_row_3 = lo_row_2.
        IF lo_row_3 IS NOT INITIAL.
          lv_metricname = lo_row_3->get_value( ).
        ENDIF.
      ENDLOOP.
    ENDIF.
  ENDLOOP.
  lv_timestamp = lo_result->get_createdat( ).
  lv_timestamp = lo_result->get_updatedat( ).
ENDIF.