Skip to content

Commit 9b6e5f9

Browse files
authored
Merge branch 'main' into support_crac_on_powertools_metrics
2 parents 844dad7 + 0305642 commit 9b6e5f9

File tree

56 files changed

+171
-146
lines changed

Some content is hidden

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

56 files changed

+171
-146
lines changed

.github/workflows/security-scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,6 @@ jobs:
5252
path: results.sarif
5353
retention-days: 5
5454
- name: Upload to Code-Scanning
55-
uses: github/codeql-action/upload-sarif@d6bbdef45e766d081b84a2def353b0055f728d3e # v3.29.3
55+
uses: github/codeql-action/upload-sarif@4e828ff8d448a8a6e532957b1811f387a63867e8 # v3.29.4
5656
with:
5757
sarif_file: results.sarif

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@ Powertools for AWS Lambda (Java) is available in Maven Central. You can use your
2222
<dependency>
2323
<groupId>software.amazon.lambda</groupId>
2424
<artifactId>powertools-tracing</artifactId>
25-
<version>2.2.0</version>
25+
<version>2.2.1</version>
2626
</dependency>
2727
<dependency>
2828
<groupId>software.amazon.lambda</groupId>
2929
<artifactId>powertools-logging</artifactId>
30-
<version>2.2.0</version>
30+
<version>2.2.1</version>
3131
</dependency>
3232
<dependency>
3333
<groupId>software.amazon.lambda</groupId>
3434
<artifactId>powertools-metrics</artifactId>
35-
<version>2.2.0</version>
35+
<version>2.2.1</version>
3636
</dependency>
3737
...
3838
</dependencies>

docs/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM squidfunk/mkdocs-material@sha256:0bfdba448e93984191246f7a28abeacc79f789e7e9cf0c639a48fe4365e880a7
1+
FROM squidfunk/mkdocs-material@sha256:bb7b015690d9fb5ef0dbc98ca3520f153aa43129fb96aec5ca54c9154dc3b729
22

33
COPY requirements.txt /tmp/
44
RUN pip install --require-hashes -r /tmp/requirements.txt

examples/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
<groupId>software.amazon.lambda</groupId>
2222
<artifactId>powertools-examples</artifactId>
23-
<version>2.2.0</version>
23+
<version>2.2.1</version>
2424
<packaging>pom</packaging>
2525

2626
<name>Powertools for AWS Lambda (Java) - Examples</name>

examples/powertools-examples-batch/deploy/sqs/template.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ Resources:
6565
DemoSQSSenderFunction:
6666
Type: AWS::Serverless::Function
6767
Properties:
68+
Tracing: Active
6869
CodeUri: ../..
6970
Handler: org.demo.batch.sqs.SqsBatchSender::handleRequest
7071
Environment:
@@ -173,7 +174,6 @@ Resources:
173174
Action:
174175
- s3:PutObject
175176
Resource: !Sub ${Bucket.Arn}/*
176-
177177
Events:
178178
MySQSEvent:
179179
Type: SQS

examples/powertools-examples-batch/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<modelVersion>4.0.0</modelVersion>
66

77
<groupId>software.amazon.lambda.examples</groupId>
8-
<version>2.2.0</version>
8+
<version>2.2.1</version>
99
<artifactId>powertools-examples-batch</artifactId>
1010
<packaging>jar</packaging>
1111
<name>Powertools for AWS Lambda (Java) - Examples - Batch</name>
@@ -14,7 +14,7 @@
1414
<maven.compiler.source>11</maven.compiler.source>
1515
<maven.compiler.target>11</maven.compiler.target>
1616
<aspectj.version>1.9.20.1</aspectj.version>
17-
<sdk.version>2.31.78</sdk.version>
17+
<sdk.version>2.32.6</sdk.version>
1818
</properties>
1919

2020
<dependencies>

examples/powertools-examples-batch/src/main/java/org/demo/batch/sqs/AbstractSqsBatchHandler.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,22 @@
1414

1515
package org.demo.batch.sqs;
1616

17-
import com.amazonaws.services.lambda.runtime.Context;
18-
import com.fasterxml.jackson.databind.ObjectMapper;
1917
import java.io.File;
2018
import java.io.IOException;
2119
import java.util.Arrays;
2220
import java.util.Random;
21+
2322
import org.demo.batch.model.Product;
2423
import org.slf4j.Logger;
2524
import org.slf4j.LoggerFactory;
2625
import org.slf4j.MDC;
26+
27+
import com.fasterxml.jackson.databind.ObjectMapper;
28+
2729
import software.amazon.awssdk.core.sync.RequestBody;
2830
import software.amazon.awssdk.http.urlconnection.UrlConnectionHttpClient;
2931
import software.amazon.awssdk.services.s3.S3Client;
3032
import software.amazon.awssdk.services.s3.model.PutObjectRequest;
31-
import software.amazon.lambda.powertools.logging.Logging;
3233
import software.amazon.lambda.powertools.tracing.Tracing;
3334
import software.amazon.lambda.powertools.tracing.TracingUtils;
3435

@@ -43,23 +44,23 @@ public class AbstractSqsBatchHandler {
4344
* Simulate some processing (I/O + S3 put request)
4445
* @param p deserialized product
4546
*/
46-
@Logging
4747
@Tracing
4848
protected void processMessage(Product p) {
4949
TracingUtils.putAnnotation("productId", p.getId());
5050
TracingUtils.putAnnotation("Thread", Thread.currentThread().getName());
5151
MDC.put("product", String.valueOf(p.getId()));
5252
LOGGER.info("Processing product {}", p);
5353

54-
char c = (char)(r.nextInt(26) + 'a');
54+
char c = (char) (r.nextInt(26) + 'a');
5555
char[] chars = new char[1024 * 1000];
5656
Arrays.fill(chars, c);
5757
p.setName(new String(chars));
5858
try {
59-
File file = new File("/tmp/"+p.getId()+".json");
59+
File file = new File("/tmp/" + p.getId() + ".json");
6060
mapper.writeValue(file, p);
6161
s3.putObject(
62-
PutObjectRequest.builder().bucket(bucket).key(p.getId()+".json").build(), RequestBody.fromFile(file));
62+
PutObjectRequest.builder().bucket(bucket).key(p.getId() + ".json").build(),
63+
RequestBody.fromFile(file));
6364
} catch (IOException e) {
6465
throw new RuntimeException(e);
6566
} finally {

examples/powertools-examples-cloudformation/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Run the following in your shell:
1515
```bash
1616
cd infra/sam
1717
sam build
18-
sam deploy --guided --parameter-overrides BucketNameParam=my-unique-bucket-20230718
18+
sam deploy --guided --parameter-overrides BucketNameParam=my-unique-bucket-2.2.1718
1919
```
2020

2121
### Deploy with CDK
@@ -32,5 +32,5 @@ To build and deploy this application for the first time, run the following in yo
3232
cd infra/cdk
3333
mvn package
3434
cdk synth
35-
cdk deploy -c BucketNameParam=my-unique-bucket-20230718
35+
cdk deploy -c BucketNameParam=my-unique-bucket-2.2.1718
3636
```

examples/powertools-examples-cloudformation/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44

55
<groupId>software.amazon.lambda.examples</groupId>
6-
<version>2.2.0</version>
6+
<version>2.2.1</version>
77
<artifactId>powertools-examples-cloudformation</artifactId>
88
<packaging>jar</packaging>
99

@@ -13,7 +13,7 @@
1313
<maven.compiler.source>11</maven.compiler.source>
1414
<maven.compiler.target>11</maven.compiler.target>
1515
<lambda.core.version>1.3.0</lambda.core.version>
16-
<lambda.events.version>3.16.0</lambda.events.version>
16+
<lambda.events.version>3.16.1</lambda.events.version>
1717
<aws.sdk.version>2.32.5</aws.sdk.version>
1818
<aspectj.version>1.9.20.1</aspectj.version>
1919

examples/powertools-examples-core-utilities/cdk/app/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<groupId>software.amazon.lambda.examples</groupId>
77
<!-- TODO TODO TODO this should build from SNAPSHOT, but it doesn't, because the snapshots
88
don't appear in the docker environment CDK builds it in in our CDK tests. How to procede? V2 blocker -->
9-
<version>2.2.0</version>
9+
<version>2.2.1</version>
1010
<artifactId>powertools-examples-core-utilities-cdk</artifactId>
1111
<packaging>jar</packaging>
1212

@@ -41,7 +41,7 @@
4141
<dependency>
4242
<groupId>com.amazonaws</groupId>
4343
<artifactId>aws-lambda-java-events</artifactId>
44-
<version>3.16.0</version>
44+
<version>3.16.1</version>
4545
</dependency>
4646
<dependency>
4747
<groupId>org.apache.logging.log4j</groupId>

0 commit comments

Comments
 (0)