Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/awslabs/aws-sdk-kotlin into…
Browse files Browse the repository at this point in the history
… smoke-tests-trait
  • Loading branch information
0marperez committed Nov 5, 2024
2 parents c9d266f + 5449093 commit d427f65
Show file tree
Hide file tree
Showing 11 changed files with 771 additions and 23 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## [1.3.67] - 11/01/2024

### Features
* (**bedrockagent**) Amazon Bedrock Knowledge Bases now supports using application inference profiles to increase throughput and improve resilience.
* (**cloudwatchlogs**) This release introduces an improvement in PutLogEvents
* (**docdbelastic**) Amazon DocumentDB Elastic Clusters adds support for pending maintenance actions feature with APIs GetPendingMaintenanceAction, ListPendingMaintenanceActions and ApplyPendingMaintenanceAction
* (**taxsettings**) Add support for supplemental tax registrations via these new APIs: PutSupplementalTaxRegistration, ListSupplementalTaxRegistrations, and DeleteSupplementalTaxRegistration.

## [1.3.66] - 10/31/2024

### Features
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ public class BusinessMetricsInterceptor : HttpInterceptor {
/**
* Makes sure the metrics do not exceed the maximum size and truncates them if so.
*/
private fun formatMetrics(metrics: MutableSet<String>): String {
private fun formatMetrics(metrics: MutableSet<BusinessMetric>): String {
if (metrics.isEmpty()) return ""
val metricsString = metrics.joinToString(",", "m/")
val metricsString = metrics.joinToString(",", "m/") { it.identifier }
val metricsByteArray = metricsString.encodeToByteArray()

if (metricsByteArray.size <= BUSINESS_METRICS_MAX_LENGTH) return metricsString
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package aws.sdk.kotlin.runtime.http.interceptors

import aws.sdk.kotlin.runtime.http.BUSINESS_METRICS_MAX_LENGTH
import aws.sdk.kotlin.runtime.http.middleware.USER_AGENT
import aws.smithy.kotlin.runtime.businessmetrics.BusinessMetric
import aws.smithy.kotlin.runtime.businessmetrics.SmithyBusinessMetric
import aws.smithy.kotlin.runtime.businessmetrics.emitBusinessMetric
import aws.smithy.kotlin.runtime.client.ProtocolRequestInterceptorContext
Expand Down Expand Up @@ -70,7 +71,11 @@ class BusinessMetricsInterceptorTest {
executionContext.attributes[aws.smithy.kotlin.runtime.businessmetrics.BusinessMetrics] = mutableSetOf()

for (i in 0..1024) {
executionContext.attributes[aws.smithy.kotlin.runtime.businessmetrics.BusinessMetrics].add(i.toString())
executionContext.emitBusinessMetric(
object : BusinessMetric {
override val identifier: String = i.toString()
},
)
}

val rawMetrics = executionContext[aws.smithy.kotlin.runtime.businessmetrics.BusinessMetrics]
Expand All @@ -91,9 +96,12 @@ class BusinessMetricsInterceptorTest {
@Test
fun malformedBusinessMetrics() = runTest {
val executionContext = ExecutionContext()
val reallyLongMetric = "All work and no play makes Jack a dull boy".repeat(1000)

executionContext.attributes[aws.smithy.kotlin.runtime.businessmetrics.BusinessMetrics] = mutableSetOf(
"A".repeat(BUSINESS_METRICS_MAX_LENGTH),
executionContext.attributes.emitBusinessMetric(
object : BusinessMetric {
override val identifier: String = reallyLongMetric
},
)

val interceptor = BusinessMetricsInterceptor()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16192,6 +16192,7 @@
"hostname" : "rekognition-fips.ca-central-1.amazonaws.com"
},
"eu-central-1" : { },
"eu-south-2" : { },
"eu-west-1" : { },
"eu-west-2" : { },
"il-central-1" : { },
Expand Down
6 changes: 3 additions & 3 deletions codegen/sdk/aws-models/bedrock-agent.json
Original file line number Diff line number Diff line change
Expand Up @@ -2005,7 +2005,7 @@
"min": 20,
"max": 2048
},
"smithy.api#pattern": "^(arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:(([0-9]{12}:custom-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}/[a-z0-9]{12})|(:foundation-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([.:]?[a-z0-9-]{1,63}))|([0-9]{12}:provisioned-model/[a-z0-9]{12})))|([a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([.:]?[a-z0-9-]{1,63}))|(([0-9a-zA-Z][_-]?)+)$"
"smithy.api#pattern": "^(arn:aws(-[^:]{1,12})?:(bedrock|sagemaker):[a-z0-9-]{1,20}:([0-9]{12})?:([a-z-]+/)?)?([a-zA-Z0-9.-]{1,63}){0,2}(([:][a-z0-9-]{1,63}){0,2})?(/[a-z0-9]{1,12})?$"
}
},
"com.amazonaws.bedrockagent#BedrockEmbeddingModelConfiguration": {
Expand Down Expand Up @@ -2050,7 +2050,7 @@
"min": 1,
"max": 2048
},
"smithy.api#pattern": "^arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}::foundation-model/([a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([.]?[a-z0-9-]{1,63})([:][a-z0-9-]{1,63}){0,2})|(arn:aws(|-us-gov|-cn|-iso|-iso-b):bedrock:(|[0-9a-z-]{1,20}):(|[0-9]{12}):inference-profile/[a-zA-Z0-9-:.]+)$"
"smithy.api#pattern": "^(arn:aws(-[^:]{1,12})?:(bedrock):[a-z0-9-]{1,20}:([0-9]{12})?:([a-z-]+/)?)?([a-zA-Z0-9.-]{1,63}){0,2}(([:][a-z0-9-]{1,63}){0,2})?(/[a-z0-9]{1,12})?$"
}
},
"com.amazonaws.bedrockagent#BucketOwnerAccountId": {
Expand Down Expand Up @@ -13621,7 +13621,7 @@
"embeddingModelArn": {
"target": "com.amazonaws.bedrockagent#BedrockEmbeddingModelArn",
"traits": {
"smithy.api#documentation": "<p>The Amazon Resource Name (ARN) of the model used to create vector embeddings for the knowledge base.</p>",
"smithy.api#documentation": "<p>The Amazon Resource Name (ARN) of the model or inference profile used to create vector embeddings for the knowledge base.</p>",
"smithy.api#required": {}
}
},
Expand Down
2 changes: 1 addition & 1 deletion codegen/sdk/aws-models/cloudwatch-logs.json
Original file line number Diff line number Diff line change
Expand Up @@ -3386,7 +3386,7 @@
"traits": {
"smithy.api#length": {
"min": 2,
"max": 3
"max": 4
}
}
},
Expand Down
Loading

0 comments on commit d427f65

Please sign in to comment.