Skip to content

Commit 92dec0e

Browse files
authored
Merge branch 'v2' into feat/validation-batch
2 parents 503170a + 97e7c49 commit 92dec0e

File tree

45 files changed

+1978
-534
lines changed

Some content is hidden

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

45 files changed

+1978
-534
lines changed

.github/workflows/build-docs.yml

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ name: Build Docs
33
on:
44
pull_request:
55
branches:
6-
- main
76
- v2
87
paths:
98
- 'docs/**'

.github/workflows/pr_artifacts_size.yml

+1-5
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@ name: Artifacts Size
33
on:
44
pull_request:
55
branches:
6-
- main
76
- v2
87
paths:
98
- 'powertools-batch/**'
109
- 'powertools-cloudformation/**'
11-
- 'powertools-core/**' # not in v2
12-
- 'powertools-common/**' # v2 only
10+
- 'powertools-common/**'
1311
- 'powertools-e2e-tests/**'
1412
- 'powertools-idempotency-core/**'
1513
- 'powertools-idempotency-dynamodb/**'
@@ -18,8 +16,6 @@ on:
1816
- 'powertools-metrics/**'
1917
- 'powertools-parameters/**'
2018
- 'powertools-serialization/**'
21-
- 'powertools-sqs/**' # not in v2
22-
- 'powertools-test-suite/**' # not in v2
2319
- 'powertools-tracing/**'
2420
- 'powertools-validation/**'
2521
- 'pom.xml'

.github/workflows/pr_build.yml

+6-12
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,18 @@ name: Build
33
on:
44
pull_request:
55
branches:
6-
- main
6+
- v2
77
paths:
88
- 'powertools-batch/**'
99
- 'powertools-cloudformation/**'
10-
- 'powertools-core/**'
10+
- 'powertools-common/**'
1111
- 'powertools-e2e-tests/**'
1212
- 'powertools-idempotency/**'
1313
- 'powertools-large-messages/**'
1414
- 'powertools-logging/**'
1515
- 'powertools-metrics/**'
1616
- 'powertools-parameters/**'
1717
- 'powertools-serialization/**'
18-
- 'powertools-sqs/**'
19-
- 'powertools-test-suite/**'
2018
- 'powertools-tracing/**'
2119
- 'powertools-validation/**'
2220
- 'examples/**'
@@ -25,20 +23,18 @@ on:
2523
- '.github/workflows/**'
2624
push:
2725
branches:
28-
- main
26+
- v2
2927
paths:
3028
- 'powertools-batch/**'
3129
- 'powertools-cloudformation/**'
32-
- 'powertools-core/**'
30+
- 'powertools-common/**'
3331
- 'powertools-e2e-tests/**'
3432
- 'powertools-idempotency/**'
3533
- 'powertools-large-messages/**'
3634
- 'powertools-logging/**'
3735
- 'powertools-metrics/**'
3836
- 'powertools-parameters/**'
3937
- 'powertools-serialization/**'
40-
- 'powertools-sqs/**'
41-
- 'powertools-test-suite/**'
4238
- 'powertools-tracing/**'
4339
- 'powertools-validation/**'
4440
- 'examples/**'
@@ -70,12 +66,10 @@ jobs:
7066
- name: Build with Maven
7167
run: mvn -B install --file pom.xml
7268
- name: Build Gradle Example - Java
73-
if: ${{ matrix.java == '8' }} # Gradle example can only be built on Java 8
74-
working-directory: examples/powertools-examples-core/gradle
69+
working-directory: examples/powertools-examples-core-utilities/gradle
7570
run: ./gradlew build
7671
- name: Build Gradle Example - Kotlin
77-
if: ${{ matrix.java == '8' }} # Gradle example can only be built on Java 8
78-
working-directory: examples/powertools-examples-core/kotlin
72+
working-directory: examples/powertools-examples-core-utilities/kotlin
7973
run: ./gradlew build
8074
- name: Upload coverage to Codecov
8175
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1

.github/workflows/pr_build_v2.yml

-93
This file was deleted.

.github/workflows/pr_iac_lint.yml

-2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@ name: Validate IaC
33
on:
44
push:
55
branches:
6-
- main
76
- v2
87
pull_request:
98
branches:
10-
- main
119
- v2
1210
paths:
1311
- 'examples/**'

.github/workflows/run-e2e-tests-v2.yml

-58
This file was deleted.

.github/workflows/run-e2e-tests.yml

+3-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55

66
push:
77
branches:
8-
- main
8+
- v2
99
paths: # add other modules when there are under e2e tests
1010
- 'powertools-e2e-tests/**'
1111
- 'powertools-batch/**'
@@ -23,7 +23,7 @@ on:
2323

2424
pull_request:
2525
branches:
26-
- main
26+
- v2
2727
paths:
2828
- 'powertools-e2e-tests/**'
2929

@@ -54,7 +54,5 @@ jobs:
5454
with:
5555
role-to-assume: ${{ secrets.AWS_ROLE_ARN_TO_ASSUME }}
5656
aws-region: ${{ env.AWS_DEFAULT_REGION }}
57-
- name: Build with Maven
58-
run: mvn -DskipTests install --file pom.xml
5957
- name: Run e2e test with Maven
60-
run: mvn -Pe2e -B verify --file powertools-e2e-tests/pom.xml
58+
run: mvn -DskipTests install --file pom.xml && mvn -Pe2e -B verify --file powertools-e2e-tests/pom.xml

.github/workflows/spotbugs.yml

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ name: SpotBugs
33
on:
44
pull_request:
55
branches:
6-
- main
76
- v2
87
paths:
98
- 'powertools-cloudformation/**'

docs/core/tracing.md

+18-2
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,24 @@ under a subsegment, or you are doing multithreaded programming. Refer examples b
308308

309309
## Instrumenting SDK clients and HTTP calls
310310

311-
User should make sure to instrument the SDK clients explicitly based on the function dependency. Refer details on
312-
[how to instrument SDK client with Xray](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-java-awssdkclients.html) and [outgoing http calls](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-java-httpclients.html).
311+
Powertools for Lambda (Java) cannot intercept SDK clients instantiation to add X-Ray instrumentation. You should make sure to instrument the SDK clients explicitly. Refer details on
312+
[how to instrument SDK client with Xray](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-java.html#xray-sdk-java-awssdkclients)
313+
and [outgoing http calls](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-java.html#xray-sdk-java-httpclients). For example:
314+
315+
=== "LambdaHandler.java"
316+
317+
```java hl_lines="1 2 7"
318+
import com.amazonaws.xray.AWSXRay;
319+
import com.amazonaws.xray.handlers.TracingHandler;
320+
321+
public class LambdaHandler {
322+
private AmazonDynamoDB client = AmazonDynamoDBClientBuilder.standard()
323+
.withRegion(Regions.fromName(System.getenv("AWS_REGION")))
324+
.withRequestHandlers(new TracingHandler(AWSXRay.getGlobalRecorder()))
325+
.build();
326+
// ...
327+
}
328+
```
313329

314330
## Testing your code
315331

0 commit comments

Comments
 (0)