Site icon Learning & Doing

Monitoring and Logging for Cloud Functions

logging

“Monitoring and Logging for Cloud Functions”

Pengantar

Di lab ini, Anda menggunakan Cloud Monitoring untuk melihat detail Cloud Functions di Google Cloud Console. Detail Cloud Function mencakup waktu dan jumlah eksekusi, serta penggunaan memori.

Praktikum

Task 1. Viewing Cloud Function logs & metrics in Cloud Monitoring

Function Name: helloWorld
Trigger type: HTTP
Authentication: check the box next to Allow unauthenticated invocations
curl -LO 'https://github.com/tsenart/vegeta/releases/download/v6.3.0/vegeta-v6.3.0-linux-386.tar.gz'
tar xvzf vegeta-v6.3.0-linux-386.tar.gz
echo "GET https://-.cloudfunctions.net/helloWorld" | ./vegeta attack -duration=300s > results.bin

Task 2. Create logs-based metric

hange the Metric Type to Distribution.
Name your metric CloudFunctionLatency-Logs.
Enter textPayload for Field name.
Enter the following in the Regular Expression field:
execution took (\d+)

Task 3. Metrics Explorer

Create a Monitoring Metrics Scope

Task 4. Create charts on the Monitoring Overview window

Penutup

Sahabat Blog Learning & Doing demikianlah penjelasan mengenai Monitoring and Logging for Cloud Functions. Semoga Bermanfaat . Sampai ketemu lagi di postingan berikut nya.

Exit mobile version