Cov txheej txheem:

Kuv tuaj yeem nrhiav tau lambda cav qhov twg?
Kuv tuaj yeem nrhiav tau lambda cav qhov twg?

Video: Kuv tuaj yeem nrhiav tau lambda cav qhov twg?

Video: Kuv tuaj yeem nrhiav tau lambda cav qhov twg?
Video: Xav rov ntsib koj ib zaug dua. 8/8/2018 2024, Kaum ib hlis
Anonim

Koj saib tau cov ntaub ntawv hauv Lambda console, hauv CloudWatch Cov log console, los yog los ntawm kab hais kom ua.

Saib Logs hauv AWS Management Console

  • Qhib lub Cov log nplooj ntawv ntawm CloudWatch console.
  • Xaiv qhov log group for your function (/aws/ lambda /function-name).
  • Xaiv thawj kwj hauv daim ntawv teev npe.

Yog li ntawd, kuv yuav saib Lambda cav li cas?

Rau saib Lambda cav , xaiv Cov log dua los ntawm sab laug vaj huam sib luag. Ces xaiv thawj log group prefixed with /aws/ lambda / ua raws li lub npe ua haujlwm. Xaiv thawj kwj. Koj yuav tsum pom START, END thiab REPORT nrog cov ntaub ntawv ua haujlwm yooj yim rau txhua daim ntawv thov ua haujlwm.

Tsis tas li ntawd, cov cuab yeej twg siv los saib xyuas thiab daws teeb meem Lambda daim ntawv thov? Top 3 AWS Lambda Performance Monitoring Tools

  • Dashbird yog qhov zoo tshaj plaws hauv kev muab kev ceeb toom yuam kev thiab tseem saib xyuas kev txhawb nqa.
  • Datadog muab kev sib koom ua ke ntawm metrics, cav, thiab kab.
  • Logz.io muaj ELK cov kev pabcuam uas yog qhov kev xaiv zoo tshaj plaws rau kev ntsuas thiab kev ua haujlwm tau yooj yim thaum tsis tas yuav ua haujlwm hloov kho lossis tswj kev muaj peev xwm.

Yog li ntawd, kuv yuav nkag mus rau hauv lambda ntawm CloudWatch li cas?

Muab CloudWatch Log Pab Pawg rau Koj Lub Luag Haujlwm Lambda

  1. Mus rau Triggers tab ntawm koj lub luag haujlwm Lambda.
  2. Xaiv Ntxiv Trigger.
  3. Hauv Add Trigger tam sim ntawd, nyem lub thawv raws li tau qhia thiab xaiv CloudWatch Logs los ntawm cov ntawv qhia zaub mov nco.
  4. Xaiv CloudWatch Log Group ntxiv rau koj txoj haujlwm.
  5. Ntxiv lub Filter Lub Npe rau koj lub cim.

Yuav ua li cas koj debug lambda hauv Python?

Kawm paub yuav ua li cas koj tuaj yeem debug koj cov haujlwm lambda hauv Python

  1. Ntxiv qhov Visual Studio Code tso tawm teeb tsa.
  2. Nruab Python Cov Cuab Yeej rau Visual Studio Debug (PTVSD) pob.
  3. Ntxiv PTVSD code.
  4. Invoke your function with AWS SAM CLI.
  5. Pib debugger thiab txuas rau PTVSD.

Pom zoo: