From f9d2c04fd46587cb45e82bdd30a1acebf99026fb Mon Sep 17 00:00:00 2001 From: Leandro Damascena Date: Tue, 4 Feb 2025 11:17:54 +0000 Subject: [PATCH] Mkdocstrings - Metrics --- aws_lambda_powertools/metrics/base.py | 6 ++++++ .../metrics/provider/cloudwatch_emf/cloudwatch.py | 2 +- docs/api_doc/metrics/base.md | 2 ++ docs/api_doc/metrics/exceptions.md | 2 ++ docs/api_doc/metrics/metrics.md | 2 ++ docs/api_doc/metrics/provider_datadog.md | 2 ++ docs/api_doc/metrics/provider_emf.md | 2 ++ mkdocs.yml | 6 ++++++ 8 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 docs/api_doc/metrics/base.md create mode 100644 docs/api_doc/metrics/exceptions.md create mode 100644 docs/api_doc/metrics/metrics.md create mode 100644 docs/api_doc/metrics/provider_datadog.md create mode 100644 docs/api_doc/metrics/provider_emf.md diff --git a/aws_lambda_powertools/metrics/base.py b/aws_lambda_powertools/metrics/base.py index 7304afa5a42..32325e5ce29 100644 --- a/aws_lambda_powertools/metrics/base.py +++ b/aws_lambda_powertools/metrics/base.py @@ -1,3 +1,9 @@ +""" +Metrics utility +!!! abstract "Usage Documentation" + [`Metrics`](../../core/metrics.md) +""" + from __future__ import annotations import datetime diff --git a/aws_lambda_powertools/metrics/provider/cloudwatch_emf/cloudwatch.py b/aws_lambda_powertools/metrics/provider/cloudwatch_emf/cloudwatch.py index cd9a90a0d19..7a7db86c9c6 100644 --- a/aws_lambda_powertools/metrics/provider/cloudwatch_emf/cloudwatch.py +++ b/aws_lambda_powertools/metrics/provider/cloudwatch_emf/cloudwatch.py @@ -330,7 +330,7 @@ def set_timestamp(self, timestamp: int | datetime.datetime): """ Set the timestamp for the metric. - Parameters: + Parameters ----------- timestamp: int | datetime.datetime The timestamp to create the metric. diff --git a/docs/api_doc/metrics/base.md b/docs/api_doc/metrics/base.md new file mode 100644 index 00000000000..2fac9156233 --- /dev/null +++ b/docs/api_doc/metrics/base.md @@ -0,0 +1,2 @@ + +::: aws_lambda_powertools.metrics.base diff --git a/docs/api_doc/metrics/exceptions.md b/docs/api_doc/metrics/exceptions.md new file mode 100644 index 00000000000..285a2654342 --- /dev/null +++ b/docs/api_doc/metrics/exceptions.md @@ -0,0 +1,2 @@ + +::: aws_lambda_powertools.metrics.exceptions diff --git a/docs/api_doc/metrics/metrics.md b/docs/api_doc/metrics/metrics.md new file mode 100644 index 00000000000..ec268279335 --- /dev/null +++ b/docs/api_doc/metrics/metrics.md @@ -0,0 +1,2 @@ + +::: aws_lambda_powertools.metrics.metrics diff --git a/docs/api_doc/metrics/provider_datadog.md b/docs/api_doc/metrics/provider_datadog.md new file mode 100644 index 00000000000..70836789d43 --- /dev/null +++ b/docs/api_doc/metrics/provider_datadog.md @@ -0,0 +1,2 @@ + +::: aws_lambda_powertools.metrics.provider.datadog.datadog diff --git a/docs/api_doc/metrics/provider_emf.md b/docs/api_doc/metrics/provider_emf.md new file mode 100644 index 00000000000..610e2c83db0 --- /dev/null +++ b/docs/api_doc/metrics/provider_emf.md @@ -0,0 +1,2 @@ + +::: aws_lambda_powertools.metrics.provider.cloudwatch_emf.cloudwatch diff --git a/mkdocs.yml b/mkdocs.yml index a82ae76dbdd..68b5835efc4 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -92,6 +92,12 @@ nav: - Formatter: api_doc/logger/formatter.md - Lambda Context: api_doc/logger/lambda_context.md - Logger: api_doc/logger/logger.md + - Metrics: + - Base: api_doc/metrics/base.md + - Exceptions: api_doc/metrics/exceptions.md + - Providers: + - EMF: api_doc/metrics/provider_emf.md + - DataDog: api_doc/metrics/provider_datadog.md - Middleware Factory: api_doc/middleware_factory.md - Parameters: - Base: api_doc/parameters/base.md