-
Notifications
You must be signed in to change notification settings - Fork 156
docs(all): clarifications & fixes #370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 8 commits
13e5bf2
fc5e29d
e439de3
649996c
7f17f44
28a1261
039f489
07837d3
d763bed
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,6 +72,12 @@ You can quickly start by importing the `Tracer` class, initialize it outside the | |
|
||
=== "Middleware" | ||
|
||
!!! note | ||
Middy comes bundled with Tracer, so you can just import it when using the middleware. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not in the scope of this PR: I don't think we should bundle middy. We only use it for its types, and now we are adding a prod dependency to developers' lambda functions they might actually not even use it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed, I've opened an issue to track this at a later stage #373 |
||
|
||
!!! tip "Using Middy for the first time?" | ||
Learn more about [its usage and lifecycle in the official Middy documentation](https://github.com/middyjs/middy#usage){target="_blank"}. | ||
|
||
```typescript hl_lines="1-2 4 7 9" | ||
import { Tracer } from '@aws-lambda-powertools/tracer'; | ||
import middy from '@middy/core'; | ||
|
@@ -105,7 +111,7 @@ You can quickly start by importing the `Tracer` class, initialize it outside the | |
|
||
=== "Manual" | ||
|
||
```typescript hl_lines="1 3 7 9 11 17 20 24" | ||
```typescript hl_lines="1 3 7 9-10 13-14 20 23 27 29" | ||
import { Tracer } from '@aws-lambda-powertools/tracer'; | ||
|
||
const tracer = Tracer(); // Sets service via env var | ||
|
@@ -252,8 +258,6 @@ You can trace other methods using the `captureMethod` decorator or manual instru | |
} | ||
``` | ||
|
||
## Advanced | ||
|
||
### Patching AWS SDK clients | ||
|
||
Tracer can patch [AWS SDK clients](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-nodejs-awssdkclients.html) and create traces when your application makes calls to AWS services. | ||
|
@@ -300,6 +304,8 @@ If you're looking to shave a few microseconds, or milliseconds depending on your | |
const s3 = tracer.captureAWSClient(new S3({ apiVersion: "2006-03-01" })); | ||
``` | ||
|
||
## Advanced | ||
|
||
### Disabling response auto-capture | ||
|
||
Use **`POWERTOOLS_TRACER_CAPTURE_RESPONSE=false`** environment variable to instruct Tracer **not** to serialize function responses as metadata. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,5 +78,5 @@ Each TypeScript utility is installed as standalone NPM package. | |
|
||
## Connect | ||
|
||
* **AWS Developers Slack**: `#lambda-powertools`** - **[Invite, if you don't have an account](https://join.slack.com/t/awsdevelopers/shared_invite/zt-yryddays-C9fkWrmguDv0h2EEDzCqvw){target="_blank"}** | ||
* **AWS Developers Slack**: `#lambda-powertools` - [Invite, if you don't have an account](https://join.slack.com/t/awsdevelopers/shared_invite/zt-yryddays-C9fkWrmguDv0h2EEDzCqvw){target="_blank"} | ||
* **Email**: [email protected] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,36 @@ | ||
.md-grid { | ||
max-width: 81vw | ||
} | ||
|
||
.highlight .hll { | ||
background-color: lavender | ||
|
||
[data-md-color-scheme="slate"] { | ||
background-color: rgb(69, 48, 164) | ||
} | ||
max-width: 81vw; | ||
} | ||
|
||
.md-typeset table:not([class]) { | ||
font-size: 0.75rem | ||
font-size: 0.75rem; | ||
} | ||
|
||
.md-typeset a { | ||
border-bottom: 0.1px dashed black | ||
border-bottom: 0.1px dashed black; | ||
} | ||
|
||
.md-typeset table:not([class]) { | ||
font-size: 0.75rem | ||
font-size: 0.75rem; | ||
} | ||
|
||
.md-nav__link--active { | ||
font-weight: bold | ||
font-weight: bold; | ||
} | ||
|
||
.md-typeset .admonition, .md-typeset details { | ||
font-size: 0.70rem | ||
font-size: 0.70rem; | ||
} | ||
|
||
[data-md-color-scheme="slate"] { | ||
--md-typeset-a-color: rgb(28, 152, 152) | ||
--md-typeset-a-color: rgb(28, 152, 152); | ||
} | ||
|
||
.copyMe { | ||
cursor: pointer; | ||
border-bottom: 0.1px dashed black; | ||
} | ||
|
||
p code { | ||
font-weight: bolder; | ||
} |
Uh oh!
There was an error while loading. Please reload this page.