Environment:
I'm using opentelemetry-instrumentation-aws-lambda to instrument the Lambda function behind the API Gateway (V2).
Python==3.9
AWS-OTEL Lmabda Layer == arn:aws:lambda:us-east-1:901920570463:layer:aws-otel-python-amd64-ver-1-17-0:1
fastapi==0.73.0
opentelemetry-sdk==1.17.0
Environment variables:
AWS_LAMBDA_EXEC_WRAPPER=/opt/otel-instrument
OPENTELEMETRY_COLLECTOR_CONFIG_FILE=/var/task/src/otel-config.yaml
OTEL_METRICS_EXPORTER=otlp
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
OPENTELEMETRY_EXTENSION_LOG_LEVEL=error
OTEL_PYTHON_DISABLED_INSTRUMENTATIONS=fastapi
OTEL Config yaml:
receivers:
otlp:
protocols:
http:
exporters:
otlp:
endpoint: https://<ANOTHER_SERVICE>:4317
service:
pipelines:
metrics:
receivers: [otlp]
exporters: [otlp]
Steps to reproduce
- Instrument your Lambda with as stated here: https://aws-otel.github.io/docs/getting-started/lambda/lambda-python
- Lambda should be behind the API Gateway
- Send a request
What is the expected behavior?
There shouldn't be any Warning logs in the Lambda logs.
What is the actual behavior?
I'm seeing couple of Warning in the lambda logs.

[WARNING] 2023-05-02T23:36:45.395Z ec784472-c5bb-4f74-867d-e45d39e0fcca Invalid type NoneType for attribute 'http.user_agent' value. Expected one of ['bool', 'str', 'bytes', 'int', 'float'] or a sequence of those types
Additional context
I'm interested to open a PR if possible to add some logic here preventing None values being set as attributes: https://github.com/open-telemetry/opentelemetry-python-contrib/blob/46e4b1da44c534fed8e1002899e9e41e6d668018/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/__init__.py#LL232C3-L232C3
Also, if there is a way to disable Tracing/Warning Logs it would be helpful, I couldn't find a way to do that.
Another related discussion: open-telemetry/opentelemetry-python#3293
Thanks.
Environment:
I'm using
opentelemetry-instrumentation-aws-lambdato instrument the Lambda function behind the API Gateway (V2).Python==3.9
AWS-OTEL Lmabda Layer == arn:aws:lambda:us-east-1:901920570463:layer:aws-otel-python-amd64-ver-1-17-0:1
fastapi==0.73.0
opentelemetry-sdk==1.17.0
Environment variables:
OTEL Config yaml:
Steps to reproduce
What is the expected behavior?
There shouldn't be any Warning logs in the Lambda logs.
What is the actual behavior?
I'm seeing couple of Warning in the lambda logs.
Additional context
I'm interested to open a PR if possible to add some logic here preventing None values being set as attributes: https://github.com/open-telemetry/opentelemetry-python-contrib/blob/46e4b1da44c534fed8e1002899e9e41e6d668018/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/__init__.py#LL232C3-L232C3
Also, if there is a way to disable Tracing/Warning Logs it would be helpful, I couldn't find a way to do that.
Another related discussion: open-telemetry/opentelemetry-python#3293
Thanks.