:doc:`MWAA <../../mwaa>` / Client / publish_metrics

***************
publish_metrics
***************



.. py:method:: MWAA.Client.publish_metrics(**kwargs)

  

  **Internal only**. Publishes environment health metrics to Amazon CloudWatch.

  

  .. danger::

        This operation is deprecated and may not function as expected. This operation should not be used going forward and is only kept for the purpose of backwards compatiblity.


  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/mwaa-2020-07-01/PublishMetrics>`_  


  **Request Syntax**
  ::

    response = client.publish_metrics(
        EnvironmentName='string',
        MetricData=[
            {
                'MetricName': 'string',
                'Timestamp': datetime(2015, 1, 1),
                'Dimensions': [
                    {
                        'Name': 'string',
                        'Value': 'string'
                    },
                ],
                'Value': 123.0,
                'Unit': 'Seconds'|'Microseconds'|'Milliseconds'|'Bytes'|'Kilobytes'|'Megabytes'|'Gigabytes'|'Terabytes'|'Bits'|'Kilobits'|'Megabits'|'Gigabits'|'Terabits'|'Percent'|'Count'|'Bytes/Second'|'Kilobytes/Second'|'Megabytes/Second'|'Gigabytes/Second'|'Terabytes/Second'|'Bits/Second'|'Kilobits/Second'|'Megabits/Second'|'Gigabits/Second'|'Terabits/Second'|'Count/Second'|'None',
                'StatisticValues': {
                    'SampleCount': 123,
                    'Sum': 123.0,
                    'Minimum': 123.0,
                    'Maximum': 123.0
                }
            },
        ]
    )
    
  :type EnvironmentName: string
  :param EnvironmentName: **[REQUIRED]** 

    **Internal only**. The name of the environment.

    

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

    **Internal only**. Publishes metrics to Amazon CloudWatch. To learn more about the metrics published to Amazon CloudWatch, see `Amazon MWAA performance metrics in Amazon CloudWatch <https://docs.aws.amazon.com/mwaa/latest/userguide/cw-metrics.html>`__.

    

  
    - *(dict) --* 

      **Internal only**. Collects Apache Airflow metrics. To learn more about the metrics published to Amazon CloudWatch, see `Amazon MWAA performance metrics in Amazon CloudWatch <https://docs.aws.amazon.com/mwaa/latest/userguide/cw-metrics.html>`__.

      

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

        **Internal only**. The name of the metric.

        

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

        **Internal only**. The time the metric data was received.

        

      
      - **Dimensions** *(list) --* 

        **Internal only**. The dimensions associated with the metric.

        

      
        - *(dict) --* 

          **Internal only**. Represents the dimensions of a metric. To learn more about the metrics published to Amazon CloudWatch, see `Amazon MWAA performance metrics in Amazon CloudWatch <https://docs.aws.amazon.com/mwaa/latest/userguide/cw-metrics.html>`__.

          

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

            **Internal only**. The name of the dimension.

            

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

            **Internal only**. The value of the dimension.

            

          
        
    
      - **Value** *(float) --* 

        **Internal only**. The value for the metric.

        

      
      - **Unit** *(string) --* 

        **Internal only**. The unit used to store the metric.

        

      
      - **StatisticValues** *(dict) --* 

        **Internal only**. The statistical values for the metric.

        

      
        - **SampleCount** *(integer) --* 

          **Internal only**. The number of samples used for the statistic set.

          

        
        - **Sum** *(float) --* 

          **Internal only**. The sum of values for the sample set.

          

        
        - **Minimum** *(float) --* 

          **Internal only**. The minimum value of the sample set.

          

        
        - **Maximum** *(float) --* 

          **Internal only**. The maximum value of the sample set.

          

        
      
    

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

    
    ::

      {}
      
    **Response Structure**

    

    - *(dict) --* 
  
  **Exceptions**
  
  *   :py:class:`MWAA.Client.exceptions.ValidationException`

  
  *   :py:class:`MWAA.Client.exceptions.InternalServerException`

  