:doc:`SageMakerMetrics <../../sagemaker-metrics>` / Client / batch_put_metrics

*****************
batch_put_metrics
*****************



.. py:method:: SageMakerMetrics.Client.batch_put_metrics(**kwargs)

  

  Used to ingest training metrics into SageMaker. These metrics can be visualized in SageMaker Studio.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/sagemaker-metrics-2022-09-30/BatchPutMetrics>`_  


  **Request Syntax**
  ::

    response = client.batch_put_metrics(
        TrialComponentName='string',
        MetricData=[
            {
                'MetricName': 'string',
                'Timestamp': datetime(2015, 1, 1),
                'Step': 123,
                'Value': 123.0
            },
        ]
    )
    
  :type TrialComponentName: string
  :param TrialComponentName: **[REQUIRED]** 

    The name of the Trial Component to associate with the metrics. The Trial Component name must be entirely lowercase.

    

  
  :type MetricData: list
  :param MetricData: **[REQUIRED]** 

    A list of raw metric values to put.

    

  
    - *(dict) --* 

      The raw metric data to associate with the resource.

      

    
      - **MetricName** *(string) --* **[REQUIRED]** 

        The name of the metric.

        

      
      - **Timestamp** *(datetime) --* **[REQUIRED]** 

        The time that the metric was recorded.

        

      
      - **Step** *(integer) --* 

        The metric step (epoch).

        

      
      - **Value** *(float) --* **[REQUIRED]** 

        The metric value.

        

      
    

  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'Errors': [
              {
                  'Code': 'METRIC_LIMIT_EXCEEDED'|'INTERNAL_ERROR'|'VALIDATION_ERROR'|'CONFLICT_ERROR',
                  'MetricIndex': 123
              },
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **Errors** *(list) --* 

        Lists any errors that occur when inserting metric data.

        
        

        - *(dict) --* 

          An error that occured when putting the metric data.

          
          

          - **Code** *(string) --* 

            The error code of an error that occured when attempting to put metrics.

             

            
            * ``METRIC_LIMIT_EXCEEDED``: The maximum amount of metrics per resource is exceeded.
             
            * ``INTERNAL_ERROR``: An internal error occured.
             
            * ``VALIDATION_ERROR``: The metric data failed validation.
             
            * ``CONFLICT_ERROR``: Multiple requests attempted to modify the same data simultaneously.
            

            
          

          - **MetricIndex** *(integer) --* 

            An index that corresponds to the metric in the request.

            
      
    
  