Skip to content

configure_agent async

configure_agent(
    profiling_group_name: ProfilingGroupName,
    *,
    config_overrides: Optional[AsyncCodeGuruProfilerClientConfig] = None,
    fleet_instance_id: Optional[FleetInstanceId] = None,
    metadata: Optional[Metadata] = None,
) -> ConfigureAgentResponse

Used by profiler agents to report their current state and to receive remote configuration updates. For example, ConfigureAgent can be used to tell an agent whether to profile or not and for how long to return profiling data.

Parameters:

  • profiling_group_name (ProfilingGroupName) –

    The name of the profiling group for which the configured agent is collecting profiling data.

  • fleet_instance_id (Optional[FleetInstanceId], default: None ) –

    A universally unique identifier (UUID) for a profiling instance. For example, if the profiling instance is an Amazon EC2 instance, it is the instance ID. If it is an AWS Fargate container, it is the container's task ID.

  • metadata (Optional[Metadata], default: None ) –

    Metadata captured about the compute platform the agent is running on. It includes information about sampling and reporting. The valid fields are:

    • COMPUTE_PLATFORM - The compute platform on which the agent is running

    • AGENT_ID - The ID for an agent instance.

    • AWS_REQUEST_ID - The AWS request ID of a Lambda invocation.

    • EXECUTION_ENVIRONMENT - The execution environment a Lambda function is running on.

    • LAMBDA_FUNCTION_ARN - The Amazon Resource Name (ARN) that is used to invoke a Lambda function.

    • LAMBDA_MEMORY_LIMIT_IN_MB - The memory allocated to a Lambda function.

    • LAMBDA_REMAINING_TIME_IN_MILLISECONDS - The time in milliseconds before execution of a Lambda function times out.

    • LAMBDA_TIME_GAP_BETWEEN_INVOKES_IN_MILLISECONDS - The time in milliseconds between two invocations of a Lambda function.

    • LAMBDA_PREVIOUS_EXECUTION_TIME_IN_MILLISECONDS - The time in milliseconds for the previous Lambda invocation.

Raises:

Source code in docs_src/capo_codeguruprofiler/_services/async_code_guru_profiler.py
async def configure_agent(
    self,
    profiling_group_name: "capo_codeguruprofiler.types.profiling_group_name.ProfilingGroupName",
    *,
    config_overrides: Optional[AsyncCodeGuruProfilerClientConfig] = None,
    fleet_instance_id: Optional[
        "capo_codeguruprofiler.types.fleet_instance_id.FleetInstanceId"
    ] = None,
    metadata: Optional["capo_codeguruprofiler.types.metadata.Metadata"] = None,
) -> "capo_codeguruprofiler.types.configure_agent_response.ConfigureAgentResponse":
    """<p> Used by profiler agents to report their current state and to receive remote configuration updates. For example, <code>ConfigureAgent</code> can be used to tell an agent whether to profile or not and for how long to return profiling data. </p>

    Args:
        profiling_group_name: <p> The name of the profiling group for which the configured agent is collecting profiling data. </p>
        fleet_instance_id: <p> A universally unique identifier (UUID) for a profiling instance. For example, if the profiling instance is an Amazon EC2 instance, it is the instance ID. If it is an AWS Fargate container, it is the container's task ID. </p>
        metadata: <p> Metadata captured about the compute platform the agent is running on. It includes information about sampling and reporting. The valid fields are:</p> <ul> <li> <p> <code>COMPUTE_PLATFORM</code> - The compute platform on which the agent is running </p> </li> <li> <p> <code>AGENT_ID</code> - The ID for an agent instance. </p> </li> <li> <p> <code>AWS_REQUEST_ID</code> - The AWS request ID of a Lambda invocation. </p> </li> <li> <p> <code>EXECUTION_ENVIRONMENT</code> - The execution environment a Lambda function is running on. </p> </li> <li> <p> <code>LAMBDA_FUNCTION_ARN</code> - The Amazon Resource Name (ARN) that is used to invoke a Lambda function. </p> </li> <li> <p> <code>LAMBDA_MEMORY_LIMIT_IN_MB</code> - The memory allocated to a Lambda function. </p> </li> <li> <p> <code>LAMBDA_REMAINING_TIME_IN_MILLISECONDS</code> - The time in milliseconds before execution of a Lambda function times out. </p> </li> <li> <p> <code>LAMBDA_TIME_GAP_BETWEEN_INVOKES_IN_MILLISECONDS</code> - The time in milliseconds between two invocations of a Lambda function. </p> </li> <li> <p> <code>LAMBDA_PREVIOUS_EXECUTION_TIME_IN_MILLISECONDS</code> - The time in milliseconds for the previous Lambda invocation. </p> </li> </ul>

    Raises:
        capo_codeguruprofiler.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
        capo_codeguruprofiler.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request does not exist.</p>
        capo_codeguruprofiler.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_codeguruprofiler.errors.validation_exception.ValidationException: <p>The parameter is not valid.</p>
        capo_codeguruprofiler.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_codeguruprofiler.types.configure_agent_request.ConfigureAgentRequest]",
    ) -> AsyncOperationResponse[
        "capo_codeguruprofiler.types.configure_agent_response.ConfigureAgentResponse"
    ]:
        import capo_codeguruprofiler._operations.code_guru_profiler.configure_agent

        (
            output,
            http_response,
        ) = await capo_codeguruprofiler._operations.code_guru_profiler.configure_agent.async_configure_agent(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ConfigureAgent")
    )
    input_: capo_codeguruprofiler.types.configure_agent_request.ConfigureAgentRequest = {
        "profiling_group_name": profiling_group_name
    }
    if fleet_instance_id is not None:
        input_["fleet_instance_id"] = fleet_instance_id
    if metadata is not None:
        input_["metadata"] = metadata

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output