@SdkInternalApi
    final PublishMetricsResult executePublishMetrics(PublishMetricsRequest publishMetricsRequest) {

        ExecutionContext executionContext = createExecutionContext(publishMetricsRequest);
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
        awsRequestMetrics.startEvent(Field.ClientExecuteTime);
        Request<PublishMetricsRequest> request = null;
        Response<PublishMetricsResult> response = null;

        try {
            awsRequestMetrics.startEvent(Field.RequestMarshallTime);
            try {
                request = new PublishMetricsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(publishMetricsRequest));
                // Binds the request metrics to the current request.
                request.setAWSRequestMetrics(awsRequestMetrics);
                request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
                request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
                request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
                request.addHandlerContext(HandlerContextKey.SERVICE_ID, "MWAA");
                request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PublishMetrics");
                request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);

            } finally {
                awsRequestMetrics.endEvent(Field.RequestMarshallTime);
            }

            URI endpointTraitHost = null;
            if (!clientConfiguration.isDisableHostPrefixInjection()) {

                String hostPrefix = "ops.";
                String resolvedHostPrefix = String.format("ops.");

                endpointTraitHost = UriResourcePathUtils.updateUriHost(endpoint, resolvedHostPrefix);
            }

            HttpResponseHandler<AmazonWebServiceResponse<PublishMetricsResult>> responseHandler = protocolFactory.createResponseHandler(
                    new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new PublishMetricsResultJsonUnmarshaller());
            response = invoke(request, responseHandler, executionContext, null, endpointTraitHost);

            return response.getAwsResponse();

        } finally {

            endClientExecution(awsRequestMetrics, request, response);
        }
    }
<p>
<b>Internal only</b>. Publishes environment health metrics to Amazon CloudWatch.
</p>

@param publishMetricsRequest
@return Result of the PublishMetrics operation returned by the service.
@throws ValidationException
        ValidationException: The provided input is not valid.
@throws InternalServerException
        InternalServerException: An internal error has occurred.
@sample AmazonMWAA.PublishMetrics
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/mwaa-2020-07-01/PublishMetrics" target="_top">AWS API
     Documentation</a>
aws-java-sdk-mwaa/src/main/java/com/amazonaws/services/mwaa/AmazonMWAAClient.java