Skip to content

Commit 20e8c6e

Browse files
committed
Merge branch 'disable-smoke-tests' of https://github.com/awslabs/aws-sdk-kotlin into disable-smoke-tests
2 parents 2f81d23 + d51d179 commit 20e8c6e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+38643
-4437
lines changed

CHANGELOG.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,56 @@
11
# Changelog
22

3+
## [1.3.86] - 12/03/2024
4+
5+
### Features
6+
* (**bedrockruntime**) Add an API parameter that allows customers to set performance configuration for invoking a model.
7+
* (**s3control**) It allows customers to pass CRC64NVME as a header in S3 Batch Operations copy requests
8+
* (**socialmessaging**) Added support for passing role arn corresponding to the supported event destination
9+
10+
## [1.3.85] - 12/02/2024
11+
12+
### Features
13+
* (**bedrock**) Add support for Knowledge Base Evaluations & LLM as a judge
14+
* (**bedrockagent**) This release introduces APIs to upload documents directly into a Knowledge Base
15+
* (**bedrockagentruntime**) This release introduces a new Rerank API to leverage reranking models (with integration into Knowledge Bases); APIs to upload documents directly into Knowledge Base; RetrieveAndGenerateStream API for streaming response; Guardrails on Retrieve API; and ability to automatically generate filters
16+
* (**chimesdkvoice**) This release adds supports for enterprises to integrate Amazon Connect with other voice systems. It supports directly transferring voice calls and metadata without using the public telephone network. It also supports real-time and post-call analytics.
17+
* (**cleanrooms**) This release allows customers and their partners to easily collaborate with data stored in Snowflake and Amazon Athena, without having to move or share their underlying data among collaborators.
18+
* (**cloudwatchlogs**) Adds PutIntegration, GetIntegration, ListIntegrations and DeleteIntegration APIs. Adds QueryLanguage support to StartQuery, GetQueryResults, DescribeQueries, DescribeQueryDefinitions, and PutQueryDefinition APIs.
19+
* (**connect**) Adds support for WhatsApp Business messaging, IVR call recording, enabling Contact Lens for existing on-premise contact centers and telephony platforms, and enabling telephony and IVR migration to Amazon Connect independent of their contact center agents.
20+
* (**connectcampaignsv2**) Amazon Connect Outbound Campaigns V2 / Features : Adds support for Event-Triggered Campaigns.
21+
* (**customerprofiles**) This release introduces Event Trigger APIs as part of Amazon Connect Customer Profiles service.
22+
* (**ec2**) Adds support for declarative policies that allow you to enforce desired configuration across an AWS organization through configuring account attributes. Adds support for Allowed AMIs that allows you to limit the use of AMIs in AWS accounts. Adds support for connectivity over non-HTTP protocols.
23+
* (**eks**) Added support for Auto Mode Clusters, Hybrid Nodes, and specifying computeTypes in the DescribeAddonVersions API.
24+
* (**eventbridge**) Call private APIs by configuring Connections with VPC connectivity through PrivateLink and VPC Lattice
25+
* (**fsx**) FSx API changes to support the public launch of the Amazon FSx Intelligent Tiering for OpenZFS storage class.
26+
* (**guardduty**) Add new Multi Domain Correlation findings.
27+
* (**imagebuilder**) Added support for EC2 Image Builder's integration with AWS Marketplace for Marketplace components.
28+
* (**invoicing**) AWS Invoice Configuration allows you to receive separate AWS invoices based on your organizational needs. You can use the AWS SDKs to manage Invoice Units and programmatically fetch the information of the invoice receiver.
29+
* (**memorydb**) Amazon MemoryDB SDK now supports all APIs for Multi-Region. Please refer to the updated Amazon MemoryDB public documentation for detailed information on API usage.
30+
* (**networkflowmonitor**) This release adds documentation for a new feature in Amazon CloudWatch called Network Flow Monitor. You can use Network Flow Monitor to get near real-time metrics, including retransmissions and data transferred, for your actual workloads.
31+
* (**opensearch**) This feature introduces support for CRUDL APIs, enabling the creation and management of Connected data sources.
32+
* (**organizations**) Add support for policy operations on the DECLARATIVE_POLICY_EC2 policy type.
33+
* (**qbusiness**) Amazon Q Business now supports capabilities to extract insights and answer questions from visual elements embedded within documents, a browser extension for Google Chrome, Mozilla Firefox, and Microsoft Edge, and attachments across conversations.
34+
* (**qconnect**) This release adds following capabilities: Configuring safeguards via AIGuardrails for Q in Connect inferencing, and APIs to support Q&A self-service use cases
35+
* (**rds**) Amazon RDS supports CloudWatch Database Insights. You can use the SDK to create, modify, and describe the DatabaseInsightsMode for your DB instances and clusters.
36+
* (**s3**) Amazon S3 introduces support for AWS Dedicated Local Zones
37+
* (**s3control**) Amazon S3 introduces support for AWS Dedicated Local Zones
38+
* (**securityhub**) Add new Multi Domain Correlation findings.
39+
* (**securityir**) AWS Security Incident Response is a purpose-built security incident solution designed to help customers prepare for, respond to, and recover from security incidents.
40+
* (**transfer**) AWS Transfer Family now offers Web apps that enables simple and secure access to data stored in Amazon S3.
41+
* (**vpclattice**) Lattice APIs that allow sharing and access of VPC resources across accounts.
42+
43+
### Documentation
44+
* (**ecs**) This release adds support for Container Insights with Enhanced Observability for Amazon ECS.
45+
46+
## [1.3.84] - 11/27/2024
47+
48+
### Features
49+
* (**bedrockagent**) Add support for specifying embeddingDataType, either FLOAT32 or BINARY
50+
* (**configservice**) AWS Config adds support for service-linked recorders, a new type of Config recorder managed by AWS services to record specific subsets of resource configuration data and functioning independently from customer managed AWS Config recorders.
51+
* (**fsx**) This release adds EFA support to increase FSx for Lustre file systems' throughput performance to a single client instance. This can be done by specifying EfaEnabled=true at the time of creation of Persistent_2 file systems.
52+
* (**observabilityadmin**) Amazon CloudWatch Observability Admin adds the ability to audit telemetry configuration for AWS resources in customers AWS Accounts and Organizations. The release introduces new APIs to turn on/off the new experience, which supports discovering supported AWS resources and their state of telemetry.
53+
354
## [1.3.83] - 11/26/2024
455

556
### Features

aws-runtime/aws-http/api/aws-http.api

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ public final class aws/sdk/kotlin/runtime/http/interceptors/AwsBusinessMetric :
145145
public static final field S3_EXPRESS_BUCKET Laws/sdk/kotlin/runtime/http/interceptors/AwsBusinessMetric;
146146
public static fun getEntries ()Lkotlin/enums/EnumEntries;
147147
public fun getIdentifier ()Ljava/lang/String;
148+
public fun toString ()Ljava/lang/String;
148149
public static fun valueOf (Ljava/lang/String;)Laws/sdk/kotlin/runtime/http/interceptors/AwsBusinessMetric;
149150
public static fun values ()[Laws/sdk/kotlin/runtime/http/interceptors/AwsBusinessMetric;
150151
}

aws-runtime/aws-http/common/src/aws/sdk/kotlin/runtime/http/interceptors/BusinessMetricsInterceptor.kt

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,19 @@ import aws.smithy.kotlin.runtime.client.ProtocolRequestInterceptorContext
1313
import aws.smithy.kotlin.runtime.http.interceptors.HttpInterceptor
1414
import aws.smithy.kotlin.runtime.http.request.HttpRequest
1515
import aws.smithy.kotlin.runtime.http.request.toBuilder
16+
import aws.smithy.kotlin.runtime.telemetry.logging.Logger
17+
import aws.smithy.kotlin.runtime.telemetry.logging.logger
18+
import kotlin.coroutines.coroutineContext
1619

1720
/**
1821
* Appends business metrics to the `User-Agent` header.
1922
*/
2023
public class BusinessMetricsInterceptor : HttpInterceptor {
2124
override suspend fun modifyBeforeTransmit(context: ProtocolRequestInterceptorContext<Any, HttpRequest>): HttpRequest {
25+
val logger = coroutineContext.logger<BusinessMetricsInterceptor>()
26+
2227
context.executionContext.getOrNull(BusinessMetrics)?.let { metrics ->
23-
val metricsString = formatMetrics(metrics)
28+
val metricsString = formatMetrics(metrics, logger)
2429
val currentUserAgentHeader = context.protocolRequest.headers[USER_AGENT]
2530
val modifiedRequest = context.protocolRequest.toBuilder()
2631

@@ -34,10 +39,22 @@ public class BusinessMetricsInterceptor : HttpInterceptor {
3439

3540
/**
3641
* Makes sure the metrics do not exceed the maximum size and truncates them if so.
42+
* Makes sure that metric identifiers are not > 2 chars in length. Skips them if so.
3743
*/
38-
private fun formatMetrics(metrics: MutableSet<BusinessMetric>): String {
39-
if (metrics.isEmpty()) return ""
40-
val metricsString = metrics.joinToString(",", "m/") { it.identifier }
44+
private fun formatMetrics(metrics: MutableSet<BusinessMetric>, logger: Logger): String {
45+
val allowedMetrics = metrics.filter {
46+
if (it.identifier.length > 2) {
47+
logger.warn {
48+
"Business metric '${it.identifier}' will be skipped due to length being > 2. " +
49+
"This is likely a bug. Please raise an issue at https://github.com/awslabs/aws-sdk-kotlin/issues/new/choose"
50+
}
51+
false
52+
} else {
53+
true
54+
}
55+
}
56+
if (allowedMetrics.isEmpty()) return ""
57+
val metricsString = allowedMetrics.joinToString(",", "m/") { it.identifier }
4158
val metricsByteArray = metricsString.encodeToByteArray()
4259

4360
if (metricsByteArray.size <= BUSINESS_METRICS_MAX_LENGTH) return metricsString
@@ -65,4 +82,7 @@ private fun formatMetrics(metrics: MutableSet<BusinessMetric>): String {
6582
public enum class AwsBusinessMetric(public override val identifier: String) : BusinessMetric {
6683
S3_EXPRESS_BUCKET("J"),
6784
DDB_MAPPER("d"),
85+
;
86+
87+
override fun toString(): String = identifier
6888
}

aws-runtime/aws-http/common/test/aws/sdk/kotlin/runtime/http/interceptors/BusinessMetricsInterceptorTest.kt

Lines changed: 47 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,12 @@ import aws.smithy.kotlin.runtime.businessmetrics.BusinessMetric
1010
import aws.smithy.kotlin.runtime.businessmetrics.SmithyBusinessMetric
1111
import aws.smithy.kotlin.runtime.businessmetrics.emitBusinessMetric
1212
import aws.smithy.kotlin.runtime.client.ProtocolRequestInterceptorContext
13-
import aws.smithy.kotlin.runtime.collections.get
1413
import aws.smithy.kotlin.runtime.http.*
1514
import aws.smithy.kotlin.runtime.http.request.HttpRequest
1615
import aws.smithy.kotlin.runtime.net.url.Url
1716
import aws.smithy.kotlin.runtime.operation.ExecutionContext
1817
import kotlinx.coroutines.test.runTest
19-
import kotlin.test.Test
20-
import kotlin.test.assertFailsWith
21-
import kotlin.test.assertFalse
22-
import kotlin.test.assertTrue
18+
import kotlin.test.*
2319

2420
class BusinessMetricsInterceptorTest {
2521
@Test
@@ -32,6 +28,23 @@ class BusinessMetricsInterceptorTest {
3228
assertFalse(userAgentHeader.endsWith("m/"))
3329
}
3430

31+
@Test
32+
fun noValidBusinessMetrics() = runTest {
33+
val executionContext = ExecutionContext()
34+
35+
val invalidBusinessMetric = object : BusinessMetric {
36+
override val identifier: String = "All work and no play makes Jack a dull boy".repeat(1000)
37+
}
38+
39+
executionContext.emitBusinessMetric(invalidBusinessMetric)
40+
41+
val interceptor = BusinessMetricsInterceptor()
42+
val request = interceptor.modifyBeforeTransmit(interceptorContext(executionContext))
43+
val userAgentHeader = request.headers[USER_AGENT]!!
44+
45+
assertFalse(userAgentHeader.endsWith("m/"))
46+
}
47+
3548
@Test
3649
fun businessMetrics() = runTest {
3750
val executionContext = ExecutionContext()
@@ -66,49 +79,57 @@ class BusinessMetricsInterceptorTest {
6679
}
6780

6881
@Test
69-
fun truncateBusinessMetrics() = runTest {
82+
fun businessMetricsMaxLength() = runTest {
7083
val executionContext = ExecutionContext()
7184
executionContext.attributes[aws.smithy.kotlin.runtime.businessmetrics.BusinessMetrics] = mutableSetOf()
7285

73-
for (i in 0..1024) {
86+
for (i in 0..BUSINESS_METRICS_MAX_LENGTH) {
7487
executionContext.emitBusinessMetric(
7588
object : BusinessMetric {
7689
override val identifier: String = i.toString()
7790
},
7891
)
7992
}
8093

81-
val rawMetrics = executionContext[aws.smithy.kotlin.runtime.businessmetrics.BusinessMetrics]
82-
val rawMetricsString = rawMetrics.joinToString(",", "m/")
83-
val rawMetricsByteArray = rawMetricsString.encodeToByteArray()
84-
85-
assertTrue(rawMetricsByteArray.size >= BUSINESS_METRICS_MAX_LENGTH)
86-
8794
val interceptor = BusinessMetricsInterceptor()
8895
val request = interceptor.modifyBeforeTransmit(interceptorContext(executionContext))
8996
val userAgentHeader = request.headers[USER_AGENT]!!
90-
val truncatedMetrics = "m/" + userAgentHeader.substringAfter("m/")
97+
val metrics = "m/" + userAgentHeader.substringAfter("m/")
9198

92-
assertTrue(truncatedMetrics.encodeToByteArray().size <= BUSINESS_METRICS_MAX_LENGTH)
93-
assertFalse(truncatedMetrics.endsWith(","))
99+
assertTrue(metrics.encodeToByteArray().size <= BUSINESS_METRICS_MAX_LENGTH)
100+
assertFalse(metrics.endsWith(","))
94101
}
95102

96103
@Test
97-
fun malformedBusinessMetrics() = runTest {
104+
fun invalidBusinessMetric() = runTest {
98105
val executionContext = ExecutionContext()
99-
val reallyLongMetric = "All work and no play makes Jack a dull boy".repeat(1000)
100106

101-
executionContext.attributes.emitBusinessMetric(
102-
object : BusinessMetric {
103-
override val identifier: String = reallyLongMetric
104-
},
105-
)
107+
val validMetric = AwsBusinessMetric.S3_EXPRESS_BUCKET
108+
val invalidMetric = object : BusinessMetric {
109+
override val identifier: String = "All work and no play makes Jack a dull boy".repeat(1000)
110+
}
111+
112+
executionContext.attributes.emitBusinessMetric(validMetric)
113+
executionContext.attributes.emitBusinessMetric(invalidMetric)
106114

107115
val interceptor = BusinessMetricsInterceptor()
116+
val request = interceptor.modifyBeforeTransmit(interceptorContext(executionContext))
117+
val userAgentHeader = request.headers[USER_AGENT]!!
108118

109-
assertFailsWith<IllegalStateException>("Business metrics are incorrectly formatted:") {
110-
interceptor.modifyBeforeTransmit(interceptorContext(executionContext))
111-
}
119+
assertTrue(
120+
userAgentHeader.contains(validMetric.identifier),
121+
)
122+
assertFalse(
123+
userAgentHeader.contains(invalidMetric.identifier),
124+
)
125+
}
126+
127+
@Test
128+
fun businessMetricToString() {
129+
val businessMetricToString = AwsBusinessMetric.S3_EXPRESS_BUCKET.toString()
130+
val businessMetricIdentifier = AwsBusinessMetric.S3_EXPRESS_BUCKET.identifier
131+
132+
assertEquals(businessMetricIdentifier, businessMetricToString)
112133
}
113134
}
114135

0 commit comments

Comments
 (0)