web-app/src/assets/doc/log-integration/otlp.en-US.md
HertzBeat supports OpenTelemetry Logs Protocol (OTLP), allowing external systems to push log data to the HertzBeat log platform via OTLP.
POST /api/logs/otlp/v1/logs
Content-Type: application/json or application/x-protobufAuthorization: Bearer {token}Supports standard OTLP JSON-Protobuf format or Binary Protobuf format log data:
{
"resourceLogs": [
{
"resource": {
"attributes": [
{
"key": "service.name",
"value": {
"stringValue": "my-service"
}
},
{
"key": "service.version",
"value": {
"stringValue": "1.0.0"
}
}
]
},
"scopeLogs": [
{
"scope": {
"name": "my-logger",
"version": "1.0.0"
},
"logRecords": [
{
"timeUnixNano": "1640995200000000000",
"severityNumber": 9,
"severityText": "INFO",
"body": {
"stringValue": "This is a log message"
},
"attributes": [
{
"key": "user.id",
"value": {
"stringValue": "12345"
}
}
]
}
]
}
]
}
]
}
exporters:
otlphttp:
logs_endpoint: http://{hertzbeat_host}:1157/api/logs/otlp/v1/logs
compression: none
encoding: json
headers:
Authorization: "Bearer {token}"
service:
pipelines:
logs:
receivers: [otlp]
processors: [batch]
exporters: [otlphttp]
For more information, please refer to OpenTelemetry Logs Specification