Skip to content

/AWS1/IF_CWS=>CREATEINSTRCONFIGURATION()

About CreateInstrumentationConfiguration

Creates a dynamic instrumentation configuration for a specific code or endpoint location within a service and environment. Configurations are immutable after creation.

For BREAKPOINT type configurations, they expire after 24 hours unless a shorter expiration is provided. For PROBE type configurations, they persist until explicitly deleted; an expiration cannot be set for PROBE configurations.

If a configuration already exists for the same service, environment, signal type, and location, this operation returns a conflict instead of overwriting it. Use attribute filters and capture settings to control where the instrumentation runs and which data is collected.

Method Signature

METHODS /AWS1/IF_CWS~CREATEINSTRCONFIGURATION
  IMPORTING
    !IV_INSTRUMENTATIONTYPE TYPE /AWS1/CWSINSTRUMENTATIONTYPE OPTIONAL
    !IV_SERVICE TYPE /AWS1/CWSSTRING OPTIONAL
    !IV_ENVIRONMENT TYPE /AWS1/CWSSTRING OPTIONAL
    !IV_SIGNALTYPE TYPE /AWS1/CWSDYNINSTRSIGNALTYPE OPTIONAL
    !IO_LOCATION TYPE REF TO /AWS1/CL_CWSLOCATION OPTIONAL
    !IV_DESCRIPTION TYPE /AWS1/CWSSTRING OPTIONAL
    !IV_EXPIRESAT TYPE /AWS1/CWSTIMESTAMP OPTIONAL
    !IT_ATTRIBUTEFILTERS TYPE /AWS1/CL_CWSDYNINSTATTRFLTGR_W=>TT_DYNAMICINSTRATTRFILTERS OPTIONAL
    !IO_CAPTURECONFIGURATION TYPE REF TO /AWS1/CL_CWSCAPTURECONF OPTIONAL
    !IT_TAGS TYPE /AWS1/CL_CWSTAG=>TT_TAGLIST OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_cwscreateinstrconfrsp
  RAISING
    /AWS1/CX_CWSCONFLICTEXCEPTION
    /AWS1/CX_CWSSERVICEQUOTAEXCDEX
    /AWS1/CX_CWSTHROTTLINGEX
    /AWS1/CX_CWSVALIDATIONEX
    /AWS1/CX_CWSCLIENTEXC
    /AWS1/CX_CWSSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_instrumentationtype TYPE /AWS1/CWSINSTRUMENTATIONTYPE /AWS1/CWSINSTRUMENTATIONTYPE

Type of instrumentation: BREAKPOINT (temporary) or PROBE (permanent)

iv_service TYPE /AWS1/CWSSTRING /AWS1/CWSSTRING

The name of the service to instrument. This should match the service.name resource attribute reported by the application.

iv_environment TYPE /AWS1/CWSSTRING /AWS1/CWSSTRING

The environment that the service is running in, such as eks:cluster-prod/namespace or ec2:production.

iv_signaltype TYPE /AWS1/CWSDYNINSTRSIGNALTYPE /AWS1/CWSDYNINSTRSIGNALTYPE

The telemetry signal type to emit for this instrumentation. The supported value is SNAPSHOT.

io_location TYPE REF TO /AWS1/CL_CWSLOCATION /AWS1/CL_CWSLOCATION

The location where instrumentation should be applied. Specify a CodeLocation for code-level instrumentation.

io_captureconfiguration TYPE REF TO /AWS1/CL_CWSCAPTURECONF /AWS1/CL_CWSCAPTURECONF

Specifies what to capture when the instrumentation point is hit. Specify CodeCapture for code-level capture settings.

Optional arguments:

iv_description TYPE /AWS1/CWSSTRING /AWS1/CWSSTRING

An optional short description (up to 50 characters) that explains the purpose of this instrumentation.

iv_expiresat TYPE /AWS1/CWSTIMESTAMP /AWS1/CWSTIMESTAMP

For BREAKPOINT: optional, defaults to 24 hours, must be between 5 min and 24 hours. For PROBE: not supported. PROBE configurations are permanent and persist until explicitly deleted.

it_attributefilters TYPE /AWS1/CL_CWSDYNINSTATTRFLTGR_W=>TT_DYNAMICINSTRATTRFILTERS TT_DYNAMICINSTRATTRFILTERS

Client-side filters that target specific instances. Each object in the array is AND-matched on its keys, and multiple objects are OR-matched to decide where to apply the instrumentation.

it_tags TYPE /AWS1/CL_CWSTAG=>TT_TAGLIST TT_TAGLIST

An optional list of key-value pairs to associate with the instrumentation configuration. Tags can help you organize and categorize your resources.

RETURNING

oo_output TYPE REF TO /aws1/cl_cwscreateinstrconfrsp /AWS1/CL_CWSCREATEINSTRCONFRSP

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->createinstrconfiguration(
  io_captureconfiguration = new /aws1/cl_cwscaptureconf(
    io_codecapture = new /aws1/cl_cwscodecaptureconf(
      io_capturelimits = new /aws1/cl_cwscaptlimitsconfig(
        iv_maxcollectiondepth = 123
        iv_maxcollectionwidth = 123
        iv_maxfieldsperobject = 123
        iv_maxhits = 123
        iv_maxobjectdepth = 123
        iv_maxstackframes = 123
        iv_maxstacktracesize = 123
        iv_maxstringlength = 123
      )
      it_capturearguments = VALUE /aws1/cl_cwsstringlist_w=>tt_stringlist(
        ( new /aws1/cl_cwsstringlist_w( |string| ) )
      )
      it_capturelocals = VALUE /aws1/cl_cwsstringlist_w=>tt_stringlist(
        ( new /aws1/cl_cwsstringlist_w( |string| ) )
      )
      iv_capturereturn = ABAP_TRUE
      iv_capturestacktrace = ABAP_TRUE
    )
  )
  io_location = new /aws1/cl_cwslocation(
    io_codelocation = new /aws1/cl_cwscodelocation(
      iv_classname = |string|
      iv_codeunit = |string|
      iv_filepath = |string|
      iv_language = |string|
      iv_linenumber = 123
      iv_methodname = |string|
    )
  )
  it_attributefilters = VALUE /aws1/cl_cwsdyninstattrfltgr_w=>tt_dynamicinstrattrfilters(
    (
      VALUE /aws1/cl_cwsdyninstattrfltgr_w=>tt_dynamicinstrattrfiltergroup(
        (
          VALUE /aws1/cl_cwsdyninstattrfltgr_w=>ts_dyninstrattrfiltgrp_maprow(
            key = |string|
            value = new /aws1/cl_cwsdyninstattrfltgr_w( |string| )
          )
        )
      )
    )
  )
  it_tags = VALUE /aws1/cl_cwstag=>tt_taglist(
    (
      new /aws1/cl_cwstag(
        iv_key = |string|
        iv_value = |string|
      )
    )
  )
  iv_description = |string|
  iv_environment = |string|
  iv_expiresat = '20150101000000.0000000'
  iv_instrumentationtype = |string|
  iv_service = |string|
  iv_signaltype = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_instrumentationtype = lo_result->get_instrumentationtype( ).
  lv_string = lo_result->get_service( ).
  lv_string = lo_result->get_environment( ).
  lv_dynamicinstrumentations = lo_result->get_signaltype( ).
  lo_location = lo_result->get_location( ).
  IF lo_location IS NOT INITIAL.
    lo_codelocation = lo_location->get_codelocation( ).
    IF lo_codelocation IS NOT INITIAL.
      lv_programminglanguage = lo_codelocation->get_language( ).
      lv_string = lo_codelocation->get_codeunit( ).
      lv_string = lo_codelocation->get_classname( ).
      lv_string = lo_codelocation->get_methodname( ).
      lv_string = lo_codelocation->get_filepath( ).
      lv_integer = lo_codelocation->get_linenumber( ).
    ENDIF.
  ENDIF.
  lv_string = lo_result->get_locationhash( ).
  lv_string = lo_result->get_description( ).
  lv_timestamp = lo_result->get_expiresat( ).
  LOOP AT lo_result->get_attributefilters( ) into lt_row.
    LOOP AT lt_row into ls_row_1.
      lv_key = ls_row_1-key.
      lo_value = ls_row_1-value.
      IF lo_value IS NOT INITIAL.
        lv_string = lo_value->get_value( ).
      ENDIF.
    ENDLOOP.
  ENDLOOP.
  lo_captureconfiguration = lo_result->get_captureconfiguration( ).
  IF lo_captureconfiguration IS NOT INITIAL.
    lo_codecaptureconfiguratio = lo_captureconfiguration->get_codecapture( ).
    IF lo_codecaptureconfiguratio IS NOT INITIAL.
      LOOP AT lo_codecaptureconfiguratio->get_capturearguments( ) into lo_row_2.
        lo_row_3 = lo_row_2.
        IF lo_row_3 IS NOT INITIAL.
          lv_string = lo_row_3->get_value( ).
        ENDIF.
      ENDLOOP.
      lv_boolean = lo_codecaptureconfiguratio->get_capturereturn( ).
      lv_boolean = lo_codecaptureconfiguratio->get_capturestacktrace( ).
      LOOP AT lo_codecaptureconfiguratio->get_capturelocals( ) into lo_row_2.
        lo_row_3 = lo_row_2.
        IF lo_row_3 IS NOT INITIAL.
          lv_string = lo_row_3->get_value( ).
        ENDIF.
      ENDLOOP.
      lo_capturelimitsconfig = lo_codecaptureconfiguratio->get_capturelimits( ).
      IF lo_capturelimitsconfig IS NOT INITIAL.
        lv_integer = lo_capturelimitsconfig->get_maxhits( ).
        lv_integer = lo_capturelimitsconfig->get_maxstringlength( ).
        lv_integer = lo_capturelimitsconfig->get_maxcollectionwidth( ).
        lv_integer = lo_capturelimitsconfig->get_maxcollectiondepth( ).
        lv_integer = lo_capturelimitsconfig->get_maxstackframes( ).
        lv_integer = lo_capturelimitsconfig->get_maxstacktracesize( ).
        lv_integer = lo_capturelimitsconfig->get_maxobjectdepth( ).
        lv_integer = lo_capturelimitsconfig->get_maxfieldsperobject( ).
      ENDIF.
    ENDIF.
  ENDIF.
  lv_timestamp = lo_result->get_createdat( ).
  lv_instrumentationconfigur = lo_result->get_arn( ).
ENDIF.