Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
* 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
  ...
  • Loading branch information
heitorlessa committed May 16, 2020
2 parents 407fc34 + d18a6dd commit 6407b33
Show file tree
Hide file tree
Showing 35 changed files with 2,315 additions and 789 deletions.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
# Lambda Powertools

![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)
![Python Build](https://github.com/awslabs/aws-lambda-powertools/workflows/Powertools%20Python/badge.svg?branch=master)

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

## Tenets

* **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.
* **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.
* **Keep it lean** – Additional dependencies are carefully considered for security and ease of maintenance, and prevent negatively impacting startup time.
* **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.
* **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)
* **Idiomatic** – Utilities follow programming language idioms and language-specific best practices.

_`*` Core utilities are Tracer, Logger and Metrics. Optional utilities may vary across languages._

## Powertools available

* [Python - Beta](./python/README.md)
Expand Down
3 changes: 1 addition & 2 deletions python/.flake8
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
exclude = docs, .eggs, setup.py, example, .aws-sam
ignore = E203, E266, W503, BLK100, W291, I004
max-line-length = 120
max-complexity = 18
max-complexity = 15

[isort]
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
line_length = 120

78 changes: 78 additions & 0 deletions python/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# HISTORY

## May 16th

**0.9.3**

* **Tracer**: Bugfix - Runtime Error for nested sync due to incorrect loop usage

## May 14th

**0.9.2**

* **Tracer**: Bugfix - aiohttp lazy import so it's not a hard dependency

## May 12th

**0.9.0**

* **Tracer**: Support for async functions in `Tracer` via `capture_method` decorator
* **Tracer**: Support for `aiohttp` via `aiohttp_trace_config` trace config
* **Tracer**: Support for patching specific modules via `patch_modules` param
* **Tracer**: Document escape hatch mechanisms via `tracer.provider`

## May 1st

**0.8.1**

* **Metrics**: Fix metric unit casting logic if one passes plain string (value or key)
* **Metrics: **Fix `MetricUnit` enum values for
- `BytesPerSecond`
- `KilobytesPerSecond`
- `MegabytesPerSecond`
- `GigabytesPerSecond`
- `TerabytesPerSecond`
- `BitsPerSecond`
- `KilobitsPerSecond`
- `MegabitsPerSecond`
- `GigabitsPerSecond`
- `TerabitsPerSecond`
- `CountPerSecond`

## April 24th

**0.8.0**

* **Logger**: Introduces `Logger` class for stuctured logging as a replacement for `logger_setup`
* **Logger**: Introduces `Logger.inject_lambda_context` decorator as a replacement for `logger_inject_lambda_context`
* **Logger**: Raise `DeprecationWarning` exception for both `logger_setup`, `logger_inject_lambda_context`

## April 20th, 2020

**0.7.0**

* **Middleware factory**: Introduces Middleware Factory to build your own middleware via `lambda_handler_decorator`
* **Metrics**: Fixes metrics dimensions not being included correctly in EMF

## April 9th, 2020

**0.6.3**

* **Logger**: Fix `log_metrics` decorator logic not calling the decorated function, and exception handling

## April 8th, 2020

**0.6.1**

* **Metrics**: Introduces Metrics middleware to utilise CloudWatch Embedded Metric Format
* **Metrics**: Adds deprecation warning for `log_metrics`

## February 20th, 2020

**0.5.0**

* **Logger**: Introduces log sampling for debug - Thanks to [Danilo's contribution](https://github.com/awslabs/aws-lambda-powertools/pull/7)

## November 15th, 2019

* Public beta release
31 changes: 0 additions & 31 deletions python/HISTORY.md

This file was deleted.

11 changes: 10 additions & 1 deletion python/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ test:
coverage-html:
poetry run pytest --cov-report html

pr: lint test
pr: lint test security-baseline complexity-baseline

build: pr
poetry run build
Expand All @@ -31,6 +31,15 @@ docs: dev
docs-dev:
poetry run pdoc --http : aws_lambda_powertools

security-baseline:
poetry run bandit --baseline bandit.baseline -r aws_lambda_powertools

complexity-baseline:
$(info Maintenability index)
poetry run radon mi aws_lambda_powertools
$(info Cyclomatic complexity index)
poetry run xenon --max-absolute C --max-modules A --max-average A aws_lambda_powertools

#
# Use `poetry version <major>/<minor></patch>` for version bump
#
Expand Down
Loading

0 comments on commit 6407b33

Please sign in to comment.