2. สร้าง WebAPI ผ่าน .NET CLI
$ dotnet new webapi --language C# --output src/MyWeb
3. ติดตั้ง Package Sentry.AspNetCore
$ dotnet add src/MyWeb package Sentry.AspNetCore
4. Integrate Sentry ด้วยฟังก์ชัน UseSentry()
ในไฟล์ src/MyWeb/Program.cs
5. เพิ่ม Dsn
ของ Sentry ในไฟล์ src/MyWeb/appsettings.json
6. เพิ่ม API src/MyWeb/Controllers/HelloController.cs
7. รันโปรแกรม
$ dotnet run --project src/MyWeb/MyWeb.csproj
8. ทดสอบ API ด้วย curl
โดยส่ง name
เป็นค่าว่างเพื่อให้เกิด Exception
$ curl http://localhost:5000/hello/sayHello?name=
9. ตรวจสอบที่ Sentry.io จะพบว่ามี 1 Issue ซึ่งเกิดจากการเรียก API sayHello