Skip to content

Commit

Permalink
Use regional endpoint config for setting metric
Browse files Browse the repository at this point in the history
  • Loading branch information
mullermp committed Sep 6, 2024
1 parent 0cdb3dd commit 856caf2
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 856caf2

Please sign in to comment.