Skip to content
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: Add ability to tag Lambda request and response payloads for 2.7… #180

Merged
merged 9 commits into from
Oct 4, 2021

Conversation

astuyve
Copy link
Contributor

@astuyve astuyve commented Sep 27, 2021

… and 3.x

What does this PR do?

When DD_CAPTURE_LAMBDA_PAYLOAD is enabled (and tracing is enabled), will automatically wrap and (deeply) tag both the incoming request and outgoing response.

Motivation

Feature request

Testing Guidelines

Additional Notes

Types of Changes

  • Bug fix
  • New feature
  • Breaking change
  • Misc (docs, refactoring, dependency upgrade, etc.)

Check all that apply

  • This PR's description is comprehensive
  • This PR contains breaking changes that are documented in the description
  • This PR introduces new APIs or parameters that are documented and unlikely to change in the foreseeable future
  • This PR impacts documentation, and it has been updated (or a ticket has been logged)
  • This PR's changes are covered by the automated tests
  • This PR collects user input/sensitive content into Datadog
  • This PR passes the integration tests (ask a Datadog member to run the tests)

@astuyve astuyve requested a review from a team as a code owner September 27, 2021 14:26
tests/test_tag_object.py Outdated Show resolved Hide resolved
import json
import logging

redactable_keys = ["authorization", "x-authorization", "password", "token"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How did we decide on these four keys for redaction? Should we provide a way to redact other keys?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We provide datadog.yaml obfuscation rules - these were 4 common items we wanted to automatically strip out to prevent accidental ingestion of secrets before a user has time to redact for themselves

@@ -1,21 +1,23 @@
# Contributing
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for cleaning this up! 🙏

@@ -181,6 +185,10 @@ def _after(self, event, context):
flush_extension()

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we enable this feature in the integration tests as well for improved test coverage?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, great idea.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears that we don't care about span tags in our integration tests, because the integration tests are unaffected by this ENV variable (off or on). We can do this during an engineering sprint, perhaps?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, that's weird, the integration tests are supposed to capture span tags. Let's dig into this a bit more before merging to make sure nothing is wrong. Happy to chat on Zoom about this if you want.

@nhinsch
Copy link
Contributor

nhinsch commented Sep 27, 2021

Super nit: I don't think you need to specify "for 2.7 and 3.x" in the PR title -- all PRs apply to those versions 🙂

(Unless we wait until Thursday to merge this, at which time we will probably be dropping support for 2.7!)

@astuyve astuyve merged commit 1b3599b into main Oct 4, 2021
@astuyve astuyve deleted the aj/feat-capture-lambda-payloads branch October 4, 2021 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants