-
Notifications
You must be signed in to change notification settings - Fork 402
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
feat(metrics): add Datadog observability provider #2906
feat(metrics): add Datadog observability provider #2906
Conversation
refactor base and exception to resolve a circular import issue add datadog provider tests
E2E tests are failing on Metrics after the provider merge - let's hold on before we continue here. |
Codecov ReportPatch coverage:
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## develop #2906 +/- ##
===========================================
+ Coverage 96.42% 96.56% +0.13%
===========================================
Files 171 175 +4
Lines 7690 7825 +135
Branches 570 1476 +906
===========================================
+ Hits 7415 7556 +141
+ Misses 219 217 -2
+ Partials 56 52 -4
☔ View full report in Codecov by Sentry. |
We fixed the problem in the PR #2910. We can go ahead with PR. |
Still missing in this PR:
|
Hi @roger-zhangg and @heitorlessa! I think this PR is ready to review and I have some information to make easy the review and tests: 1 - TAGS 2 - ENV 3 - Flushing metrics The customer just need to set the env variable DD_FLUSH_TO_LOG or setting We have these two supports thanks to @roger-zhangg fantastic job investigating supported methods. 4 - Live test 4.1 - Clone this branch from aws_lambda_powertools.utilities.typing import LambdaContext
from aws_lambda_powertools.metrics.provider.datadog import DatadogMetrics, DatadogProvider
provider = DatadogProvider()
metrics = DatadogMetrics(provider=provider)
metrics.set_default_tags(powertools="datadog")
@metrics.log_metrics(capture_cold_start_metric=True)
def lambda_handler(event: dict, context: LambdaContext):
#DATADOG
metrics.add_metric(name="PRDataDog", value=1) 4.4 - If you want to deploy to your AWS account and send metrics to Datadog then follow steps 4.5 and 4.6, otherwise skip to 4.7 4.5 - In 4.7 - If you want to test locally to see if the metrics are created, just add the environment variable It is still missing create the documentation, but I think the code is done. Thanks so much again @roger-zhang! We can only get this far because you've done most of the work. 🚀 |
Thanks Leandro for the refactor! Looks good to me |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UX suggestions to improve the customer experience in setting default tags, and overriding tags within a add_metric
operation.
Signed-off-by: heitorlessa <[email protected]>
Signed-off-by: heitorlessa <[email protected]>
Signed-off-by: heitorlessa <[email protected]>
Signed-off-by: heitorlessa <[email protected]>
Signed-off-by: heitorlessa <[email protected]>
Signed-off-by: heitorlessa <[email protected]>
Signed-off-by: heitorlessa <[email protected]>
Signed-off-by: heitorlessa <[email protected]>
Signed-off-by: heitorlessa <[email protected]>
Signed-off-by: heitorlessa <[email protected]>
Signed-off-by: heitorlessa <[email protected]>
Final tasks on docs for me in this last pass -- next time, we should really do this in a separate PR given the level of detail we need.
Separate PR
|
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
approved - LGTM! I'd only ask to create a separate issue to investigate testing when datadog SDK isn't available, so we're fully covered. |
Co-authored-by: Leandro Damascena <[email protected]> Co-authored-by: heitorlessa <[email protected]>
* develop: chore: cleanup, add test for single and nested fix(parameters): make cache aware of single vs multiple calls docs(roadmap): add GovCloud and China region item (aws-powertools#2960) docs(metrics): update Datadog integration diagram (aws-powertools#2954) chore(ci): changelog rebuild (aws-powertools#2958) chore(deps-dev): bump cfn-lint from 0.79.6 to 0.79.7 (aws-powertools#2956) chore(deps): bump actions/setup-node from 3.7.0 to 3.8.0 (aws-powertools#2957) chore(deps-dev): bump xenon from 0.9.0 to 0.9.1 (aws-powertools#2955) feat(metrics): add Datadog observability provider (aws-powertools#2906) feat(event_handler): allow stripping route prefixes using regexes (aws-powertools#2521) chore(ci): changelog rebuild (aws-powertools#2952) chore(deps): bump pypa/gh-action-pypi-publish from 1.8.9 to 1.8.10 (aws-powertools#2946) chore(deps): bump gitpython from 3.1.31 to 3.1.32 in /docs (aws-powertools#2948) chore(deps-dev): bump aws-cdk from 2.90.0 to 2.91.0 (aws-powertools#2947) chore(ci): changelog rebuild (aws-powertools#2945) chore(deps-dev): bump the boto-typing group with 1 update (aws-powertools#2944) chore(deps): bump pypa/gh-action-pypi-publish from 1.8.8 to 1.8.9 (aws-powertools#2943) Signed-off-by: heitorlessa <[email protected]>
* fix(parameters): make cache aware of single vs multiple calls Signed-off-by: heitorlessa <[email protected]> * chore: cleanup, add test for single and nested Signed-off-by: heitorlessa <[email protected]> * chore(deps): bump pypa/gh-action-pypi-publish from 1.8.8 to 1.8.9 (aws-powertools#2943) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): bump the boto-typing group with 1 update (aws-powertools#2944) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Leandro Damascena <[email protected]> * chore(ci): changelog rebuild (aws-powertools#2945) Co-authored-by: Powertools for AWS Lambda (Python) bot <[email protected]> * chore(deps-dev): bump aws-cdk from 2.90.0 to 2.91.0 (aws-powertools#2947) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump gitpython from 3.1.31 to 3.1.32 in /docs (aws-powertools#2948) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump pypa/gh-action-pypi-publish from 1.8.9 to 1.8.10 (aws-powertools#2946) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Leandro Damascena <[email protected]> * chore(ci): changelog rebuild (aws-powertools#2952) Co-authored-by: Powertools for AWS Lambda (Python) bot <[email protected]> * feat(event_handler): allow stripping route prefixes using regexes (aws-powertools#2521) Co-authored-by: Roy Assis <[email protected]> Co-authored-by: Ruben Fonseca <[email protected]> * feat(metrics): add Datadog observability provider (aws-powertools#2906) Co-authored-by: Leandro Damascena <[email protected]> Co-authored-by: heitorlessa <[email protected]> * chore(deps-dev): bump xenon from 0.9.0 to 0.9.1 (aws-powertools#2955) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump actions/setup-node from 3.7.0 to 3.8.0 (aws-powertools#2957) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): bump cfn-lint from 0.79.6 to 0.79.7 (aws-powertools#2956) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Leandro Damascena <[email protected]> * chore(ci): changelog rebuild (aws-powertools#2958) Co-authored-by: Powertools for AWS Lambda (Python) bot <[email protected]> * docs(metrics): update Datadog integration diagram (aws-powertools#2954) Co-authored-by: Leandro Damascena <[email protected]> * docs(roadmap): add GovCloud and China region item (aws-powertools#2960) * fix(parameters): make cache aware of single vs multiple calls Signed-off-by: heitorlessa <[email protected]> * chore: cleanup, add test for single and nested Signed-off-by: heitorlessa <[email protected]> * chore(test): remove itsdangerous from perf test Signed-off-by: heitorlessa <[email protected]> * chore(deps): remove itsdangerous dependencies * chore: disable sockets in encryption sdk tests Signed-off-by: heitorlessa <[email protected]> * refactor(tests): use a test double * chore: address make pr errors Signed-off-by: heitorlessa <[email protected]> --------- Signed-off-by: heitorlessa <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Leandro Damascena <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Powertools for AWS Lambda (Python) bot <[email protected]> Co-authored-by: roy <[email protected]> Co-authored-by: Roy Assis <[email protected]> Co-authored-by: Ruben Fonseca <[email protected]> Co-authored-by: Roger Zhang <[email protected]> Co-authored-by: aal80 <[email protected]> Co-authored-by: Seshu Brahma <[email protected]>
Issue number:
#2903
#2015
Summary
We didn't included the Datadog metrics provider in our initial metrics provider release due to a dependency conflict. Now that the conflict is resolved, This RFC is for adding back the previously included Datadog metrics provider
Changes
User experience
How this provider works
Checklist
If your change doesn't seem to apply, please leave them unchecked.
Is this a breaking change?
RFC issue number:
Checklist:
Acknowledgment
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.