-
Notifications
You must be signed in to change notification settings - Fork 403
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(metrics): support to bring your own metrics provider (#2194)
* Use a different Metric class for different provider * fix static checking error * fix static checking error * optimize docstring * add alias CloudWatchEMF to original Metrics class * add alias CloudWatchEMF to original Metrics class * Move Metrics to Provider * add sample document * reformat code block * add OTel provider draft for poc * rebasing from upstream * rebasing from upstream * add test to metrics providers * docstring + code coverage * python annotations + imports * fix docstring polish datadog_provider add flush_to_log parameter remove OTEL provider draft * add tests for datadog provider * add tests for datadog provider * migrate from ABC to protocol, support convert kwargs to tags, add test * migrate from ABC to protocol, support convert kwargs to tags, add test * migrate from ABC to protocol, support convert kwargs to tags, add test * remove parent class, fix example * base: fix small problems * refactoring: removing Datadog provider * refactoring: importing from typing_extensions * refactoring EMF provider * refactoring cloudwatchemf provider and cleaning code * fix mypy error * fix mypy error * fix metric tests * fix documentation * adding test --------- Signed-off-by: Leandro Damascena <[email protected]> Co-authored-by: Leandro Damascena <[email protected]> Co-authored-by: Leandro Damascena <[email protected]> Co-authored-by: Cavalcante Damascena <[email protected]>
- Loading branch information
1 parent
0916bc5
commit cdf9084
Showing
18 changed files
with
1,317 additions
and
206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Title for the gitleaks configuration file. | ||
title = "Gitleaks" | ||
|
||
[extend] | ||
# useDefault will extend the base configuration with the default gitleaks config: | ||
# https://github.com/zricethezav/gitleaks/blob/master/config/gitleaks.toml | ||
useDefault = true | ||
|
||
[allowlist] | ||
description = "Allow list false positive" | ||
|
||
# Allow list paths to ignore due to false positives. | ||
paths = [ | ||
'''tests/unit/parser/test_kinesis_firehose\.py''', | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,22 @@ | ||
"""CloudWatch Embedded Metric Format utility | ||
""" | ||
from .base import MetricResolution, MetricUnit | ||
from .exceptions import ( | ||
from aws_lambda_powertools.metrics.base import MetricResolution, MetricUnit, single_metric | ||
from aws_lambda_powertools.metrics.exceptions import ( | ||
MetricResolutionError, | ||
MetricUnitError, | ||
MetricValueError, | ||
SchemaValidationError, | ||
) | ||
from .metric import single_metric | ||
from .metrics import EphemeralMetrics, Metrics | ||
from aws_lambda_powertools.metrics.metrics import EphemeralMetrics, Metrics | ||
|
||
__all__ = [ | ||
"Metrics", | ||
"EphemeralMetrics", | ||
"single_metric", | ||
"MetricUnit", | ||
"MetricUnitError", | ||
"MetricResolution", | ||
"MetricResolutionError", | ||
"SchemaValidationError", | ||
"MetricValueError", | ||
"Metrics", | ||
"EphemeralMetrics", | ||
"MetricResolution", | ||
"MetricUnit", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# NOTE: prevents circular inheritance import | ||
from .base import SingleMetric, single_metric | ||
from aws_lambda_powertools.metrics.base import SingleMetric, single_metric | ||
|
||
__all__ = ["SingleMetric", "single_metric"] |
Oops, something went wrong.