-
Notifications
You must be signed in to change notification settings - Fork 408
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
Improv: Separate module logger from code logger #16
Comments
Other implementations for the record: SAM CLI
|
Now available in 0.8.0 |
Hello Heitor, Today I've tried the new logging package from the develop branch. I've experienced a side effect in lambdas that also use the tracer functionality. They started to show the following message: I didn't have to add any x-ray related module before. If I remove the line where I import the tracer module, then this error goes away. Some context:
Any thoughts? |
Thanks for reporting Marcio!
A couple of questions:
* Does that happen when you don’t use a Layer?
* Can you also share the steps you used to build the layer?
* If the layer is public, could you share the ARN?
I’ll try to build a Layer to see if I can reproduce it. As the Logger
doesn’t use tracing, my guess would be that the Layer doesn’t have
Powertools deps (x-ray, fastjsonschema), and that can be inspected at the
Layer itself by downloading it
…On Mon, 27 Apr 2020 at 04:23, marcioemiranda ***@***.***> wrote:
Hello Heitor,
Today I've tried the new logging package from the develop branch.
I've experienced a side effect in lambdas that also use the tracer
functionality.
They started to show the following message:
Unable to import module 'xxxx/lambda_function': No module named
'aws_xray_sdk'
I didn't have to add any x-ray related module before.
I've just changed the way I import the logger module and used the logger
class instead of the function.
If I remove the line where I import the tracer module, then this error
goes away.
Some context:
- I use python 3.6
- aws lambda power tools is deployed in lambda layers.
- I have a layer version with v0.8 and a couple of lambdas pointing to
it and the rest of the app pointing to previous versions
Any thoughts?
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<https://github.com/awslabs/aws-lambda-powertools/issues/16#issuecomment-619690186>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAZPQBFR4PHPNYHMZMHGYSDROT3CZANCNFSM4MEQD4EQ>
.
|
Hi Marcio - I've just tested by creating a layer from scratch and works just fine. I've published the same testing layer in Sao Paulo region where you could test: Steps when trying to reproduce # Using current version with the new Logger class
echo "aws-lambda-powertools==0.8.0" > requirements.txt
mkdir -p layer/python
# Build a Layer using Docker Lambda
docker run -v "$PWD":/var/task "lambci/lambda:build-python3.7" \
/bin/sh -c "pip install -r requirements.txt -t layer/python/; exit"
# Create ZIP file
cd layer/ && zip -r ../layer.zip python/ > /dev/null && cd -
# Publish Layer
aws lambda publish-layer-version --layer-name aws-lambda-powertools \
--description "Lambda Powertools 0.8.0" \
--zip-file fileb://layer.zip \
--compatible-runtimes "python3.6" "python3.7" "python3.8"
# Use "LayerVersionArn" output value in any existing or brand new function |
Hello Heitor,
The issue is indeed related to the way I've uploaded the layer.
In previous versions I've run pip and thus installed aws power tools and
all dependencies.
In this past one I've downloaded the develop branch from github directly.
I've just downloaded both zip files from the lambda layer and this is clear
now, thanks.
Em seg., 27 de abr. de 2020 às 02:37, Heitor Lessa <notifications@github.com>
escreveu:
… Thanks for reporting Marcio!
A couple of questions:
* Does that happen when you don’t use a Layer?
* Can you also share the steps you used to build the layer?
* If the layer is public, could you share the ARN?
I’ll try to build a Layer to see if I can reproduce it. As the Logger
doesn’t use tracing, my guess would be that the Layer doesn’t have
Powertools deps (x-ray, fastjsonschema), and that can be inspected at the
Layer itself by downloading it
On Mon, 27 Apr 2020 at 04:23, marcioemiranda ***@***.***>
wrote:
> Hello Heitor,
>
> Today I've tried the new logging package from the develop branch.
>
> I've experienced a side effect in lambdas that also use the tracer
> functionality.
>
> They started to show the following message:
> Unable to import module 'xxxx/lambda_function': No module named
> 'aws_xray_sdk'
>
> I didn't have to add any x-ray related module before.
> I've just changed the way I import the logger module and used the logger
> class instead of the function.
>
> If I remove the line where I import the tracer module, then this error
> goes away.
>
> Some context:
>
> - I use python 3.6
> - aws lambda power tools is deployed in lambda layers.
> - I have a layer version with v0.8 and a couple of lambdas pointing to
> it and the rest of the app pointing to previous versions
>
> Any thoughts?
>
> —
> You are receiving this because you modified the open/close state.
> Reply to this email directly, view it on GitHub
> <
https://github.com/awslabs/aws-lambda-powertools/issues/16#issuecomment-619690186
>,
> or unsubscribe
> <
https://github.com/notifications/unsubscribe-auth/AAZPQBFR4PHPNYHMZMHGYSDROT3CZANCNFSM4MEQD4EQ
>
> .
>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<https://github.com/awslabs/aws-lambda-powertools/issues/16#issuecomment-619733693>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AG62T2NKCI3GBUXXJYALN2DROUKYDANCNFSM4MEQD4EQ>
.
--
Atenciosamente,
Marcio Miranda | Gerente de Desenvolvimento | marcio.miranda@druid.com.br |
+55 21 3535.9137
[image: Druid - www.druid.com.br] <http://www.druid.com.br/>
DRUID | Rio de Janeiro - RJ
CEO Office | Avenida João Cabral de Mello Neto, Nº 850 - Bloco III - 18º
Andar - Sala 1723 | Barra da Tijuca | CEP 22.775-057
Tel - 55 21 3535.9136 | Fax - 55 21 3535.9145
|
From discussion with @jfuss, it'd best to create a separate environment variable to control powertools logging level as opposed to
LOG_LEVEL
.While
LOG_LEVEL
simplifies DX it does raise concerns if you want to isolate logging level to your Lambda function only.Convo: aws-powertools/powertools-lambda#15 (comment)
Changes
POWERTOOLS_LOG_LEVEL
environment variablePOWERTOOLS_LOG_LEVEL
aws-lambda-powertools
The text was updated successfully, but these errors were encountered: