-
Notifications
You must be signed in to change notification settings - Fork 620
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
opentelemetry-instrumentation-aws-lambda
: Adding option to disable context propagation
#1466
opentelemetry-instrumentation-aws-lambda
: Adding option to disable context propagation
#1466
Conversation
…context propagation Adding the following option to disable context propagation `disable_aws_context_propagation`. This is similar to the disableAwsContextPropagation option in the nodejs instrumentation.
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.
😻
@@ -377,11 +393,12 @@ def _instrument(self, **kwargs): | |||
) = lambda_handler.rsplit(".", 1) | |||
|
|||
flush_timeout_env = os.environ.get( | |||
OTEL_INSTRUMENTATION_AWS_LAMBDA_FLUSH_TIMEOUT, "" | |||
OTEL_INSTRUMENTATION_AWS_LAMBDA_FLUSH_TIMEOUT, None |
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.
Isn't .get
without a default None
already anyways?
i.e. shouldn't this just be:
os.environ.get(
OTEL_INSTRUMENTATION_AWS_LAMBDA_FLUSH_TIMEOUT
)
) | ||
flush_timeout = 30000 | ||
try: | ||
flush_timeout = int(flush_timeout_env) | ||
if flush_timeout_env is not None: |
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.
Why not if flush_timeout_env
? Maybe you want to guard against the ""
environment variable. But perhaps users would prefer a warning log if they set this variable (which should be an int
) to an empty string?
Description
Adding the following option to disable context propagation
disable_aws_context_propagation
. This is similar to the disableAwsContextPropagation option in the nodejs instrumentation.Fixes # (issue)
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.