Skip to content

Commit

Permalink
docs: main page updates around support (#1133)
Browse files Browse the repository at this point in the history
* docs: main page updates around support

* Update docs/index.md

Co-authored-by: Heitor Lessa <[email protected]>

Co-authored-by: Heitor Lessa <[email protected]>
  • Loading branch information
dreamorosi and heitorlessa authored Oct 25, 2022
1 parent f71a79f commit c25279c
Show file tree
Hide file tree
Showing 4 changed files with 215 additions and 264 deletions.
12 changes: 6 additions & 6 deletions docs/core/logger.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ The library requires two settings. You can set them as environment variables, or

These settings will be used across all logs emitted:

| Setting | Description | Environment variable | Constructor parameter |
|-------------------|------------------------------------------------------------------------------------------------------------------|---------------------------|-----------------------|
| **Logging level** | Sets how verbose Logger should be (INFO, by default). Supported values are: `DEBUG`, `INFO`, `WARN`, `ERROR` | `LOG_LEVEL` | `logLevel` |
| **Service name** | Sets the name of service of which the Lambda function is part of, that will be present across all log statements | `POWERTOOLS_SERVICE_NAME` | `serviceName` |

For a **complete list** of supported environment variables, refer to [this section](./../index.md#environment-variables).
| Setting | Description | Environment variable | Constructor parameter |
|-------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------|-----------------------|
| **Service name** | Sets the name of service of which the Lambda function is part of, that will be present across all log statements | `POWERTOOLS_SERVICE_NAME` | `serviceName` |
| **Logging level** | Sets how verbose Logger should be (INFO, by default). Supported values are: `DEBUG`, `INFO`, `WARN`, `ERROR` | `LOG_LEVEL` | `logLevel` |
| **Log incoming event** | Whether to log or not the incoming event when using the decorator or middleware. Supported values are: `true`, or `false`, disabled by default | `POWERTOOLS_LOGGER_LOG_EVENT` | `logEvent` |
| **Debug log sampling** | Probability that a Lambda invocation will print all the log items regardless of the log level setting. Supported values range from `0.0` to `1` | `POWERTOOLS_LOGGER_SAMPLE_RATE` | `sampleRateValue` |

#### Example using AWS Serverless Application Model (SAM)

Expand Down
6 changes: 2 additions & 4 deletions docs/core/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,8 @@ These settings will be used across all metrics emitted:

| Setting | Description | Environment variable | Constructor parameter |
|----------------------|---------------------------------------------------------------------------------|--------------------------------|-----------------------|
| **Metric namespace** | Logical container where all metrics will be placed e.g. `serverlessAirline` | `POWERTOOLS_METRICS_NAMESPACE` | `namespace` |
| **Service** | Optionally, sets **service** metric dimension across all metrics e.g. `payment` | `POWERTOOLS_SERVICE_NAME` | `serviceName` |

For a **complete list** of supported environment variables, refer to [this section](./../index.md#environment-variables).
| **Metric namespace** | Logical container where all metrics will be placed e.g. `serverlessAirline` | `POWERTOOLS_METRICS_NAMESPACE` | `namespace` |

!!! tip
Use your application name or main service as the metric namespace to easily group all metrics
Expand Down Expand Up @@ -299,7 +297,7 @@ Using the Middy middleware or decorator will **automatically validate, serialize
If you do not use the middleware or decorator, you have to flush your metrics manually.

!!! warning "Metric validation"
If metrics are provided, and any of the following criteria are not met, a **`RangeError`** exception will be thrown:
If metrics are provided, and any of the following criteria are not met, a **`RangeError`** error will be thrown:

* Maximum of 29 dimensions
* Namespace is set only once (or none)
Expand Down
20 changes: 10 additions & 10 deletions docs/core/tracer.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ The `Tracer` utility must always be instantiated outside of the Lambda handler.

The library has three optional settings. You can set them as environment variables, or pass them in the constructor:

Setting | Description | Environment variable | Constructor parameter
------------------------------------------------- |------------------------------------------------------------------------------------------------| ------------------------------------------------- | -------------------------------------------------
**Tracing enabled** | Enables or disables tracing. By default tracing is enabled when running in AWS Lambda. | `POWERTOOLS_TRACE_ENABLED` | `enabled`
**Service name** | Sets an annotation with the **name of the service** across all traces e.g. `serverlessAirline` | `POWERTOOLS_SERVICE_NAME` | `serviceName`
**Capture HTTPs Requests** | Defines whether HTTPs requests will be traced or not, enabled by default when tracing is also enabled. | `POWERTOOLS_TRACER_CAPTURE_HTTPS_REQUESTS` | `captureHTTPsRequests`

For a **complete list** of supported environment variables, refer to [this section](./../index.md#environment-variables).
| Setting | Description | Environment variable | Constructor parameter |
|----------------------------|-----------------------------------------------------------------------------------------------------------------| -------------------------------------------|------------------------|
| **Service name** | Sets an annotation with the **name of the service** across all traces e.g. `serverlessAirline` | `POWERTOOLS_SERVICE_NAME` | `serviceName` |
| **Tracing enabled** | Enables or disables tracing. By default tracing is enabled when running in AWS Lambda | `POWERTOOLS_TRACE_ENABLED` | `enabled` |
| **Capture HTTPs Requests** | Defines whether HTTPs requests will be traced or not, enabled by default when tracing is also enabled | `POWERTOOLS_TRACER_CAPTURE_HTTPS_REQUESTS` | `captureHTTPsRequests` |
| **Capture Response** | Defines whether functions responses are serialized as metadata, enabled by default when tracing is also enabled | `POWERTOOLS_TRACER_CAPTURE_RESPONSE` | `captureResult` |
| **Capture Errors** | Defines whether functions errors are serialized as metadata, enabled by default when tracing is also enabled | `POWERTOOLS_TRACER_CAPTURE_ERROR` | N/A |

!!! note
Before your use this utility, your AWS Lambda function must have [Active Tracing enabled](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html) as well as [have permissions](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html#services-xray-permissions) to send traces to AWS X-Ray
Expand Down Expand Up @@ -476,13 +476,13 @@ Alternatively, use the `captureResponse: false` option in both `tracer.captureLa
.use(captureLambdaHandler(tracer, { captureResponse: false }));
```

### Disabling exception auto-capture
### Disabling errors auto-capture

Use **`POWERTOOLS_TRACER_CAPTURE_ERROR=false`** environment variable to instruct Tracer **not** to serialize exceptions as metadata.
Use **`POWERTOOLS_TRACER_CAPTURE_ERROR=false`** environment variable to instruct Tracer **not** to serialize errors as metadata.

!!! info "Commonly useful in one scenario"

1. You might **return sensitive** information from exceptions, stack traces you might not control
1. You might **return sensitive** information from errors, stack traces you might not control

### Escape hatch mechanism

Expand Down
Loading

0 comments on commit c25279c

Please sign in to comment.