Skip to content

Commit 6407b33

Browse files
committed
Merge branch 'develop'
* develop: (21 commits) bugfix: #32 Runtime Error for nested sync fns chore: renamed history to changelog dependabot bugfix: resolves #31 aiohttp lazy import chore: grammar issues improv: add project tenets Improv tracer - async support, patch, test coverage and X-Ray escape hatch (#29) Bugfix: "per second" metric units (#27) fix: #24 correct example test and docs chore: bump example to use 0.8.0 features Adopt logging best practices (#23) Decorator factory Feat: Create your own middleware (#17) chore: clean up CI workflows fix: CI attempt 4 fix: CI attempt 3 fix: CI attempt 3 fix: CI attempt 2 feat: add docs to CI chore: fix github badge typo chore: pypi monthly download badge fix: add missing single_metric example; test var name ...
2 parents 407fc34 + d18a6dd commit 6407b33

35 files changed

+2315
-789
lines changed

Diff for: README.md

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
11
# Lambda Powertools
22

3-
![PackageStatus](https://img.shields.io/static/v1?label=status&message=beta&color=blueviolet?style=flat-square) ![PythonSupport](https://img.shields.io/static/v1?label=python&message=3.6%20|%203.7|%203.8&color=blue?style=flat-square&logo=python)
3+
![Python Build](https://github.com/awslabs/aws-lambda-powertools/workflows/Powertools%20Python/badge.svg?branch=master)
44

55
A suite of utilities for AWS Lambda Functions that makes tracing with AWS X-Ray, structured logging and creating custom metrics asynchronously easier.
66

7+
## Tenets
8+
9+
* **AWS Lambda only** – We optimise for AWS Lambda function environments only. Utilities might work with web frameworks and non-Lambda environments, though they are not officially supported.
10+
* **Eases the adoption of best practices** – The main priority of the utilities is to facilitate best practices adoption, as defined in the AWS Well-Architected Serverless Lens; all other functionality is optional.
11+
* **Keep it lean** – Additional dependencies are carefully considered for security and ease of maintenance, and prevent negatively impacting startup time.
12+
* **We strive for backwards compatibility** – New features and changes should keep backwards compatibility. If a breaking change cannot be avoided, the deprecation and migration process should be clearly defined.
13+
* **We work backwards from the community** – We aim to strike a balance of what would work best for 80% of customers. Emerging practices are considered and discussed via Requests for Comment (RFCs)
14+
* **Idiomatic** – Utilities follow programming language idioms and language-specific best practices.
15+
16+
_`*` Core utilities are Tracer, Logger and Metrics. Optional utilities may vary across languages._
17+
718
## Powertools available
819

920
* [Python - Beta](./python/README.md)

Diff for: python/.flake8

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
exclude = docs, .eggs, setup.py, example, .aws-sam
33
ignore = E203, E266, W503, BLK100, W291, I004
44
max-line-length = 120
5-
max-complexity = 18
5+
max-complexity = 15
66

77
[isort]
88
multi_line_output = 3
99
include_trailing_comma = true
1010
force_grid_wrap = 0
1111
use_parentheses = true
1212
line_length = 120
13-

Diff for: python/CHANGELOG.md

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# HISTORY
2+
3+
## May 16th
4+
5+
**0.9.3**
6+
7+
* **Tracer**: Bugfix - Runtime Error for nested sync due to incorrect loop usage
8+
9+
## May 14th
10+
11+
**0.9.2**
12+
13+
* **Tracer**: Bugfix - aiohttp lazy import so it's not a hard dependency
14+
15+
## May 12th
16+
17+
**0.9.0**
18+
19+
* **Tracer**: Support for async functions in `Tracer` via `capture_method` decorator
20+
* **Tracer**: Support for `aiohttp` via `aiohttp_trace_config` trace config
21+
* **Tracer**: Support for patching specific modules via `patch_modules` param
22+
* **Tracer**: Document escape hatch mechanisms via `tracer.provider`
23+
24+
## May 1st
25+
26+
**0.8.1**
27+
28+
* **Metrics**: Fix metric unit casting logic if one passes plain string (value or key)
29+
* **Metrics: **Fix `MetricUnit` enum values for
30+
- `BytesPerSecond`
31+
- `KilobytesPerSecond`
32+
- `MegabytesPerSecond`
33+
- `GigabytesPerSecond`
34+
- `TerabytesPerSecond`
35+
- `BitsPerSecond`
36+
- `KilobitsPerSecond`
37+
- `MegabitsPerSecond`
38+
- `GigabitsPerSecond`
39+
- `TerabitsPerSecond`
40+
- `CountPerSecond`
41+
42+
## April 24th
43+
44+
**0.8.0**
45+
46+
* **Logger**: Introduces `Logger` class for stuctured logging as a replacement for `logger_setup`
47+
* **Logger**: Introduces `Logger.inject_lambda_context` decorator as a replacement for `logger_inject_lambda_context`
48+
* **Logger**: Raise `DeprecationWarning` exception for both `logger_setup`, `logger_inject_lambda_context`
49+
50+
## April 20th, 2020
51+
52+
**0.7.0**
53+
54+
* **Middleware factory**: Introduces Middleware Factory to build your own middleware via `lambda_handler_decorator`
55+
* **Metrics**: Fixes metrics dimensions not being included correctly in EMF
56+
57+
## April 9th, 2020
58+
59+
**0.6.3**
60+
61+
* **Logger**: Fix `log_metrics` decorator logic not calling the decorated function, and exception handling
62+
63+
## April 8th, 2020
64+
65+
**0.6.1**
66+
67+
* **Metrics**: Introduces Metrics middleware to utilise CloudWatch Embedded Metric Format
68+
* **Metrics**: Adds deprecation warning for `log_metrics`
69+
70+
## February 20th, 2020
71+
72+
**0.5.0**
73+
74+
* **Logger**: Introduces log sampling for debug - Thanks to [Danilo's contribution](https://github.com/awslabs/aws-lambda-powertools/pull/7)
75+
76+
## November 15th, 2019
77+
78+
* Public beta release

Diff for: python/HISTORY.md

-31
This file was deleted.

Diff for: python/Makefile

+10-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ test:
2020
coverage-html:
2121
poetry run pytest --cov-report html
2222

23-
pr: lint test
23+
pr: lint test security-baseline complexity-baseline
2424

2525
build: pr
2626
poetry run build
@@ -31,6 +31,15 @@ docs: dev
3131
docs-dev:
3232
poetry run pdoc --http : aws_lambda_powertools
3333

34+
security-baseline:
35+
poetry run bandit --baseline bandit.baseline -r aws_lambda_powertools
36+
37+
complexity-baseline:
38+
$(info Maintenability index)
39+
poetry run radon mi aws_lambda_powertools
40+
$(info Cyclomatic complexity index)
41+
poetry run xenon --max-absolute C --max-modules A --max-average A aws_lambda_powertools
42+
3443
#
3544
# Use `poetry version <major>/<minor></patch>` for version bump
3645
#

0 commit comments

Comments
 (0)