Lộ trình đang học Current learning path

Developer Platform Developer Platform

Build và deploy apps trên Cloudflare. Build and deploy apps on Cloudflare.

Về trang lộ trình Track home

Phần 4: Vận hành và bước tiếp Part 4: Operate and level up · Bài 1/2 Lesson 1/2

Web Analytics và log Workers Web Analytics and Worker logs

Bật Cloudflare Web Analytics cho traffic. Dùng `wrangler tail` hoặc observability khi debug API. Enable Cloudflare Web Analytics for traffic. Use `wrangler tail` or observability when debugging APIs.

Các bước thực hiện Step-by-step

  1. Analytics → Web Analytics → Add site (snippet hoặc automatic qua zone). Analytics → Web Analytics → Add site (snippet or automatic via zone).
  2. Workers/Pages: bật Observability hoặc `wrangler tail`. Workers/Pages: enable Observability or `wrangler tail`.
  3. Log structured JSON từ API routes. Log structured JSON from API routes.
  4. Alert khi error rate tăng (Logpush nếu cần). Alert on error rate spikes (Logpush if needed).

Giải thích chi tiết Detailed explanation

Edge app cần observability khác server truyền thống — tail logs và analytics là bước vận hành cơ bản. Edge apps need different observability than traditional servers — tail logs and analytics are baseline ops.

Lưu ý (best practices) Note (best practices)

Bật Workers Logs và Traces trước khi lên production — dùng structured JSON trong `console.log` để tìm kiếm/lọc trên dashboard Observability. Enable Workers Logs and Traces before production — use structured JSON in `console.log` for searchable, filterable logs in the Observability dashboard.

Nguồn: Source: Workers Best Practices Workers Best Practices

Ví dụ triển khai (Cloudflare Resources) Deployment examples (Cloudflare Resources)

Ví dụ chính thức từ Cloudflare Resources — gợi ý theo chủ đề bài học trong lộ trình này. Official examples from Cloudflare Resources — matched to this lesson within this path.

Tutorial Tutorial Developer Platform Developer Platform

Log và store upload events in R2 với event notifications Log and store upload events in R2 with event notifications

Tóm tắt thực hành: Log và store upload events in R2 với event notifications trên R2 Object Storage. This example provides a step-by-step guide on using event notifications to capture and store R2 upload logs in a separate bucket.

This example provides a step-by-step guide on using event notifications to capture and store R2 upload logs in a separate bucket.

Tìm hiểu thêm Learn more
Sơ đồ kiến trúc Reference architecture diagram Chung / đa lĩnh vực Cross-cutting

Multi-vendor AI observability and control

/reference-architecture/diagrams/ai/ai-multivendor-observability-control

Tìm hiểu thêm Learn more
Tutorial Tutorial Cloudflare One Cloudflare One

Sử dụng Cloudflare R2 as Zero Trust log destination Use Cloudflare R2 as a Zero Trust log destination

Tóm tắt thực hành: Sử dụng Cloudflare R2 as Zero Trust log destination trên Cloudflare One (Zero Trust). This tutorial covers how to build a Cloudflare R2 bucket to store Zero Trust logs. It also shows how to connect the bucket to the Zero Trust Logpush service.

This tutorial covers how to build a Cloudflare R2 bucket to store Zero Trust logs. It also shows how to connect the bucket to the Zero Trust Logpush service.

Tìm hiểu thêm Learn more

Xem thêm ví dụ trong lộ trình → More examples in this path →

Tài liệu Cloudflare Developers Cloudflare Developer docs

Sản phẩm liên quan Related products

Học xong hoặc muốn đổi hướng? Finished or want a different path?

Ba lộ trình độc lập — mỗi lộ trình chỉ gồm bài học và tài liệu trong phạm vi đó. Chọn lộ trình khác khi sẵn sàng, không cần học song song. Three independent paths — each includes only lessons and materials for that scope. Switch when you are ready; no need to study paths in parallel.

Chưa chắc — làm bài chọn lộ trình Not sure — use the path selector · So sánh cả ba lộ trình Compare all three paths