API 参考
日志
Endpoint POST /api/v1/logs and POST /v1/logs
两个 endpoint 写入同一张表:Blipit 自己的 JSON 格式和 OpenTelemetry 日志 endpoint。两者都接受任一密钥,并按请求、每分钟和每月限制。
1Blipit 格式
X-Blipit-Key 或 Authorization: Bearer,公钥或私密密钥。请求体:JSON 数组、单个对象或 NDJSON;解开 gzip、deflate 或 brotli 后最多 1,000 行和 1 MB。每行:message(必填,截断至 8 KB;也接受 msg)、level(trace、debug、info、warn、error、fatal;缺省为 info)、timestamp(ISO 或 epoch,限制在过去一天到未来五分钟之间)、service、environment、trace_id、attributes(扁平对象,最多 50 个字符串、数字或布尔值)。
curl https://in.blipit.io/api/v1/logs \
-H "Content-Type: application/json" -H "X-Blipit-Key: <secret key>" \
-d '[{"level":"error","message":"payment declined","service":"api","trace_id":"4bf92f3577b34da6a3ce929d0e0e4736","attributes":{"order_id":42,"gateway":"stripe"}}]'2响应
202 {accepted: true, stored, rejected, errors}:无效的行会被跳过并列出。202 {accepted: false, reason: 'log quota reached'} 表示本月额度已用完。400 表示请求体不是 JSON 或没有任何有效的行。413 表示请求体或行数超过限制。401 未知密钥。
3OTLP
以相同的请求头和 OTLP/HTTP JSON POST 到 /v1/logs(protobuf 会得到 415)。资源属性 service.name 和 deployment.environment 变为 service 和 environment;severity 数值映射到六个级别。返回 200 {} 或 {partialSuccess: {rejectedLogRecords, errorMessage}},达到配额时也是如此。
OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=https://in.blipit.io/v1/logs
OTEL_EXPORTER_OTLP_LOGS_PROTOCOL=http/json
OTEL_EXPORTER_OTLP_LOGS_HEADERS=x-blipit-key=<secret key>须知
- 每月按存储字节数计算的额度:Free 1 GB,Solo 5 GB,Team 20 GB,Scale 100 GB;保留期 3、14、30、30 天。
- 每个密钥每分钟 300 个请求,与事件和 span 共享。
遇到问题?发邮件至 support@blipit.io。每个项目的密钥和确切的 DSN 在 app.blipit.io 的“API 密钥”下。

