-
Notifications
You must be signed in to change notification settings - Fork 806
Description
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=fastapiOTEL 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 typesAdditional 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.
