Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: outdated business metric ids #1113

Merged
merged 5 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -343,13 +343,13 @@ internal class InterceptorExecutor<I, O>(
) {
if (modifiedRequest.url != request.url) {
if (
context.executionContext.containsBusinessMetric(SmithyBusinessMetric.ACCOUNT_ID_BASED_ENDPOINT) &&
context.executionContext.containsBusinessMetric(SmithyBusinessMetric.ACCOUNT_ID_ENDPOINT) &&
!modifiedRequest.url.toString().contains(context.executionContext.attributes[AccountIdBasedEndpointAccountId])
) {
context.executionContext.removeBusinessMetric(SmithyBusinessMetric.ACCOUNT_ID_BASED_ENDPOINT)
context.executionContext.removeBusinessMetric(SmithyBusinessMetric.ACCOUNT_ID_ENDPOINT)
}
if (context.executionContext.containsBusinessMetric(SmithyBusinessMetric.SERVICE_ENDPOINT_OVERRIDE)) {
context.executionContext.removeBusinessMetric(SmithyBusinessMetric.SERVICE_ENDPOINT_OVERRIDE)
if (context.executionContext.containsBusinessMetric(SmithyBusinessMetric.ENDPOINT_OVERRIDE)) {
context.executionContext.removeBusinessMetric(SmithyBusinessMetric.ENDPOINT_OVERRIDE)
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions runtime/runtime-core/api/runtime-core.api
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ public final class aws/smithy/kotlin/runtime/businessmetrics/BusinessMetricsUtil
}

public final class aws/smithy/kotlin/runtime/businessmetrics/SmithyBusinessMetric : java/lang/Enum, aws/smithy/kotlin/runtime/businessmetrics/BusinessMetric {
public static final field ACCOUNT_ID_BASED_ENDPOINT Laws/smithy/kotlin/runtime/businessmetrics/SmithyBusinessMetric;
public static final field ACCOUNT_ID_ENDPOINT Laws/smithy/kotlin/runtime/businessmetrics/SmithyBusinessMetric;
public static final field ENDPOINT_OVERRIDE Laws/smithy/kotlin/runtime/businessmetrics/SmithyBusinessMetric;
public static final field GZIP_REQUEST_COMPRESSION Laws/smithy/kotlin/runtime/businessmetrics/SmithyBusinessMetric;
public static final field PAGINATOR Laws/smithy/kotlin/runtime/businessmetrics/SmithyBusinessMetric;
public static final field PROTOCOL_RPC_V2_CBOR Laws/smithy/kotlin/runtime/businessmetrics/SmithyBusinessMetric;
public static final field RETRY_MODE_ADAPTIVE Laws/smithy/kotlin/runtime/businessmetrics/SmithyBusinessMetric;
public static final field RETRY_MODE_STANDARD Laws/smithy/kotlin/runtime/businessmetrics/SmithyBusinessMetric;
public static final field SERVICE_ENDPOINT_OVERRIDE Laws/smithy/kotlin/runtime/businessmetrics/SmithyBusinessMetric;
public static final field SIGV4A_SIGNING Laws/smithy/kotlin/runtime/businessmetrics/SmithyBusinessMetric;
public static final field WAITER Laws/smithy/kotlin/runtime/businessmetrics/SmithyBusinessMetric;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public enum class SmithyBusinessMetric(public override val identifier: String) :
RETRY_MODE_ADAPTIVE("F"),
GZIP_REQUEST_COMPRESSION("L"),
PROTOCOL_RPC_V2_CBOR("M"),
SERVICE_ENDPOINT_OVERRIDE("N"),
ACCOUNT_ID_BASED_ENDPOINT("O"),
SIGV4A_SIGNING("P"),
ENDPOINT_OVERRIDE("N"),
ACCOUNT_ID_ENDPOINT("O"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also emit the new ACCOUNT_ID_MODE_PREFERRED, ACCOUNT_ID_MODE_DISABLED, ACCOUNT_ID_MODE_REQUIRED metrics?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, we can add that

SIGV4A_SIGNING("S"),
}
Loading