* Adds an option to configure `disable_aws_context_propagation` by environment variable
The variable `OTEL_LAMBDA_DISABLE_AWS_CONTEXT_PROPAGATION` can be used to disable aws context propagation. This is similar to the proposed changes in the JS implementation: https://github.com/open-telemetry/opentelemetry-js-contrib/pull/1227
Signed-off-by: Alex Boten <aboten@lightstep.com>
* update changelog
* Apply suggestions from code review
Co-authored-by: Srikanth Chekuri <srikanth.chekuri92@gmail.com>
Signed-off-by: Alex Boten <aboten@lightstep.com>
Co-authored-by: Srikanth Chekuri <srikanth.chekuri92@gmail.com>
* Minor refactoring across multiple instrumentation libraries
* Reformat using black
* Put span_kind back in aws_lambda
Co-authored-by: Srikanth Chekuri <srikanth.chekuri92@gmail.com>
Co-authored-by: Diego Hurtado <ocelotl@users.noreply.github.com>
* `opentelemetry-instrumentation-aws-lambda`: Adding option to disable 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.
* update changelog
* lint
* more lint
* fix kafka: wait for metadata
Kafka's instance metadata could be unavailable (because it's being filled asynchronously). extract_send_partition() is based on a metadata, so it may return `None` for partition and later cause all type of warning messages (e.g. `Invalid type NoneType for attribute value. Expected one of ['bool', 'str', 'bytes', 'int', 'float'] or a sequence of those types`).
The proposed fix makes sure metadata is pre-populated (based on 4d598055da/kafka/producer/kafka.py (L579)).
I'm just not sure if we should wrap `_wait_on_metadata` into try\except, maybe just passing Exception to the caller would be a better idea...
* upd: changelog
* fix: changelog
* fix: import KafkaErrors
* fix: tox -e lint errors
* fix: refact and added unit test
Co-authored-by: Srikanth Chekuri <srikanth.chekuri92@gmail.com>
Co-authored-by: Leighton Chen <lechen@microsoft.com>
Co-authored-by: Diego Hurtado <ocelotl@users.noreply.github.com>
Fixes https://github.com/open-telemetry/opentelemetry-python-contrib/issues/1353
Also:
Fix the check for the connection already being instrumented in instrument_connection()
Add tests for commit() and rollback()
Add a couple missing docstring items.
Add basepython to docker-tests to fix running the tests on macOS.