You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/content/core/metrics.mdx
+4-4
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,7 @@ You can also pass a service name via `service` param or `POWERTOOLS_SERVICE_NAME
39
39
from aws_lambda_powertools.metrics import Metrics, MetricUnit
40
40
41
41
# POWERTOOLS_METRICS_NAMESPACE and POWERTOOLS_SERVICE_NAME defined
42
-
metrics = Metrics() # highlight-line
42
+
metrics = Metrics() # highlight-line
43
43
44
44
# Explicit definition
45
45
Metrics(namespace="ServerlessAirline", service="orders") # creates a default dimension {"service": "orders"} under the namespace "ServerlessAirline"
@@ -69,7 +69,7 @@ CloudWatch EMF supports a max of 100 metrics. Metrics will automatically flush a
69
69
70
70
## Creating a metric with a different dimension
71
71
72
-
CloudWatch EMF uses the same dimensions across all your metrics. Use `single_metric` if you have a metric that should have different dimensions.
72
+
CloudWatch EMF uses the same dimensions across all your metrics. Use `single_metric` if you have a metric that should have different dimensions.
73
73
74
74
<Notetype="info">
75
75
Generally, this would be an edge case since you <ahref="https://aws.amazon.com/cloudwatch/pricing/">pay for unique metric</a>. Keep the following formula in mind:
@@ -105,7 +105,7 @@ def lambda_handler(evt, ctx):
105
105
106
106
`log_metrics` decorator **validates**, **serializes**, and **flushes** all your metrics. During metrics validation, if any of the following criteria is met, `SchemaValidationError` exception will be raised:
107
107
108
-
* At least of one Metric and Dimension
108
+
* At least of one Metric and Dimension
109
109
* Maximum of 9 dimensions
110
110
* Namespace is set, and no more than one
111
111
* Metric units must be [supported by CloudWatch](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDatum.html)
Tracer keeps a copy of its configuration after the first initialization. This is useful for scenarios where you want to use Tracer in more than one location across your code base.
200
200
@@ -214,7 +214,7 @@ def handler(event, context)
214
214
from aws_lambda_powertools.tracing import Tracer
215
215
# highlight-start
216
216
# new instance using existing configuration with auto patching overriden
Copy file name to clipboardExpand all lines: docs/content/index.mdx
+1-1
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,7 @@ Powertools is available in PyPi. You can use your favourite dependency managemen
23
23
24
24
***AWS Lambda only** – We optimise for AWS Lambda function environments and supported runtimes only. Utilities might work with web frameworks and non-Lambda environments, though they are not officially supported.
25
25
***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.
26
-
***Keep it lean** – Additional dependencies are carefully considered for security and ease of maintenance, and prevent negatively impacting startup time.
26
+
***Keep it lean** – Additional dependencies are carefully considered for security and ease of maintenance, and prevent negatively impacting startup time.
27
27
***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.
28
28
***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)
29
29
***Idiomatic** – Utilities follow programming language idioms and language-specific best practices.
Copy file name to clipboardExpand all lines: example/README.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -19,13 +19,13 @@ This project contains source code and supporting files for a serverless applicat
19
19
20
20
- hello_world - Code for the application's Lambda function.
21
21
- events - Invocation events that you can use to invoke the function.
22
-
- tests - Unit tests for the application code.
22
+
- tests - Unit tests for the application code.
23
23
- template.yaml - A template that defines the application's AWS resources.
24
24
- requirements-dev.txt - Dev dependencies to run unit tests successfully
25
25
26
26
The application uses several AWS resources, including Lambda functions and an API Gateway API. These resources are defined in the `template.yaml` file in this project. You can update the template to add AWS resources through the same deployment process that updates your application code.
27
27
28
-
If you prefer to use an integrated development environment (IDE) to build and test your application, you can use the AWS Toolkit.
28
+
If you prefer to use an integrated development environment (IDE) to build and test your application, you can use the AWS Toolkit.
29
29
The AWS Toolkit is an open source plug-in for popular IDEs that uses the SAM CLI to build and deploy serverless applications on AWS. The AWS Toolkit also adds a simplified step-through debugging experience for Lambda function code. See the following links to get started.
0 commit comments