CloudWatchApplicationSignals / Client / get_instrumentation_configuration

get_instrumentation_configuration

CloudWatchApplicationSignals.Client.get_instrumentation_configuration(**kwargs)

Returns the details of a single instrumentation configuration identified by service, environment, signal type, and location. Use this to audit or display configuration details.

See also: AWS API Documentation

Request Syntax

response = client.get_instrumentation_configuration(
    InstrumentationType='BREAKPOINT'|'PROBE',
    Service='string',
    Environment='string',
    SignalType='SNAPSHOT',
    LocationIdentifier={
        'CodeLocation': {
            'Language': 'Java'|'Python'|'Javascript',
            'CodeUnit': 'string',
            'ClassName': 'string',
            'MethodName': 'string',
            'FilePath': 'string',
            'LineNumber': 123
        },
        'LocationHash': 'string'
    }
)
Parameters:
  • InstrumentationType (string) –

    [REQUIRED]

    Type of instrumentation configuration (BREAKPOINT or PROBE). Required to identify the configuration to retrieve.

  • Service (string) –

    [REQUIRED]

    Service name for the instrumentation configuration.

  • Environment (string) –

    [REQUIRED]

    Environment name for the instrumentation configuration.

  • SignalType (string) –

    [REQUIRED]

    Signal type for the instrumentation configuration.

  • LocationIdentifier (dict) –

    [REQUIRED]

    Location identifier - either full code location or a pre-computed hash.

    Note

    This is a Tagged Union structure. Only one of the following top level keys can be set: CodeLocation, LocationHash.

    • CodeLocation (dict) –

      The full code location specification (will be hashed internally)

      • Language (string) – [REQUIRED]

        The programming language for this instrumentation point, such as Java, Python, or JavaScript.

      • CodeUnit (string) –

        The package, module, or namespace that contains the target code, for example com.amazon.payment or payment_service.

      • ClassName (string) –

        The class or type name that contains the method. This is required for Java and optional for Python module-level functions.

      • MethodName (string) –

        The method or function name to instrument, such as validateCreditCard or __init__.

      • FilePath (string) – [REQUIRED]

        The source file path relative to the project or source root, such as src/payment/PaymentProcessor.java or src/payment/PaymentProcessor.py.

      • LineNumber (integer) –

        The line number to instrument. Provide this to disambiguate overloaded methods and to target a specific line when needed.

    • LocationHash (string) –

      The pre-computed location hash (16-character hex string)

Return type:

dict

Returns:

Response Syntax

{
    'Configuration': {
        'InstrumentationType': 'BREAKPOINT'|'PROBE',
        'Service': 'string',
        'Environment': 'string',
        'SignalType': 'SNAPSHOT',
        'Location': {
            'CodeLocation': {
                'Language': 'Java'|'Python'|'Javascript',
                'CodeUnit': 'string',
                'ClassName': 'string',
                'MethodName': 'string',
                'FilePath': 'string',
                'LineNumber': 123
            }
        },
        'LocationHash': 'string',
        'Description': 'string',
        'ExpiresAt': datetime(2015, 1, 1),
        'AttributeFilters': [
            {
                'string': 'string'
            },
        ],
        'CaptureConfiguration': {
            'CodeCapture': {
                'CaptureArguments': [
                    'string',
                ],
                'CaptureReturn': True|False,
                'CaptureStackTrace': True|False,
                'CaptureLocals': [
                    'string',
                ],
                'CaptureLimits': {
                    'MaxHits': 123,
                    'MaxStringLength': 123,
                    'MaxCollectionWidth': 123,
                    'MaxCollectionDepth': 123,
                    'MaxStackFrames': 123,
                    'MaxStackTraceSize': 123,
                    'MaxObjectDepth': 123,
                    'MaxFieldsPerObject': 123
                }
            }
        },
        'CreatedAt': datetime(2015, 1, 1),
        'ARN': 'string'
    }
}

Response Structure

  • (dict) –

    • Configuration (dict) –

      The complete instrumentation configuration, including its location hash, capture settings, filters, expiration, and creation time.

      • InstrumentationType (string) –

        The type of instrumentation for this configuration.

      • Service (string) –

        The service that this instrumentation configuration targets.

      • Environment (string) –

        The environment where the service is running.

      • SignalType (string) –

        The telemetry signal type for this instrumentation configuration.

      • Location (dict) –

        The location where this instrumentation is applied.

        Note

        This is a Tagged Union structure. Only one of the following top level keys will be set: CodeLocation. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

        'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
        
        • CodeLocation (dict) –

          A code location for code-level instrumentation, including language, code unit, class, method, file path, and optional line number.

          • Language (string) –

            The programming language for this instrumentation point, such as Java, Python, or JavaScript.

          • CodeUnit (string) –

            The package, module, or namespace that contains the target code, for example com.amazon.payment or payment_service.

          • ClassName (string) –

            The class or type name that contains the method. This is required for Java and optional for Python module-level functions.

          • MethodName (string) –

            The method or function name to instrument, such as validateCreditCard or __init__.

          • FilePath (string) –

            The source file path relative to the project or source root, such as src/payment/PaymentProcessor.java or src/payment/PaymentProcessor.py.

          • LineNumber (integer) –

            The line number to instrument. Provide this to disambiguate overloaded methods and to target a specific line when needed.

      • LocationHash (string) –

        The stable hash derived from the location that uniquely identifies this instrumentation point within the service and environment.

      • Description (string) –

        An optional short description of the instrumentation configuration.

      • ExpiresAt (datetime) –

        The timestamp when this configuration expires.

      • AttributeFilters (list) –

        Client-side filters that determine which instances apply this instrumentation.

        • (dict) –

          A string-to-string map of OpenTelemetry resource attributes and values that must all match for the instrumentation to run on an instance.

          • (string) –

            • (string) –

      • CaptureConfiguration (dict) –

        The capture settings for this instrumentation configuration.

        Note

        This is a Tagged Union structure. Only one of the following top level keys will be set: CodeCapture. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

        'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
        
        • CodeCapture (dict) –

          Capture settings for code-level instrumentation, including arguments, return values, stack traces, local variables, and safety limits.

          • CaptureArguments (list) –

            The function arguments to capture. Omit to capture defaults, use an empty list to capture none, use ["*"] to capture all arguments, or specify argument names to capture selectively (up to 10 entries).

            • (string) –

          • CaptureReturn (boolean) –

            Whether to capture the return value. Defaults to false.

          • CaptureStackTrace (boolean) –

            Whether to capture a stack trace when the instrumentation point is hit. Defaults to true.

          • CaptureLocals (list) –

            The local variables to capture by name. Omit or pass an empty list to capture none. You can specify up to 20 names.

            • (string) –

          • CaptureLimits (dict) –

            Safety limits that bound what is captured, including hit counts, string length, collection depth, and stack trace size.

            • MaxHits (integer) –

              The maximum number of times the instrumentation point can be hit before it is automatically disabled. Defaults to 100.

            • MaxStringLength (integer) –

              The maximum length of captured string values in characters. Strings longer than this are truncated. Defaults to 128.

            • MaxCollectionWidth (integer) –

              The maximum number of items to capture from any collection to prevent large payloads. Defaults to 10.

            • MaxCollectionDepth (integer) –

              The maximum nesting depth to traverse inside collections. Defaults to 3.

            • MaxStackFrames (integer) –

              The maximum number of stack frames to capture in stack traces. Defaults to 2.

            • MaxStackTraceSize (integer) –

              The maximum total size, in bytes, of a captured stack trace. Defaults to 1000.

            • MaxObjectDepth (integer) –

              The maximum depth for nested object traversal when capturing structured data. Defaults to 3.

            • MaxFieldsPerObject (integer) –

              The maximum number of fields to capture for any object. Defaults to 10.

      • CreatedAt (datetime) –

        The timestamp when this instrumentation configuration was created.

      • ARN (string) –

        ARN for the instrumentation configuration

Exceptions

  • CloudWatchApplicationSignals.Client.exceptions.ValidationException

  • CloudWatchApplicationSignals.Client.exceptions.ThrottlingException

  • CloudWatchApplicationSignals.Client.exceptions.ResourceNotFoundException