diff --git a/build_tools/aws-sdk-code-generator/templates/endpoints_plugin.mustache b/build_tools/aws-sdk-code-generator/templates/endpoints_plugin.mustache index 6cd71aa0281..a01193347d7 100644 --- a/build_tools/aws-sdk-code-generator/templates/endpoints_plugin.mustache +++ b/build_tools/aws-sdk-code-generator/templates/endpoints_plugin.mustache @@ -44,7 +44,7 @@ module {{module_name}} context[:auth_scheme] = Aws::Endpoints.resolve_auth_scheme(context, endpoint) - with_endpoint_metric(context[:endpoint_params]) do + with_endpoint_metric(context.config) do with_sigv4a_metric(context[:auth_scheme]) do @handler.call(context) end @@ -53,8 +53,8 @@ module {{module_name}} private - def with_endpoint_metric(endpoint_params, &block) - return block.call unless endpoint_params && endpoint_params[:endpoint] + def with_endpoint_metric(config, &block) + return block.call if config.regional_endpoint Aws::Plugins::UserAgent.metric('ENDPOINT_OVERRIDE', &block) end