API and OTLP
Diting exposes OTLP ingress, OpenAPI query endpoints and an event channel. Teams already on OpenTelemetry can start with OTLP and add agents later.
OTLP
- gRPC:
4317 - HTTP:
4318
Senders need a platform token. Once data reaches the gateway it follows the same path as agent traffic.
OpenAPI
Query endpoints live under /api/diting-core/ and use Bearer tokens. Responses share one envelope:
{ "code": 0, "message": "ok", "data": {} }
Common endpoints cover hosts, services, traces, logs, alerts and audit.
Example
Query recent hosts:
curl -s \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"page":1,"pageSize":20}' \
https://<host>/api/diting-core/hosts/query
Field details are in the API reference. A missing required field returns an error; it does not silently return an empty list.
Events
Live data is pushed over WebSocket. The connection needs a token and the client reconnects on drop.
Tokens
- Scoped per integration
- One token per integration is recommended
- Revoke immediately on exposure
Related: Data model and signals, Access, audit and tenancy.