Diagnostic - Create Or Update
Membuat Diagnostik baru atau memperbarui yang sudah ada.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}?api-version=2021-08-01
Parameter URI
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
diagnostic
|
path | True |
|
Pengidentifikasi diagnostik. Harus unik dalam instans layanan API Management saat ini. Regex pattern: |
|
resource
|
path | True |
|
Nama grup sumber daya. |
|
service
|
path | True |
|
Nama layanan API Management. Regex pattern: |
|
subscription
|
path | True |
|
Kredensial langganan yang secara unik mengidentifikasi langganan Microsoft Azure. ID langganan membentuk bagian dari URI untuk setiap panggilan layanan. |
|
api-version
|
query | True |
|
Versi API yang akan digunakan dengan permintaan klien. |
Header Permintaan
| Name | Required | Type | Description |
|---|---|---|---|
| If-Match |
|
ETag Entitas. Tidak diperlukan saat membuat entitas, tetapi diperlukan saat memperbarui entitas. |
Isi Permintaan
| Name | Required | Type | Description |
|---|---|---|---|
| properties.loggerId | True |
|
Id Sumber Daya dari pencatat target. |
| properties.alwaysLog |
Menentukan jenis pengaturan pengambilan sampel pesan apa yang tidak boleh diterapkan. |
||
| properties.backend |
Pengaturan diagnostik untuk pesan HTTP masuk/keluar ke Backend |
||
| properties.frontend |
Pengaturan diagnostik untuk pesan HTTP masuk/keluar ke Gateway. |
||
| properties.httpCorrelationProtocol |
Mengatur protokol korelasi yang akan digunakan untuk diagnostik Insights Aplikasi. |
||
| properties.logClientIp |
|
Catat ClientIP. Defaultnya adalah false. |
|
| properties.operationNameFormat |
Format telemetri Insights Nama Operasi untuk Aplikasi. Defaultnya adalah Nama. |
||
| properties.sampling |
Pengaturan pengambilan sampel untuk Diagnostik. |
||
| properties.verbosity |
Tingkat verbositas yang diterapkan pada jejak yang dipancarkan oleh kebijakan pelacakan. |
Respons
| Name | Type | Description |
|---|---|---|
| 200 OK |
Diagnostik berhasil diperbarui Headers
|
|
| 201 Created |
Diagnostik berhasil dibuat. Headers
|
|
| Other Status Codes |
Respons kesalahan yang menjelaskan mengapa operasi gagal. |
Keamanan
azure_auth
Azure Active Directory Flow OAuth2.
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
| Name | Description |
|---|---|
| user_impersonation | meniru akun pengguna Anda |
Contoh
ApiManagementCreateDiagnostic
Sample Request
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/diagnostics/applicationinsights?api-version=2021-08-01
{
"properties": {
"alwaysLog": "allErrors",
"loggerId": "/loggers/azuremonitor",
"sampling": {
"samplingType": "fixed",
"percentage": 50
},
"frontend": {
"request": {
"headers": [
"Content-type"
],
"body": {
"bytes": 512
}
},
"response": {
"headers": [
"Content-type"
],
"body": {
"bytes": 512
}
}
},
"backend": {
"request": {
"headers": [
"Content-type"
],
"body": {
"bytes": 512
}
},
"response": {
"headers": [
"Content-type"
],
"body": {
"bytes": 512
}
}
}
}
}
Sample Response
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/diagnostics/applicationinsights",
"type": "Microsoft.ApiManagement/service/diagnostics",
"name": "applicationinsights",
"properties": {
"alwaysLog": "allErrors",
"loggerId": "/loggers/azuremonitor",
"sampling": {
"samplingType": "fixed",
"percentage": 50
},
"frontend": {
"request": {
"headers": [
"Content-type"
],
"body": {
"bytes": 512
}
},
"response": {
"headers": [
"Content-type"
],
"body": {
"bytes": 512
}
}
},
"backend": {
"request": {
"headers": [
"Content-type"
],
"body": {
"bytes": 512
}
},
"response": {
"headers": [
"Content-type"
],
"body": {
"bytes": 512
}
}
}
}
}
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/diagnostics/applicationinsights",
"type": "Microsoft.ApiManagement/service/diagnostics",
"name": "applicationinsights",
"properties": {
"alwaysLog": "allErrors",
"loggerId": "/loggers/applicationinsights",
"sampling": {
"samplingType": "fixed",
"percentage": 50
},
"frontend": {
"request": {
"headers": [
"Content-type"
],
"body": {
"bytes": 512
}
},
"response": {
"headers": [
"Content-type"
],
"body": {
"bytes": 512
}
}
},
"backend": {
"request": {
"headers": [
"Content-type"
],
"body": {
"bytes": 512
}
},
"response": {
"headers": [
"Content-type"
],
"body": {
"bytes": 512
}
}
}
}
}
Definisi
|
Always |
Menentukan jenis pengaturan pengambilan sampel pesan apa yang tidak boleh diterapkan. |
|
Body |
Pengaturan pengelogan isi. |
|
Data |
|
|
Data |
|
|
Data |
Mode masking data. |
|
Diagnostic |
Detail diagnostik. |
|
Error |
Kontrak Bidang Kesalahan. |
|
Error |
Respons Kesalahan. |
|
Http |
Mengatur protokol korelasi yang akan digunakan untuk diagnostik Insights Aplikasi. |
|
Http |
Pengaturan diagnostik pesan http. |
|
Operation |
Format telemetri Insights Nama Operasi untuk Aplikasi. Defaultnya adalah Nama. |
|
Pipeline |
Pengaturan diagnostik untuk pesan HTTP masuk/keluar ke Gateway. |
|
Sampling |
Pengaturan pengambilan sampel untuk Diagnostik. |
|
Sampling |
Jenis pengambilan sampel. |
| Verbosity |
Tingkat verbositas yang diterapkan pada jejak yang dipancarkan oleh kebijakan pelacakan. |
AlwaysLog
Menentukan jenis pengaturan pengambilan sampel pesan apa yang tidak boleh diterapkan.
| Name | Type | Description |
|---|---|---|
| allErrors |
|
Selalu catat semua permintaan yang salah terlepas dari pengaturan pengambilan sampel. |
BodyDiagnosticSettings
Pengaturan pengelogan isi.
| Name | Type | Description |
|---|---|---|
| bytes |
|
Jumlah byte isi permintaan untuk dicatat. |
DataMasking
| Name | Type | Description |
|---|---|---|
| headers |
Pengaturan masking untuk header |
|
| queryParams |
Pengaturan masking untuk parameter kueri Url |
DataMaskingEntity
| Name | Type | Description |
|---|---|---|
| mode |
Mode masking data. |
|
| value |
|
Nama entitas yang akan disamarkan (misalnya nama header atau parameter kueri). |
DataMaskingMode
Mode masking data.
| Name | Type | Description |
|---|---|---|
| Hide |
|
Menyembunyikan kehadiran entitas. |
| Mask |
|
Menutupi nilai entitas. |
DiagnosticContract
Detail diagnostik.
| Name | Type | Description |
|---|---|---|
| id |
|
ID sumber daya yang sepenuhnya memenuhi syarat untuk sumber daya. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} |
| name |
|
Nama sumber daya. |
| properties.alwaysLog |
Menentukan jenis pengaturan pengambilan sampel pesan apa yang tidak boleh diterapkan. |
|
| properties.backend |
Pengaturan diagnostik untuk pesan HTTP masuk/keluar ke Backend |
|
| properties.frontend |
Pengaturan diagnostik untuk pesan HTTP masuk/keluar ke Gateway. |
|
| properties.httpCorrelationProtocol |
Mengatur protokol korelasi yang akan digunakan untuk diagnostik Insights Aplikasi. |
|
| properties.logClientIp |
|
Catat ClientIP. Defaultnya adalah false. |
| properties.loggerId |
|
Id Sumber Daya dari pencatat target. |
| properties.operationNameFormat |
Format telemetri Insights Nama Operasi untuk Aplikasi. Defaultnya adalah Nama. |
|
| properties.sampling |
Pengaturan pengambilan sampel untuk Diagnostik. |
|
| properties.verbosity |
Tingkat verbositas yang diterapkan pada jejak yang dipancarkan oleh kebijakan pelacakan. |
|
| type |
|
Jenis sumber daya. Misalnya, "Microsoft.Compute/virtualMachines" atau "Microsoft. Storage/storageAccounts" |
ErrorFieldContract
Kontrak Bidang Kesalahan.
| Name | Type | Description |
|---|---|---|
| code |
|
Kode kesalahan tingkat properti. |
| message |
|
Representasi kesalahan tingkat properti yang dapat dibaca manusia. |
| target |
|
Nama properti. |
ErrorResponse
Respons Kesalahan.
| Name | Type | Description |
|---|---|---|
| error.code |
|
Kode kesalahan yang ditentukan layanan. Kode ini berfungsi sebagai sub-status untuk kode kesalahan HTTP yang ditentukan dalam respons. |
| error.details |
Daftar bidang yang tidak valid dikirim dalam permintaan, jika terjadi kesalahan validasi. |
|
| error.message |
|
Representasi kesalahan yang dapat dibaca manusia. |
HttpCorrelationProtocol
Mengatur protokol korelasi yang akan digunakan untuk diagnostik Insights Aplikasi.
| Name | Type | Description |
|---|---|---|
| Legacy |
|
Masukkan header Request-Id dan Request-Context dengan data korelasi permintaan. Lihat https://github.com/dotnet/corefx/blob/master/src/System.Diagnostics.DiagnosticSource/src/HttpCorrelationProtocol.md. |
| None |
|
Jangan membaca dan menyuntikkan header korelasi. |
| W3C |
|
Suntikkan header Konteks Pelacakan. Lihat https://w3c.github.io/trace-context. |
HttpMessageDiagnostic
Pengaturan diagnostik pesan http.
| Name | Type | Description |
|---|---|---|
| body |
Pengaturan pengelogan isi. |
|
| dataMasking |
Pengaturan masking data. |
|
| headers |
|
Array Header HTTP untuk dicatat. |
OperationNameFormat
Format telemetri Insights Nama Operasi untuk Aplikasi. Defaultnya adalah Nama.
| Name | Type | Description |
|---|---|---|
| Name |
|
API_NAME;rev=API_REVISION - OPERATION_NAME |
| Url |
|
HTTP_VERB URL |
PipelineDiagnosticSettings
Pengaturan diagnostik untuk pesan HTTP masuk/keluar ke Gateway.
| Name | Type | Description |
|---|---|---|
| request |
Pengaturan diagnostik untuk permintaan. |
|
| response |
Pengaturan diagnostik untuk respons. |
SamplingSettings
Pengaturan pengambilan sampel untuk Diagnostik.
| Name | Type | Description |
|---|---|---|
| percentage |
|
Tingkat pengambilan sampel untuk pengambilan sampel laju tetap. |
| samplingType |
Jenis pengambilan sampel. |
SamplingType
Jenis pengambilan sampel.
| Name | Type | Description |
|---|---|---|
| fixed |
|
Pengambilan sampel laju tetap. |
Verbosity
Tingkat verbositas yang diterapkan pada jejak yang dipancarkan oleh kebijakan pelacakan.
| Name | Type | Description |
|---|---|---|
| error |
|
Hanya jejak dengan 'tingkat keparahan' yang diatur ke 'kesalahan' yang akan dikirim ke pencatat yang dilampirkan ke instans diagnostik ini. |
| information |
|
Jejak dengan 'tingkat keparahan' yang diatur ke 'informasi' dan 'kesalahan' akan dikirim ke pencatat yang dilampirkan ke instans diagnostik ini. |
| verbose |
|
Semua jejak yang dipancarkan oleh kebijakan pelacakan akan dikirim ke pencatat yang dilampirkan ke instans diagnostik ini. |