๋ผ์ด๋ธ๋ฌ๋ฆฌ์ Google.Cloud.Diagnostics ์งํฉ์ ์ฌ์ฉํ์ฌ C# ์ ํ๋ฆฌ์ผ์ด์ ์์ Error Reporting์ ์ค๋ฅ ๋ณด๊ณ ์๋ฅผ ๋ณด๋ผ ์ ์์ต๋๋ค. ๋ค์๊ณผ ๊ฐ์ ๊ฒฝ์ฐ ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ Google.Cloud.Diagnostics ์งํฉ์ ์ฌ์ฉํ์ฌ ์ค๋ฅ ๊ทธ๋ฃน์ ๋ง๋ญ๋๋ค.
- ๋ก๊ทธ ํญ๋ชฉ์ด ํฌํจ๋ ๋ก๊ทธ ๋ฒํท์ ๊ณ ๊ฐ ๊ด๋ฆฌ ์ํธํ ํค(CMEK)๊ฐ ์์ต๋๋ค.
- ๋ก๊ทธ ๋ฒํท์ด ๋ค์ ์ค ํ๋๋ฅผ ์ถฉ์กฑํฉ๋๋ค.
- ๋ก๊ทธ ํญ๋ชฉ์ด ์์๋ ๋์ผํ ํ๋ก์ ํธ์ ๋ก๊ทธ ๋ฒํท์ด ์ ์ฅ๋์ด ์์ต๋๋ค.
- ๋ก๊ทธ ํญ๋ชฉ์ด ํ๋ก์ ํธ๋ก ๋ผ์ฐํ ๋ ํ ํ๋ก์ ํธ๊ฐ ํด๋น ๋ก๊ทธ ํญ๋ชฉ์ ์์ ๋ก๊ทธ ๋ฒํท์ ์ ์ฅํ์ต๋๋ค.
- ์ปค์คํ ์ค๋ฅ ์ด๋ฒคํธ๋ฅผ ๋ณด๊ณ ํฉ๋๋ค.
Error Reporting์ Cloud Functions, App Engine, Compute Engine, Google Kubernetes Engine๊ณผ ๊ฐ์ ์ผ๋ถ Google Cloud ์๋น์ค์ ํตํฉ๋์ด ์์ต๋๋ค. Error Reporting์ ํด๋น ์๋น์ค์์ ์คํ๋๋ ์ ํ๋ฆฌ์ผ์ด์ ์์ Cloud Logging์ ๋ก๊น ํ ์ค๋ฅ๋ฅผ ํ์ํฉ๋๋ค. ์์ธํ ๋ด์ฉ์ ์ด ํ์ด์ง์ Google Cloud์์ ์คํ์ ์ฐธ๊ณ ํ์ธ์.
๋ํ Logging์ ์ฌ์ฉํ์ฌ Error Reporting์ ์ค๋ฅ ๋ฐ์ดํฐ๋ฅผ ๋ณด๋ผ ์๋ ์์ต๋๋ค. ๋ฐ์ดํฐ ํ์ ์ง์ ์๊ตฌ์ฌํญ์ ๋ํ ์์ธํ ๋ด์ฉ์ Logging์ ํ์ ์ง์ ์ค๋ฅ ๋ฉ์์ง๋ฅผ ์ฐธ์กฐํ์ธ์.
์์ํ๊ธฐ ์ ์
- Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Verify that billing is enabled for your Google Cloud project.
-
Enable the Error Reporting API .
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Verify that billing is enabled for your Google Cloud project.
-
Enable the Error Reporting API .
-
ASP.NET Core 3 ์ด์์ ๋์์ผ๋ก ํ๋ ์ ํ๋ฆฌ์ผ์ด์
์ ๊ฒฝ์ฐ
Google.Cloud.Diagnostics.AspNetCore3
๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ฌ์ฉํฉ๋๋ค. NuGet์์ ์ด ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ค์นํ ์ ์์ต๋๋ค. -
์ด์ ๋ฒ์ ์ ASP.NET Core๋ฅผ ๋์์ผ๋ก ํ๋ ์ ํ๋ฆฌ์ผ์ด์
์ ๊ฒฝ์ฐ
Google.Cloud.Diagnostics.AspNetCore
๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ฌ์ฉํฉ๋๋ค. NuGet์์ ์ด ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ค์นํ ์ ์์ต๋๋ค. -
ASP.NET Core ์ด์ธ์ ํ๋ ์์ํฌ๋ฅผ ๋์์ผ๋ก ํ๋ ์ ํ๋ฆฌ์ผ์ด์
์ ๊ฒฝ์ฐ
Google.Cloud.Diagnostics.Common
๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ฌ์ฉํฉ๋๋ค. NuGet์์ ์ด ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ค์นํ ์ ์์ต๋๋ค. -
Google.Cloud.Diagnostics.AspNetCore3
๋ฌธ์ -
Google.Cloud.Diagnostics.AspNetCore
๋ฌธ์ -
Google.Cloud.Diagnostics.Common
๋ฌธ์ ์ปจํ ์ด๋์ ์ฌ์ฉํ ์๋น์ค ๊ณ์ ์ Error Reporting ์์ฑ์ ์ญํ (
roles/errorreporting.writer
)์ด ๋ถ์ฌ๋์๋์ง ํ์ธํฉ๋๋ค.Compute Engine ๊ธฐ๋ณธ ์๋น์ค ๊ณ์ ๋๋ ์ปค์คํ ์๋น์ค ๊ณ์ ์ ์ฌ์ฉํ ์ ์์ต๋๋ค.
์ญํ ๋ถ์ฌ์ ๋ํ ์์ธ ์ค๋ช ์ ํ๋ก์ ํธ, ํด๋, ์กฐ์ง์ ๋ํ ์ก์ธ์ค ๊ด๋ฆฌ๋ฅผ ์ฐธ์กฐํ์ธ์.
ํด๋ฌ์คํฐ๋ฅผ ๋ง๋ค๊ณ ํด๋ฌ์คํฐ์
cloud-platform
์ก์ธ์ค ๋ฒ์๋ฅผ ๋ถ์ฌํฉ๋๋ค.์๋ฅผ ๋ค์ด ๋ค์ create ๋ช ๋ น์ด๋
cloud-platform
์ก์ธ์ค ๋ฒ์์ ์๋น์ค ๊ณ์ ์ ์ง์ ํฉ๋๋ค.gcloud container clusters create CLUSTER_NAME --service-account SERVICE_ACCT_NAME --scopes=cloud-platform
VM ์ธ์คํด์ค์ ์ฌ์ฉํ ์๋น์ค ๊ณ์ ์ Error Reporting ์์ฑ์ ์ญํ (
roles/errorreporting.writer
)์ด ๋ถ์ฌ๋์๋์ง ํ์ธํฉ๋๋ค.Compute Engine ๊ธฐ๋ณธ ์๋น์ค ๊ณ์ ๋๋ ์ปค์คํ ์๋น์ค ๊ณ์ ์ ์ฌ์ฉํ ์ ์์ต๋๋ค.
์ญํ ๋ถ์ฌ์ ๋ํ ์์ธ ์ค๋ช ์ ํ๋ก์ ํธ, ํด๋, ์กฐ์ง์ ๋ํ ์ก์ธ์ค ๊ด๋ฆฌ๋ฅผ ์ฐธ์กฐํ์ธ์.
-
Google Cloud ์ฝ์์์ VM ์ธ์คํด์ค ํ์ด์ง๋ก ์ด๋ํฉ๋๋ค.
๊ฒ์์ฐฝ์ ์ฌ์ฉํ์ฌ ์ด ํ์ด์ง๋ฅผ ์ฐพ์ ๊ฒฝ์ฐ ๋ถ์ ๋ชฉ์ด Compute Engine์ธ ๊ฒฐ๊ณผ๋ฅผ ์ ํํฉ๋๋ค.
cloud-platform
์ก์ธ์ค ๋ฒ์๋ฅผ ์ง์ ํ๋ ค๋ VM ์ธ์คํด์ค๋ฅผ ์ ํํฉ๋๋ค.์ค์ง๋ฅผ ํด๋ฆญํ ํ ์์ ์ ํด๋ฆญํฉ๋๋ค.
ID ๋ฐ API ์ก์ธ์ค ์น์ ์์ Error Reporting ์์ฑ์ ์ญํ (
roles/errorreporting.writer
)์ด ์๋ ์๋น์ค ๊ณ์ ์ ์ ํํฉ๋๋ค.์ก์ธ์ค ๋ฒ์ ์น์ ์์ ๋ชจ๋ Cloud API์ ๋ํ ์ ์ฒด ์ก์ธ์ค ํ์ฉ์ ์ ํํ ํ ๋ณ๊ฒฝ์ฌํญ์ ์ ์ฅํฉ๋๋ค.
์์/์ฌ๊ฐ๋ฅผ ํด๋ฆญํฉ๋๋ค.
-
Google.Cloud.Diagnostics.AspNetCore3
๋ฌธ์ -
Google.Cloud.Diagnostics.AspNetCore
๋ฌธ์ -
Google.Cloud.Diagnostics.Common
๋ฌธ์
ํด๋ผ์ด์ธํธ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ค์น
๋ผ์ด๋ธ๋ฌ๋ฆฌ์ Google.Cloud.Diagnostics ์งํฉ์ ์ฌ์ฉํ๋ฉด ๊ฑฐ์ ๋ชจ๋ ๊ณณ์์ ์คํ๋๋ C# ์ ํ๋ฆฌ์ผ์ด์ ์์ ๋ณด๊ณ ๋๋ ์ค๋ฅ๋ฅผ ๋ชจ๋ํฐ๋งํ๊ณ ํ์ธํ ์ ์์ต๋๋ค.
์ค์น์ ๋ํ ์์ธํ ๋ด์ฉ์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ Google.Cloud.Diagnostics ์งํฉ์ ๋ํ ๋ฌธ์๋ฅผ ์ฐธ์กฐํ์ธ์. ๋ํ Issue Tracker๋ฅผ ํตํด ๋ฌธ์ ๋ฅผ ๋ณด๊ณ ํ ์๋ ์์ต๋๋ค.
ํด๋ผ์ด์ธํธ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ๊ตฌ์ฑ
์์ธํ ๋ด์ฉ๊ณผ ์์๋ ๋ค์ ๋ฆฌ์์ค๋ฅผ ์ฐธ์กฐํ์ธ์.
Google Cloud์์ ์ฑ ์คํ
projects.events.report
๋ฅผ ์ฌ์ฉํ์ฌ ์ค๋ฅ ๊ทธ๋ฃน์ ๋ง๋ค๋ ค๋ฉด ์๋น์ค ๊ณ์ ์ Error Reporting ์์ฑ์ ์ญํ (roles/errorreporting.writer
)์ด ํ์ํฉ๋๋ค.
์ผ๋ถ Google Cloud ์๋น์ค๋ ์ ํฉํ ์๋น์ค ๊ณ์ ์ Error Reporting ์์ฑ์ ์ญํ (roles/errorreporting.writer
)์ ์๋์ผ๋ก ๋ถ์ฌํฉ๋๋ค. ํ์ง๋ง ์ผ๋ถ ์๋น์ค์ ๊ฒฝ์ฐ์๋ ์ฌ์ฉ์๊ฐ ์ ํฉํ ์๋น์ค ๊ณ์ ์ ์ด ์ญํ ์ ๋ถ์ฌํด์ผ ํฉ๋๋ค.
Cloud Run ๋ฐ Cloud Run Functions
Cloud Run์์ ์ฌ์ฉํ๋ ๊ธฐ๋ณธ ์๋น์ค ๊ณ์ ์๋ Error Reporting ์์ฑ์ ์ญํ (roles/errorreporting.writer
) ๊ถํ์ด ์์ต๋๋ค.
๋ผ์ด๋ธ๋ฌ๋ฆฌ์ Google.Cloud.Diagnostics ์งํฉ์ ๋ช ์์ ์ผ๋ก ์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด๋ฅผ ์ ๊ณตํ์ง ์์๋ ์ฌ์ฉ ๊ฐ๋ฅํฉ๋๋ค.
Cloud Run์ Error Reporting์ ์ฌ์ฉํ๋๋ก ์๋์ผ๋ก ๊ตฌ์ฑ๋ฉ๋๋ค. ์ฒ๋ฆฌ๋์ง ์์ JavaScript ์์ธ๋ Logging์ ๋ํ๋๊ณ ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ Google.Cloud.Diagnostics ์งํฉ์ ์ฌ์ฉํ์ง ์์๋ Error Reporting์์ ์ฒ๋ฆฌํฉ๋๋ค.
App Engine ๊ฐ๋ณํ ํ๊ฒฝ
App Engine์ ๊ธฐ๋ณธ ์๋น์ค ๊ณ์ ์ Error Reporting ์์ฑ์ ์ญํ (roles/errorreporting.writer
)์ ์๋์ผ๋ก ๋ถ์ฌํฉ๋๋ค.
๋ผ์ด๋ธ๋ฌ๋ฆฌ์ Google.Cloud.Diagnostics ์งํฉ์ ๋ช ์์ ์ผ๋ก ์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด๋ฅผ ์ ๊ณตํ์ง ์์๋ ์ฌ์ฉ ๊ฐ๋ฅํฉ๋๋ค.
Error Reporting์ App Engine ๊ฐ๋ณํ ํ๊ฒฝ ์ ํ๋ฆฌ์ผ์ด์
์์ ์๋์ผ๋ก ์ฌ์ฉ ์ค์ ๋๋ฉฐ ์ถ๊ฐ ์ค์ ์ ํ์ํ์ง ์์ต๋๋ค. App Engine์์ stderr
๋ก ์์ฑ๋ ๋ฉ์์ง๊ฐ ๋ถ์๋๊ณ ์คํ trace๊ฐ ํฌํจ๋์ด ์์ผ๋ฉด Error Reporting์ ํ์๋ฉ๋๋ค.
Google Cloud ์ฝ์์์ ์ ํ๋ฆฌ์ผ์ด์ ์ ์ค๋ฅ ๋ฐ ์์ธ ๋ฐ์ดํฐ๋ฅผ ๋ณด๋ ๋ฐฉ๋ฒ์ ๋ํ ์๋ด๋ ์ค๋ฅ ๋ณด๊ธฐ๋ฅผ ์ฐธ๊ณ ํ์ธ์.
Google Kubernetes Engine
Google Kubernetes Engine์ Error Reporting๋ฅผ ์ฌ์ฉํ๋ ค๋ฉด ๋ค์์ ์ํํฉ๋๋ค.
Compute Engine
Compute Engine VM ์ธ์คํด์ค์ Error Reporting์ ์ฌ์ฉํ๋ ค๋ฉด ๋ค์์ ์ํํฉ๋๋ค.
์์
์์ธํ ๋ด์ฉ๊ณผ ์์๋ ๋ค์ ๋ฆฌ์์ค๋ฅผ ์ฐธ์กฐํ์ธ์.
๋ก์ปฌ ๊ฐ๋ฐ ํ๊ฒฝ์์ ์ฑ ์คํ
์์ฒด ์ํฌ์คํ ์ด์ ์์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์คํํ๋ ๊ฒ๊ณผ ๊ฐ์ด ๋ก์ปฌ ๊ฐ๋ฐ ํ๊ฒฝ์์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ Google.Cloud.Diagnostics ์งํฉ์ ์ฌ์ฉํ๋ ค๋ฉด ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ Google.Cloud.Diagnostics ์งํฉ์ ๋ก์ปฌ ์ ํ๋ฆฌ์ผ์ด์ ๊ธฐ๋ณธ ์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด๋ฅผ ์ ๊ณตํด์ผ ํฉ๋๋ค. ์์ธํ ๋ด์ฉ์ Error Reporting์ ์ธ์ฆ์ ์ฐธ์กฐํ์ธ์.
๋ก์ปฌ ๊ฐ๋ฐ ํ๊ฒฝ์์ ์ด ํ์ด์ง์ .NET ์ํ์ ์ฌ์ฉํ๋ ค๋ฉด gcloud CLI๋ฅผ ์ค์นํ๊ณ ์ด๊ธฐํํ ํ ์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด๋ก ์ ํ๋ฆฌ์ผ์ด์ ๊ธฐ๋ณธ ์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด๋ฅผ ์ค์ ํฉ๋๋ค.
Google Cloud CLI๋ฅผ ์ค์นํฉ๋๋ค.
์ธ๋ถ ID ๊ณต๊ธ์ ์ฒด(IdP)๋ฅผ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ ๋จผ์ ์ ํด ID๋ก gcloud CLI์ ๋ก๊ทธ์ธํด์ผ ํฉ๋๋ค.
If you're using a local shell, then create local authentication credentials for your user account:
gcloud auth application-default login
You don't need to do this if you're using Cloud Shell.
If an authentication error is returned, and you are using an external identity provider (IdP), confirm that you have signed in to the gcloud CLI with your federated identity.
์์ธํ ๋ด์ฉ์ ๋ค์์ ์ฐธ์กฐํ์ธ์: Set up authentication for a local development environment.
projects.events.report
๋ฉ์๋๋ ๋ํ API ํค๋ฅผ ์ง์ํฉ๋๋ค.
์ธ์ฆ์ API ํค๋ฅผ ์ฌ์ฉํ๋ ค๋ ๊ฒฝ์ฐ ๋ก์ปฌ ์ ํ๋ฆฌ์ผ์ด์
๊ธฐ๋ณธ ์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด ํ์ผ์ ์ค์ ํ ํ์๊ฐ ์์ต๋๋ค.
์์ธํ ๋ด์ฉ์ ๋ค์์ ์ฐธ์กฐํ์ธ์:
Google Cloud ์ธ์ฆ ๋ฌธ์์ API ํค ๋ง๋ค๊ธฐ
์ค๋ฅ ๋ณด๊ณ ์ ๋ณด๊ธฐ
Google Cloud ์ฝ์์์ Error Reporting ํ์ด์ง๋ก ์ด๋ํฉ๋๋ค.
๊ฒ์์ฐฝ์ ์ฌ์ฉํ์ฌ ์ด ํ์ด์ง๋ฅผ ์ฐพ์ ์๋ ์์ต๋๋ค.
์์ธํ ๋ด์ฉ์ ์ค๋ฅ ๋ณด๊ธฐ๋ฅผ ์ฐธ์กฐํ์ธ์.