Skip to content

Commit

Permalink
Merge branch 'v2' into feat/validation-batch
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromevdl authored Aug 2, 2024
2 parents 503170a + 97e7c49 commit 92dec0e
Show file tree
Hide file tree
Showing 45 changed files with 1,978 additions and 534 deletions.
1 change: 0 additions & 1 deletion .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ name: Build Docs
on:
pull_request:
branches:
- main
- v2
paths:
- 'docs/**'
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/pr_artifacts_size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@ name: Artifacts Size
on:
pull_request:
branches:
- main
- v2
paths:
- 'powertools-batch/**'
- 'powertools-cloudformation/**'
- 'powertools-core/**' # not in v2
- 'powertools-common/**' # v2 only
- 'powertools-common/**'
- 'powertools-e2e-tests/**'
- 'powertools-idempotency-core/**'
- 'powertools-idempotency-dynamodb/**'
Expand All @@ -18,8 +16,6 @@ on:
- 'powertools-metrics/**'
- 'powertools-parameters/**'
- 'powertools-serialization/**'
- 'powertools-sqs/**' # not in v2
- 'powertools-test-suite/**' # not in v2
- 'powertools-tracing/**'
- 'powertools-validation/**'
- 'pom.xml'
Expand Down
18 changes: 6 additions & 12 deletions .github/workflows/pr_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,18 @@ name: Build
on:
pull_request:
branches:
- main
- v2
paths:
- 'powertools-batch/**'
- 'powertools-cloudformation/**'
- 'powertools-core/**'
- 'powertools-common/**'
- 'powertools-e2e-tests/**'
- 'powertools-idempotency/**'
- 'powertools-large-messages/**'
- 'powertools-logging/**'
- 'powertools-metrics/**'
- 'powertools-parameters/**'
- 'powertools-serialization/**'
- 'powertools-sqs/**'
- 'powertools-test-suite/**'
- 'powertools-tracing/**'
- 'powertools-validation/**'
- 'examples/**'
Expand All @@ -25,20 +23,18 @@ on:
- '.github/workflows/**'
push:
branches:
- main
- v2
paths:
- 'powertools-batch/**'
- 'powertools-cloudformation/**'
- 'powertools-core/**'
- 'powertools-common/**'
- 'powertools-e2e-tests/**'
- 'powertools-idempotency/**'
- 'powertools-large-messages/**'
- 'powertools-logging/**'
- 'powertools-metrics/**'
- 'powertools-parameters/**'
- 'powertools-serialization/**'
- 'powertools-sqs/**'
- 'powertools-test-suite/**'
- 'powertools-tracing/**'
- 'powertools-validation/**'
- 'examples/**'
Expand Down Expand Up @@ -70,12 +66,10 @@ jobs:
- name: Build with Maven
run: mvn -B install --file pom.xml
- name: Build Gradle Example - Java
if: ${{ matrix.java == '8' }} # Gradle example can only be built on Java 8
working-directory: examples/powertools-examples-core/gradle
working-directory: examples/powertools-examples-core-utilities/gradle
run: ./gradlew build
- name: Build Gradle Example - Kotlin
if: ${{ matrix.java == '8' }} # Gradle example can only be built on Java 8
working-directory: examples/powertools-examples-core/kotlin
working-directory: examples/powertools-examples-core-utilities/kotlin
run: ./gradlew build
- name: Upload coverage to Codecov
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1
Expand Down
93 changes: 0 additions & 93 deletions .github/workflows/pr_build_v2.yml

This file was deleted.

2 changes: 0 additions & 2 deletions .github/workflows/pr_iac_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ name: Validate IaC
on:
push:
branches:
- main
- v2
pull_request:
branches:
- main
- v2
paths:
- 'examples/**'
Expand Down
58 changes: 0 additions & 58 deletions .github/workflows/run-e2e-tests-v2.yml

This file was deleted.

8 changes: 3 additions & 5 deletions .github/workflows/run-e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

push:
branches:
- main
- v2
paths: # add other modules when there are under e2e tests
- 'powertools-e2e-tests/**'
- 'powertools-batch/**'
Expand All @@ -23,7 +23,7 @@ on:

pull_request:
branches:
- main
- v2
paths:
- 'powertools-e2e-tests/**'

Expand Down Expand Up @@ -54,7 +54,5 @@ jobs:
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN_TO_ASSUME }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
- name: Build with Maven
run: mvn -DskipTests install --file pom.xml
- name: Run e2e test with Maven
run: mvn -Pe2e -B verify --file powertools-e2e-tests/pom.xml
run: mvn -DskipTests install --file pom.xml && mvn -Pe2e -B verify --file powertools-e2e-tests/pom.xml
1 change: 0 additions & 1 deletion .github/workflows/spotbugs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ name: SpotBugs
on:
pull_request:
branches:
- main
- v2
paths:
- 'powertools-cloudformation/**'
Expand Down
20 changes: 18 additions & 2 deletions docs/core/tracing.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,24 @@ under a subsegment, or you are doing multithreaded programming. Refer examples b

## Instrumenting SDK clients and HTTP calls

User should make sure to instrument the SDK clients explicitly based on the function dependency. Refer details on
[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).
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
[how to instrument SDK client with Xray](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-java.html#xray-sdk-java-awssdkclients)
and [outgoing http calls](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-java.html#xray-sdk-java-httpclients). For example:

=== "LambdaHandler.java"

```java hl_lines="1 2 7"
import com.amazonaws.xray.AWSXRay;
import com.amazonaws.xray.handlers.TracingHandler;

public class LambdaHandler {
private AmazonDynamoDB client = AmazonDynamoDBClientBuilder.standard()
.withRegion(Regions.fromName(System.getenv("AWS_REGION")))
.withRequestHandlers(new TracingHandler(AWSXRay.getGlobalRecorder()))
.build();
// ...
}
```

## Testing your code

Expand Down
Loading

0 comments on commit 92dec0e

Please sign in to comment.