Catatan
Akses ke halaman ini memerlukan otorisasi. Anda dapat mencoba masuk atau mengubah direktori.
Akses ke halaman ini memerlukan otorisasi. Anda dapat mencoba mengubah direktori.
Pengaturan konfigurasi yang menentukan perilaku runtime.
Pengaturan pagination
| Property | Default | Description |
|---|---|---|
| ukuran halaman runtime.pagination.max | Menentukan rekaman maksimum per halaman | |
| runtime.pagination.default-page-size | Mengatur rekaman default per respons |
Pengaturan REST
| Property | Default | Description |
|---|---|---|
| runtime.rest.path | "/api" |
Jalur dasar untuk titik akhir REST |
| runtime.rest.enabled | true |
Memungkinkan mengaktifkan atau menonaktifkan permintaan REST untuk semua entitas |
| runtime.rest.request-body-strict | true |
Melarang bidang asing dalam isi permintaan ketika benar |
Pengaturan GraphQL
| Property | Default | Description |
|---|---|---|
| runtime.graphql.allow-introspection | true |
Memungkinkan kueri skema GraphQL yang mendasar |
| runtime.graphql.path | "/graphql" |
Jalur dasar untuk titik akhir GraphQL |
| runtime.graphql.enabled | true |
Memungkinkan mengaktifkan atau menonaktifkan permintaan GraphQL untuk semua entitas |
| runtime.graphql.depth-limit | null |
Kedalaman maksimum kueri GraphQL yang diizinkan |
| runtime.graphql.multiple-mutations.create.enabled | false |
Memungkinkan mutasi beberapa buat untuk semua entitas |
Pengaturan host
| Property | Default | Description |
|---|---|---|
| runtime.host.max-response-size-mb | 158 |
Ukuran maksimum (MB) respons database yang diizinkan dalam satu hasil |
| runtime.host.mode | "production" |
Mode berjalan; "production" atau "development" |
Pengaturan CORS
| Property | Default | Description |
|---|---|---|
| runtime.host.cors.origins | [] |
Asal CORS yang diizinkan |
| runtime.host.cors.allow-credentials | false |
Mengatur nilai untuk header Access-Control-Allow-Credentials |
Pengaturan autentikasi
| Property | Default | Description |
|---|---|---|
| runtime.host.authentication.provider | null |
Penyedia autentikasi |
| runtime.host.authentication.jwt.audience | null |
Audiens JWT |
| runtime.host.authentication.jwt.issuer | null |
Penerbit JWT |
Pengaturan cache
| Property | Default | Description |
|---|---|---|
| runtime.cache.enabled | false |
Memungkinkan penembolokan respons secara global |
| runtime.cache.ttl-seconds | 5 |
Waktu hidup (detik) untuk cache global |
Pengaturan telemetri
| Property | Default | Description |
|---|---|---|
| runtime.telemetry.application-insights.connection-string | null |
String koneksi Application Insights |
| runtime.telemetry.application-insights.enabled | false |
Mengaktifkan atau menonaktifkan telemetri Application Insights |
| runtime.telemetry.open-telemetry.endpoint | null |
URL pengumpul OpenTelemetry |
| runtime.telemetry.open-telemetry.headers | {} |
Header ekspor OpenTelemetry |
| runtime.telemetry.open-telemetry.service-name | "dab" |
Nama layanan OpenTelemetry |
| runtime.telemetry.open-telemetry.exporter-protocol | "grpc" |
Protokol OpenTelemetry ("grpc" atau "httpprotobuf") |
| runtime.telemetry.open-telemetry.enabled | true |
Mengaktifkan atau menonaktifkan OpenTelemetry |
| runtime.telemetry.log-level.namespace | null |
Penimpaan tingkat log khusus namespace layanan |
| runtime.health.enabled | true |
Mengaktifkan atau menonaktifkan titik akhir pemeriksaan kesehatan secara global |
| runtime.health.roles | null |
Peran yang diizinkan untuk titik akhir kesehatan yang komprehensif |
| runtime.health.cache-ttl-seconds | 5 |
Waktu hidup (detik) untuk entri cache laporan pemeriksaan kesehatan |
| runtime.health.max-query-parallelism | 4 |
Kueri pemeriksaan kesehatan bersamaan maksimum (rentang: 1-8) |
Gambaran umum format
{
"runtime": {
"pagination": {
"max-page-size": <integer|null> (default: `100000`),
"default-page-size": <integer|null> (default: `100`)
},
"rest": {
"path": <string> (default: "/api"),
"enabled": <true>|<false>,
"request-body-strict": <true>|<false> (default: `true`)
},
"graphql": {
"path": <string> (default: "/graphql"),
"enabled": <true>|<false>,
"allow-introspection": <true>|<false>,
"depth-limit": <integer|null> (default: `null`),
"multiple-mutations": {
"create": {
"enabled": <true>|<false> (default: `false`)
}
}
},
"host": {
"mode": <"production"> (default) | <"development">,
"max-response-size-mb": <integer|null> (default: `158`),
"cors": {
"origins": [ "<string>" ],
"allow-credentials": <true>|<false> (default: `false`)
},
"authentication": {
"provider": <string> (default: "AppService"),
"jwt": {
"audience": "<string>",
"issuer": "<string>"
}
}
}
},
"cache": {
"enabled": <true>|<false> (default: `false`),
"ttl-seconds": <integer> (default: `5`)
},
"telemetry": {
"application-insights": {
"connection-string": "<string>",
"enabled": <true>|<false> (default: `true`)
},
"open-telemetry": {
"endpoint": "<string>",
"headers": "<string>",
"service-name": <string> (default: "dab"),
"exporter-protocol": <"grpc"> (default) | <"httpprotobuf">,
"enabled": <true>|<false> (default: `true`)
},
"log-level": {
// namespace keys
"<namespace>": <"trace"|"debug"|"information"|"warning"|"error"|"critical"|"none"|null>
}
},
"health": {
"enabled": <true>|<false> (default: `true`),
"roles": [ "<string>" ],
"cache-ttl-seconds": <integer> (default: `5`),
"max-query-parallelism": <integer> (default: `4`)
}
}
Mode (Runtime host)
| Parent | Property | Type | Required | Default |
|---|---|---|---|---|
runtime |
host |
enum (production | development) |
❌ Tidak | production |
Perilaku pengembangan
- Diaktifkan Nitro (sebelumnya Banana Cake Pop) untuk pengujian GraphQL
- Mengaktifkan UI Swagger untuk pengujian REST
- Mengaktifkan pemeriksaan kesehatan anonim
- Peningkatan verbositas pengelogan (Debug)
Format
{
"runtime": {
"host": {
"mode": "production" (default) | "development"
}
}
}
Ukuran respons maksimum (Runtime host)
| Parent | Property | Type | Required | Default |
|---|---|---|---|---|
runtime.host |
max-response-size-mb |
integer | ❌ Tidak | 158 |
Mengatur ukuran maksimum (dalam megabyte) untuk hasil tertentu. Karena respons besar dapat membatasi sistem, max-response-size-mb membatasi ukuran total (berbeda dari jumlah baris) untuk mencegah kelebihan beban, yang terutama dengan kolom besar seperti teks atau JSON.
| Value | Result |
|---|---|
| belum diatur | Gunakan default |
null |
Gunakan default |
integer |
Bilangan bulat 32-bit positif |
<= 0 |
Tidak didukung |
Format
{
"runtime": {
"host": {
"max-response-size-mb": <integer; default: 158>
}
}
}
GraphQL (runtime)
| Parent | Property | Type | Required | Default |
|---|---|---|---|---|
runtime |
graphql |
objek | ❌ Tidak | - |
Konfigurasi Global GraphQL.
Properti berlapis
| Parent | Property | Type | Required | Default |
|---|---|---|---|---|
runtime.graphql |
enabled |
boolean | ❌ Tidak | None |
runtime.graphql |
path |
string | ❌ Tidak | "/graphql" |
runtime.graphql |
depth-limit |
integer | ❌ Tidak | Tidak ada (tidak terbatas) |
runtime.graphql |
allow-introspection |
boolean | ❌ Tidak | True |
runtime.graphql |
multiple-mutations.create.enabled |
boolean | ❌ Tidak | False |
Catatan properti
- Subpath tidak diizinkan untuk
pathproperti . - Gunakan
depth-limituntuk membatasi kueri berlapis. - Atur
allow-introspectionkefalseuntuk menyembunyikan skema GraphQL. - Gunakan
multiple-mutationsuntuk menyisipkan beberapa entitas dalam satu mutasi.
Format
{
"runtime": {
"graphql": {
"enabled": <true> (default) | <false>
"depth-limit": <integer|null> (default: `null`),
"path": <string> (default: /graphql),
"allow-introspection": <true> (default) | <false>,
"multiple-mutations": {
"create": {
"enabled": <true> (default) | <false>
}
}
}
}
Contoh: beberapa mutasi
Configuration
{
"runtime": {
"graphql": {
"multiple-mutations": {
"create": {
"enabled": true
}
}
}
},
"entities": {
"User": {
"source": "dbo.Users",
"permissions": [
{
"role": "anonymous",
"actions": ["create"] // entity permissions are required
}
]
}
}
}
Mutasi GraphQL
mutation {
createUsers(input: [
{ name: "Alice", age: 30, isAdmin: true },
{ name: "Bob", age: 25, isAdmin: false },
{ name: "Charlie", age: 35, isAdmin: true }
]) {
id
name
age
isAdmin
}
}
REST (runtime)
| Parent | Property | Type | Required | Default |
|---|---|---|---|---|
runtime |
rest |
objek | ❌ Tidak | - |
Konfigurasi REST global.
Properti berlapis
| Parent | Property | Type | Required | Default |
|---|---|---|---|---|
runtime.rest |
enabled |
boolean | ❌ Tidak | None |
runtime.rest |
path |
string | ❌ Tidak | "/api" |
runtime.rest |
request-body-strict |
boolean | ❌ Tidak | True |
Catatan properti
- Jika global
enabledadalahfalse, tingkatenabledentitas individu tidak masalah. - Properti
pathtidak mendukung nilai subpath seperti/api/data. -
request-body-strictdiperkenalkan untuk membantu menyederhanakan objek POCO .NET.
request-body-strict |
Behavior |
|---|---|
true |
Bidang tambahan dalam isi permintaan menyebabkan BadRequest pengecualian. |
false |
Bidang tambahan dalam isi permintaan diabaikan. |
Format
{
"runtime": {
"rest": {
"enabled": <true> (default) | <false>,
"path": <string> (default: /api),
"request-body-strict": <true> (default) | <false>
}
}
}
Contoh: request-body-strict
- Kolom dengan
default()nilai diabaikan hanya selamaINSERTnilainya dalam payload adalahnull. Sebagai konsekuensinya,INSERToperasi ke dalamdefault()kolom, kapanrequest-body-strictadalahtrue, tidak dapat menghasilkan nilai eksplisitnull. Untuk mencapai perilaku ini,UPDATEdiperlukan operasi. - Kolom dengan
default()tidak diabaikan selamaUPDATEterlepas dari nilai payload. - Kolom komputasi selalu diabaikan.
- Kolom yang dibuat secara otomatis selalu diabaikan.
Tabel contoh
CREATE TABLE Users (
Id INT PRIMARY KEY IDENTITY, -- auto-generated column
Name NVARCHAR(50) NOT NULL,
Age INT DEFAULT 18, -- column with default
IsAdmin BIT DEFAULT 0, -- column with default
IsMinor AS IIF(Age <= 18, 1, 0) -- computed column
);
Permintaan muatan
{
"Id": 999,
"Name": "Alice",
"Age": null,
"IsAdmin": null,
"IsMinor": false,
"ExtraField": "ignored"
}
Sisipkan perilaku saat request-body-strict = false
INSERT INTO Users (Name) VALUES ('Alice');
-- Default values for Age (18) and IsAdmin (0) are applied by the database.
-- IsMinor is ignored because it’s a computed column.
-- ExtraField is ignored.
-- The database generates the Id value.
Isi Muatan Respons
{
"Id": 1, // Auto-generated by the database
"Name": "Alice",
"Age": 18, // Default applied
"IsAdmin": false, // Default applied
"IsMinor": true // Computed
}
Memperbarui perilaku saat request-body-strict = false
UPDATE Users
SET Name = 'Alice Updated', Age = NULL
WHERE Id = 1;
-- IsMinor and ExtraField are ignored.
Isi Muatan Respons
{
"Id": 1,
"Name": "Alice Updated",
"Age": null,
"IsAdmin": false,
"IsMinor": false // Recomputed by the database (false when age is `null`)
}
CORS (runtime host)
| Parent | Property | Type | Required | Default |
|---|---|---|---|---|
runtime.host |
cors |
objek | ❌ Tidak | - |
Konfigurasi CORS global.
Tip
CORS adalah singkatan dari "Berbagi Sumber Daya Lintas Asal." Ini adalah fitur keamanan browser yang mengontrol apakah halaman web dapat membuat permintaan ke domain yang berbeda dari yang melayaninya.
Properti berlapis
| Parent | Property | Type | Required | Default |
|---|---|---|---|---|
runtime.host.cors |
allow-credentials |
boolean | ❌ Tidak | False |
runtime.host.cors |
origins |
larik string | ❌ Tidak | None |
Note
Properti allow-credentials mengatur Access-Control-Allow-Credentials header CORS.
Format
{
"runtime": {
"host": {
"cors": {
"allow-credentials": <true> (default) | <false>,
"origins": ["<array-of-strings>"]
}
}
}
}
Note
Kartubebas * valid sebagai nilai untuk origins.
Penyedia (Runtime host autentikasi)
| Parent | Property | Type | Required | Default |
|---|---|---|---|---|
runtime.host.authentication |
provider |
enum (AppServiceSimulator | | EntraId | Custom) |
❌ Tidak | None |
Memilih metode autentikasi. Setiap penyedia memvalidasi identitas secara berbeda. Untuk penyiapan langkah demi langkah, lihat panduan cara menautkan di bawah ini.
Ringkasan penyedia
| Provider | Skenario penggunaan | Sumber identitas | Panduan |
|---|---|---|---|
| (dihilangkan) | Akses khusus anonim | None | — |
AppService |
Aplikasi yang dihosting Azure (EasyAuth) |
X-MS-CLIENT-PRINCIPAL Header |
Mengonfigurasi autentikasi App Service |
EntraID |
Microsoft Entra ID (Azure AD) | Token pembawa JWT | Mengonfigurasi autentikasi ID Entra |
Custom |
IdP pihak ketiga (Okta, Auth0) | Token pembawa JWT | Mengonfigurasi autentikasi JWT kustom |
Simulator |
Pengujian lokal saja | Disimulasikan | Mengonfigurasi autentikasi Simulator |
Note
Penyedia EntraId sebelumnya bernama AzureAd. Nama lama masih berfungsi untuk kompatibilitas.
Khusus anonim (tidak ada penyedia)
Saat bagian dihilangkan authentication , DAB beroperasi dalam mode khusus anonim. Semua permintaan diberi Anonymous peran sistem.
{
"host": {
// authentication section omitted
}
}
AppService
Mempercayai header identitas yang disuntikkan oleh Azure App Service EasyAuth.
{
"host": {
"authentication": {
"provider": "AppService"
}
}
}
EntraID
Memvalidasi token JWT yang dikeluarkan oleh MICROSOFT Entra ID.
{
"host": {
"authentication": {
"provider": "EntraId",
"jwt": {
"audience": "<application-id>",
"issuer": "https://login.microsoftonline.com/<tenant-id>/v2.0"
}
}
}
}
Custom
Memvalidasi token JWT dari penyedia identitas pihak ketiga.
{
"host": {
"authentication": {
"provider": "Custom",
"jwt": {
"audience": "<api-audience>",
"issuer": "https://<your-idp-domain>/"
}
}
}
}
Simulator
Mensimulasikan autentikasi untuk pengembangan dan pengujian lokal.
{
"host": {
"authentication": {
"provider": "Simulator"
}
}
}
Important
Penyedia Simulator hanya berfungsi ketika runtime.host.mode adalah development. DAB gagal dimulai jika Simulator dikonfigurasi dalam mode produksi.
Pemilihan peran
Untuk semua penyedia kecuali Simulator, X-MS-API-ROLE header memilih peran mana yang akan digunakan dari klaim pengguna yang diautentikasi. Jika dihilangkan, permintaan menggunakan Authenticated peran sistem. Untuk detail tentang evaluasi peran, lihat Otorisasi dan peran.
JWT (Runtime host autentikasi)
| Parent | Property | Type | Required | Default |
|---|---|---|---|---|
runtime.host.authentication |
jwt |
objek | ❌ Tidak | - |
Konfigurasi Global JSON Web Token (JWT).
Properti berlapis
| Parent | Property | Type | Required | Default |
|---|---|---|---|---|
runtime.host.authentication.jwt |
audience |
string | ❌ Tidak | None |
runtime.host.authentication.jwt |
issuer |
string | ❌ Tidak | None |
Format
{
"runtime": {
"host": {
"authentication": {
"jwt": {
"audience": "<client-id>",
"issuer": "<issuer-url>"
}
}
}
}
}
Penomoran halaman (Runtime)
| Parent | Property | Type | Required | Default |
|---|---|---|---|---|
runtime |
pagination |
objek | ❌ Tidak | - |
Batas penomoran halaman global untuk titik akhir REST dan GraphQL.
Properti berlapis
| Parent | Property | Type | Required | Default |
|---|---|---|---|---|
runtime.pagination |
max-page-size |
int | ❌ Tidak | 100,000 |
runtime.pagination |
default-page-size |
int | ❌ Tidak | 100 |
runtime.pagination |
next-link-relative |
boolean | ❌ Tidak | false |
Nilai yang didukung ukuran halaman maks
| Value | Result |
|---|---|
integer |
Bilangan bulat 32-bit positif didukung. |
0 |
Tidak didukung. |
-1 |
Default ke nilai maksimum yang didukung. |
< -1 |
Tidak didukung. |
Nilai yang didukung ukuran halaman default
| Value | Result |
|---|---|
integer |
Bilangan bulat positif apa pun yang kurang dari max-page-sizesaat ini. |
0 |
Tidak didukung. |
-1 |
Default ke pengaturan max-page-size saat ini. |
< -1 |
Tidak didukung. |
Perilaku relatif tautan berikutnya
Ketika next-link-relative adalah true, nilai penomoran nextLink halaman menggunakan URL relatif alih-alih URL absolut.
| Value | Example |
|---|---|
false (standar) |
"nextLink": "https://localhost:5001/api/users?$after=..." |
true |
"nextLink": "/api/users?$after=..." |
Format
{
"runtime": {
"pagination": {
"max-page-size": <integer; default: 100000>,
"default-page-size": <integer; default: 100>,
"next-link-relative": <boolean; default: false>
}
}
}
Note
Ketika nilai lebih besar dari max-page-size, hasilnya dibatasi pada max-page-size.
Contoh: Halaman di REST
Request
GET https://localhost:5001/api/users
Isi Muatan Respons
{
"value": [
{
"Id": 1,
"Name": "Alice",
"Age": 30,
"IsAdmin": true,
"IsMinor": false
},
{
"Id": 2,
"Name": "Bob",
"Age": 17,
"IsAdmin": false,
"IsMinor": true
}
],
"nextLink": "https://localhost:5001/api/users?$after=W3siRW50aXR5TmFtZSI6InVzZXJzIiwiRmllbGROYW1lI=="
}
Minta Halaman Berikutnya
GET https://localhost:5001/api/users?$after=W3siRW50aXR5TmFtZSI6InVzZXJzIiwiRmllbGROYW1lI==
Contoh: Penomoran halaman di GraphQL
Payload permintaan (Kueri)
query {
users {
items {
Id
Name
Age
IsAdmin
IsMinor
}
hasNextPage
endCursor
}
}
Isi Muatan Respons
{
"data": {
"users": {
"items": [
{
"Id": 1,
"Name": "Alice",
"Age": 30,
"IsAdmin": true,
"IsMinor": false
},
{
"Id": 2,
"Name": "Bob",
"Age": 17,
"IsAdmin": false,
"IsMinor": true
}
],
"hasNextPage": true,
"endCursor": "W3siRW50aXR5TmFtZSI6InVzZXJzIiwiRmllbGROYW1lI=="
}
}
}
Minta Halaman Berikutnya
query {
users(after: "W3siRW50aXR5TmFtZSI6InVzZXJzIiwiRmllbGROYW1lI==") {
items {
Id
Name
Age
IsAdmin
IsMinor
}
hasNextPage
endCursor
}
}
Contoh: Mengakses max-page-size dalam Permintaan
max-page-size Gunakan nilai menurut pengaturan $limit (REST) atau first (GraphQL) ke -1.
REST
GET https://localhost:5001/api/users?$limit=-1
GraphQL
query {
users(first: -1) {
items {
...
}
}
}
Cache (runtime)
| Parent | Property | Type | Required | Default |
|---|---|---|---|---|
runtime |
cache |
objek | ❌ Tidak | - |
Konfigurasi Cache Global.
Properti berlapis
| Parent | Property | Type | Required | Default |
|---|---|---|---|---|
runtime.cache |
enabled |
boolean | ❌ Tidak | False |
runtime.cache |
ttl-seconds |
integer | ❌ Tidak | 5 |
Tip
Properti tingkat cache.ttl-seconds entitas default ke nilai global ini.
Format
{
"runtime": {
"cache": {
"enabled": <boolean>,
"ttl-seconds": <integer>
}
}
}
Important
Jika global enabled adalah false, tingkat enabled entitas individu tidak masalah.
Telemetri (runtime)
| Parent | Property | Type | Required | Default |
|---|---|---|---|---|
runtime |
telemetry |
objek | ❌ Tidak | - |
Konfigurasi telemetri global.
Properti berlapis
| Parent | Property | Type | Required | Default |
|---|---|---|---|---|
runtime.telemetry |
log-level |
dictionary | ❌ Tidak | None |
runtime.telemetry |
application-insights |
objek | ❌ Tidak | - |
runtime.telemetry |
open-telemetry |
objek | ❌ Tidak | - |
Mengonfigurasi verbositas pengelogan per namespace. Ini mengikuti konvensi pengelogan .NET standar dan memungkinkan kontrol terperinci, meskipun mengasumsikan beberapa keakraban dengan internal pembuat API Data. Penyusun API Data adalah sumber terbuka: https://aka.ms/dab
Format
{
"runtime": {
"telemetry": {
"log-level": {
"namespace": "log-level",
"namespace": "log-level"
}
}
}
}
Tip
log-level dapat dimuat ulang dalam pengembangan dan produksi. Saat ini adalah satu-satunya properti yang mendukung hot reload dalam produksi.
Example
{
"runtime": {
"telemetry": {
"log-level": {
"Azure.DataApiBuilder.Core.Configurations.RuntimeConfigValidator": "debug",
"Azure.DataApiBuilder.Core": "information",
"default": "warning"
}
}
}
}
Application Insights (telemetri)
| Parent | Property | Type | Required | Default |
|---|---|---|---|---|
runtime.telemetry |
application-insights |
objek | ❌ Tidak | - |
Mengonfigurasi pengelogan ke Application Insights.
Properti berlapis
| Parent | Property | Type | Required | Default |
|---|---|---|---|---|
runtime.telemetry.application-insights |
enabled |
boolean | ❌ Tidak | False |
runtime.telemetry.application-insights |
connection-string |
string | ✔️ Ya | None |
Format
{
"runtime": {
"telemetry": {
"application-insights": {
"enabled": <true; default: true> | <false>
"connection-string": <string>
}
}
}
}
OpenTelemetry (telemetri)
| Parent | Property | Type | Required | Default |
|---|---|---|---|---|
runtime.telemetry |
open-telemetry |
objek | ❌ Tidak | - |
Mengonfigurasi pengelogan ke Open Telemetry.
Properti berlapis
| Parent | Property | Type | Required | Default |
|---|---|---|---|---|
runtime.telemetry.open-telemetry |
enabled |
boolean | ❌ Tidak | true |
runtime.telemetry.open-telemetry |
endpoint |
string | ✔️ Ya | None |
runtime.telemetry.open-telemetry |
headers |
string | ❌ Tidak | None |
runtime.telemetry.open-telemetry |
service-name |
string | ❌ Tidak | "dab" |
runtime.telemetry.open-telemetry |
exporter-protocol |
enum (grpc | httpprotobuf) |
❌ Tidak | grpc |
Beberapa header dipisahkan , (koma).
Format
{
"runtime": {
"telemetry": {
"open-telemetry": {
"enabled": <true> (default) | <false>,
"endpoint": <string>,
"headers": <string>,
"service-name": <string> (default: "dab"),
"exporter-protocol": <"grpc" (default) | "httpprotobuf">
}
}
}
}
Example
{
"runtime": {
"telemetry": {
"open-telemetry": {
"enabled": true,
// a gRPC endpoint example
"endpoint": "http://localhost:4317",
// an HTTP/protobuf endpoint example
"endpoint": "http://localhost:4318/v1/metrics",
"headers": "api-key=key,other-config-value=value",
"service-name": "dab",
}
}
}
}
Pelajari selengkapnya tentang OTEL_EXPORTER_OTLP_HEADERS.
Note
gRPC (4317) lebih cepat dan mendukung streaming tetapi memerlukan lebih banyak langkah penyiapan. HTTP/protobuf (4318) lebih sederhana dan lebih mudah di-debug tetapi kurang efisien.
Kesehatan (runtime)
| Parent | Property | Type | Required | Default |
|---|---|---|---|---|
runtime |
health |
objek | ❌ Tidak | - |
Konfigurasi titik akhir pemeriksaan kesehatan global (/health).
Properti berlapis
| Parent | Property | Type | Required | Default | Rentang/Catatan |
|---|---|---|---|---|---|
runtime.health |
enabled |
boolean | ❌ Tidak | true |
|
runtime.health |
roles |
larik string | ✔️ Ya* | null |
*Diperlukan dalam mode produksi |
runtime.health |
cache-ttl-seconds |
integer | ❌ Tidak | 5 |
Min: 0 |
runtime.health |
max-query-parallelism |
integer | ❌ Tidak | 4 |
Min: 1, Maks: 8 (dijepit) |
Perilaku dalam pengembangan vs. produksi
| Condition | Perilaku Pengembangan | Perilaku Produksi |
|---|---|---|
health.enabled = salah |
403 keadaan |
403 keadaan |
health.enabled = benar |
Tergantung pada peran | Tergantung pada peran |
roles dihilangkan atau null |
Kesehatan ditampilkan |
403 keadaan |
peran saat ini tidak ada di roles |
403 keadaan |
403 keadaan |
peran saat ini dalam roles |
Kesehatan ditampilkan | Kesehatan ditampilkan |
roles Termasuk anonymous |
Kesehatan ditampilkan | Kesehatan ditampilkan |
Format
{
"health": {
"enabled": <true> (default) | <false>,
"roles": [ <string> ], // required in production
"cache-ttl-seconds": <integer; default: 5>,
"max-query-parallelism": <integer; default: 4>
}
}
Note
Jika global enabled adalah false, tingkat enabled entitas individu tidak masalah.
Example
{
"health": {
"enabled": true,
"roles": ["admin", "support"],
"cache-ttl-seconds": 10,
"max-query-parallelism": 6
}
}