Skip to content

Commit cd57c0f

Browse files
committed
Merge branch 'develop'
* develop: chore: reformat changelog to follow KeepAChangelog standard (#50) docs: clarify logger debug sampling message improv: build docs on develop branch #49 fix: ignore path that might seem a broken link #49 fix: open api ref in a new tab #48
2 parents ce304ed + c3adb74 commit cd57c0f

File tree

7 files changed

+560
-64
lines changed

7 files changed

+560
-64
lines changed

.github/workflows/python_docs.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
push:
88
branches:
99
- master
10+
- develop
1011

1112
jobs:
1213
docs:
@@ -17,10 +18,28 @@ jobs:
1718
uses: actions/setup-python@v1
1819
with:
1920
python-version: "3.8"
21+
- name: Capture branch and tag
22+
id: branch_name
23+
run: |
24+
echo ::set-env name=SOURCE_BRANCH::${GITHUB_REF#refs/heads/}
25+
echo ::set-env name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
2026
- name: Build docs website
21-
run: make build-docs
22-
- name: Deploy docs
27+
run: make build-docs-website
28+
- name: Build docs API reference
29+
if: env.SOURCE_BRANCH == 'master'
30+
run: make build-docs-api
31+
- name: Deploy docs website
2332
uses: peaceiris/actions-gh-pages@v3
2433
with:
2534
github_token: ${{ secrets.GITHUB_TOKEN }}
2635
publish_dir: ./dist
36+
# when deploying docs website only
37+
# we need to keep existing API docs checked in
38+
# but only for dev branch
39+
keep_files: true
40+
- name: Deploy all docs
41+
uses: peaceiris/actions-gh-pages@v3
42+
if: env.SOURCE_BRANCH == 'master'
43+
with:
44+
github_token: ${{ secrets.GITHUB_TOKEN }}
45+
publish_dir: ./dist

CHANGELOG.md

Lines changed: 48 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,34 @@
1-
# HISTORY
1+
# Changelog
2+
All notable changes to this project will be documented in this file.
23

3-
## May 29th
4+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
46

5-
**0.9.4**
7+
## [Unreleased]
68

7-
* **Metrics**: Bugfix - Metrics were not correctly flushed, and cleared on every invocation
9+
## [0.9.4] - 2020-05-29
10+
### Fixed
11+
- **Metrics**: Fix issue where metrics were not correctly flushed, and cleared on every invocation
812

9-
## May 16th
13+
## [0.9.3] - 2020-05-16
14+
### Fixed
15+
- **Tracer**: Fix Runtime Error for nested sync due to incorrect loop usage
1016

11-
**0.9.3**
17+
## [0.9.2] - 2020-05-14
18+
### Fixed
19+
- **Tracer**: Import aiohttp lazily so it's not a hard dependency
1220

13-
* **Tracer**: Bugfix - Runtime Error for nested sync due to incorrect loop usage
14-
15-
## May 14th
16-
17-
**0.9.2**
18-
19-
* **Tracer**: Bugfix - aiohttp lazy import so it's not a hard dependency
20-
21-
## May 12th
22-
23-
**0.9.0**
24-
25-
* **Tracer**: Support for async functions in `Tracer` via `capture_method` decorator
26-
* **Tracer**: Support for `aiohttp` via `aiohttp_trace_config` trace config
27-
* **Tracer**: Support for patching specific modules via `patch_modules` param
28-
* **Tracer**: Document escape hatch mechanisms via `tracer.provider`
29-
30-
## May 1st
31-
32-
**0.8.1**
21+
## [0.9.0] - 2020-05-12
22+
### Added
23+
- **Tracer**: Support for async functions in `Tracer` via `capture_method` decorator
24+
- **Tracer**: Support for `aiohttp` via `aiohttp_trace_config` trace config
25+
- **Tracer**: Support for patching specific modules via `patch_modules` param
26+
- **Tracer**: Document escape hatch mechanisms via `tracer.provider`
3327

28+
## [0.8.1] - 2020-05-1
29+
### Fixed
3430
* **Metrics**: Fix metric unit casting logic if one passes plain string (value or key)
35-
* **Metrics: **Fix `MetricUnit` enum values for
31+
* **Metrics:**: Fix `MetricUnit` enum values for
3632
- `BytesPerSecond`
3733
- `KilobytesPerSecond`
3834
- `MegabytesPerSecond`
@@ -45,40 +41,36 @@
4541
- `TerabitsPerSecond`
4642
- `CountPerSecond`
4743

48-
## April 24th
49-
50-
**0.8.0**
51-
52-
* **Logger**: Introduces `Logger` class for stuctured logging as a replacement for `logger_setup`
53-
* **Logger**: Introduces `Logger.inject_lambda_context` decorator as a replacement for `logger_inject_lambda_context`
54-
* **Logger**: Raise `DeprecationWarning` exception for both `logger_setup`, `logger_inject_lambda_context`
55-
56-
## April 20th, 2020
57-
58-
**0.7.0**
59-
60-
* **Middleware factory**: Introduces Middleware Factory to build your own middleware via `lambda_handler_decorator`
61-
* **Metrics**: Fixes metrics dimensions not being included correctly in EMF
62-
63-
## April 9th, 2020
64-
65-
**0.6.3**
66-
67-
* **Logger**: Fix `log_metrics` decorator logic not calling the decorated function, and exception handling
44+
## [0.8.0] - 2020-04-24
45+
### Added
46+
- **Logger**: Introduced `Logger` class for stuctured logging as a replacement for `logger_setup`
47+
- **Logger**: Introduced `Logger.inject_lambda_context` decorator as a replacement for `logger_inject_lambda_context`
6848

69-
## April 8th, 2020
49+
### Removed
50+
- **Logger**: Raise `DeprecationWarning` exception for both `logger_setup`, `logger_inject_lambda_context`
7051

71-
**0.6.1**
52+
## [0.7.0] - 2020-04-20
53+
### Added
54+
- **Middleware factory**: Introduced Middleware Factory to build your own middleware via `lambda_handler_decorator`
7255

73-
* **Metrics**: Introduces Metrics middleware to utilise CloudWatch Embedded Metric Format
74-
* **Metrics**: Adds deprecation warning for `log_metrics`
56+
### Fixed
57+
- **Metrics**: Fixed metrics dimensions not being included correctly in EMF
7558

76-
## February 20th, 2020
59+
## [0.6.3] - 2020-04-09
60+
### Fixed
61+
- **Logger**: Fix `log_metrics` decorator logic not calling the decorated function, and exception handling
7762

78-
**0.5.0**
63+
## [0.6.1] - 2020-04-08
64+
### Added
65+
- **Metrics**: Introduces Metrics middleware to utilise CloudWatch Embedded Metric Format
7966

80-
* **Logger**: Introduces log sampling for debug - Thanks to [Danilo's contribution](https://github.com/awslabs/aws-lambda-powertools/pull/7)
67+
### Deprecated
68+
- **Metrics**: Added deprecation warning for `log_metrics`
8169

82-
## November 15th, 2019
70+
## [0.5.0] - 2020-02-20
71+
### Added
72+
- **Logger**: Introduced log sampling for debug - Thanks to [Danilo's contribution](https://github.com/awslabs/aws-lambda-powertools/pull/7)
8373

84-
* Public beta release
74+
## [0.1.0] - 2019-11-15
75+
### Added
76+
- Public beta release

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,17 @@ build: pr
2929
poetry run build
3030

3131
build-docs:
32-
mkdir -p dist/api
3332
@$(MAKE) build-docs-website
3433
@$(MAKE) build-docs-api
3534

3635
build-docs-api: dev
36+
mkdir -p dist/api
3737
poetry run pdoc --html --output-dir dist/api/ ./aws_lambda_powertools --force
38-
mv dist/api/aws_lambda_powertools/* dist/api/
38+
mv -f dist/api/aws_lambda_powertools/* dist/api/
3939
rm -rf dist/api/aws_lambda_powertools
4040

4141
build-docs-website: dev-docs
42+
mkdir -p dist
4243
cd docs && npm run build
4344
cp -R docs/public/* dist/
4445

docs/content/core/logger.mdx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,10 @@ def handler(event, context)
187187

188188
You can dynamically set a percentage of your logs to **DEBUG** level using `sample_rate` param or via env var `POWERTOOLS_LOGGER_SAMPLE_RATE`.
189189

190-
<Note type="warning">
191-
This is possible due to <a href="https://docs.aws.amazon.com/lambda/latest/dg/runtimes-context.html">AWS Lambda reuse of execution context</a>, <strong>however, it is not always guaranteed.</strong>
190+
This happens on an entire request basis, and <strong>DEBUG</strong> level is set at the constructor. That means, concurrent requests or infrequent invocations are more likely to occur as [new Lambda execution contexts are created](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-context.html), not reused.
191+
192+
<Note type="info">
193+
If you want this logic to happen on every invocation regardless whether Lambda reuses the execution environment or not, then create your Logger inside your Lambda handler.
192194
</Note><br/>
193195

194196
```python:title=collect.py

docs/gatsby-config.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ module.exports = {
5353
},
5454
footerNavConfig: {
5555
'API Reference': {
56-
href: 'https://awslabs.github.io/aws-lambda-powertools-python/api/'
56+
href: 'https://awslabs.github.io/aws-lambda-powertools-python/api/',
57+
target: '_blank'
5758
},
5859
Serverless: {
5960
href: 'https://aws.amazon.com/serverless/'
@@ -67,7 +68,7 @@ module.exports = {
6768
{
6869
resolve: `gatsby-plugin-catch-links`,
6970
options: {
70-
excludePattern: /(excluded-link|external)/,
71+
excludePattern: /\/aws-lambda-powertools-python/,
7172
},
7273
},
7374
'gatsby-plugin-antd',

0 commit comments

Comments
 (0)