Skip to content
Telemetry

原木排水沟

日志转储会将 Supabase 堆栈的所有日志发送到一个或多个指定的目的地。它仅对 Pro、Team 和 Enterprise 计划的客户可用。在仪表板中可以通过 项目设置 > 日志转储 找到日志转储功能。

🌐 Log drains send all logs of the Supabase stack to one or more desired destinations. It is only available for customers on Pro, Team and Enterprise Plans. Log drains are available in the dashboard under Project Settings > Log Drains.

你可以用原木排水沟做什么 #

🌐 What you can do with log drains

  • 将 Supabase 日志(Postgres、认证、存储、边缘函数等)路由到任何可观测性平台。
  • 将 Supabase 日志与应用级别的跟踪结合起来——查看 使用 JS SDK 进行跟踪 将你的跟踪扩展到 Supabase。
  • 把日志归档到 S3,以便长期保存和合规。
  • 在你喜欢的供应商上基于 Supabase 日志数据创建警报和仪表板。

HTTP 目标会以批量 POST 请求的方式接收日志,每次最多 250 个事件或每秒一次,以先到为准。

🌐 HTTP destinations receive logs as batched POST requests with a maximum of 250 events or 1-second intervals, whichever comes first.

自定义端点 #

🌐 Custom endpoint

日志通过 HTTP POST 以 JSON 数组的形式发送。支持 HTTP/1 和 HTTP/2。每个请求都可以添加自定义头来进行身份验证或路由。

🌐 Logs are delivered as a JSON array via HTTP POST. Both HTTP/1 and HTTP/2 are supported. Custom headers can be added to every request for authentication or routing.

所需配置:

  • URL — 你的端点 URL(http://https://
  • HTTP 版本 — HTTP/1HTTP/2
  • Gzip — 启用以在发送前压缩负载
  • Headers — 可选的键/值对,会添加到每个请求中

开放遥测 (OTLP) #

🌐 OpenTelemetry (OTLP)

日志通过 HTTP 使用 Protocol Buffers 编码,按照 OpenTelemetry 日志规范,发送到任何兼容 OTLP 的端点。

🌐 Logs are sent to any OTLP-compatible endpoint using the OpenTelemetry Protocol over HTTP with Protocol Buffers encoding, following the OpenTelemetry Logs specification.

所需配置:

  • 端点 — 你的 OTLP HTTP 端点的完整 URL(通常以 /v1/logs 结尾)
  • 协议 — http/protobuf(唯一支持的协议)
  • Gzip — 启用以减少带宽(推荐)
  • 头部 — 可选的身份验证头

兼容的平台包括 OpenTelemetry Collector、Grafana Cloud、New Relic、Honeycomb、Datadog(OTLP 接入)、Elastic,以及任何其他支持 OTLP 的可观测性工具。

🌐 Compatible platforms include OpenTelemetry Collector, Grafana Cloud, New Relic, Honeycomb, Datadog (OTLP ingestion), Elastic, and any other OTLP-compatible observability tool.

Datadog#

日志会被批量处理并使用 Gzip 压缩发送到 Datadog。每个事件的日志来源会映射到 service 字段,来源设置为 Supabase。有效负载消息是原始日志事件的 JSON 字符串,并带有事件时间戳作为前缀。

🌐 Logs are batched and sent to Datadog with Gzip compression. Each event's log source is mapped to the service field, and the source is set to Supabase. The payload message is a JSON string of the raw log event, prefixed with the event timestamp.

所需配置:

  • API 密钥 — 来自 Datadog 组织设置
  • 区域 —— 你的账户使用的 Datadog 站点(US1、US3、US5、EU、AP1、AP2、US1-FED)

步骤:

  1. Datadog 仪表板 上生成一个 API 密钥。
  2. 项目设置 > 日志排放 中创建排放器。
  3. Datadog 日志页面 查看即将发生的事件。

洛基 #

🌐 Loki

日志被格式化后发送到 Loki HTTP 推送 API。日志来源和产品名称被用作流标签。为了避免数据重复,事件中的 event_messagetimestamp 字段会被删除。事件会被分批处理,每个请求最多 250 个事件。

🌐 Logs are formatted and sent to the Loki HTTP push API. The log source and product name are used as stream labels. The event_message and timestamp fields are dropped from events to avoid duplicate data. Events are batched with a maximum of 250 events per request.

所需配置:

  • URL — 你的 Loki 推送端点(例如 https://my-logs.grafana.net/loki/api/v1/push
  • 用户名 — 可选,Grafana Cloud 和其他需要身份验证的 Loki 实例必须填写
  • 密码 — 可选,Grafana Cloud 和其他需要身份验证的 Loki 实例需要填写
  • 头部 — 可选的额外头部

有关推送 API 格式的更多详情,请查看官方 Loki HTTP API 文档

🌐 See the official Loki HTTP API documentation for more details on the push API format.

亚马逊 S3 #

🌐 Amazon S3

日志会作为批量文件写入你拥有的现有 S3 桶中。

🌐 Logs are written as batched files to an existing S3 bucket that you own.

所需配置:

  • S3 存储桶——已有 S3 存储桶的名称
  • 区域 — 桶所在的 AWS 区域
  • 访问密钥 ID — 用于身份验证
  • 秘密访问密钥 — 用于身份验证
  • 批处理超时(毫秒)——刷新批处理前的最长等待时间(推荐:2000–5000毫秒)

Sentry#

日志会发送到 Sentry 的日志产品。所有日志事件字段都会作为 Sentry 日志属性附加,可用于筛选和分组。属性数量没有基数限制。

🌐 Logs are sent to Sentry's Logging product. All log event fields are attached as Sentry log attributes, which can be used for filtering and grouping. There are no cardinality limits on the number of attributes.

所需配置:

  • DSN — 你的 Sentry 项目的 DSN,格式是 {PROTOCOL}://{PUBLIC_KEY}@{HOST}/{PROJECT_ID}

步骤:

  1. Sentry 项目设置 获取你的 DSN。
  2. 项目设置 > 日志排放 中创建排放器。
  3. Sentry 日志页面查看传入日志。

公理 #

🌐 Axiom

日志作为 JSON 发送到 Axiom 数据集,时间戳会根据 Axiom 的接收格式进行调整。

🌐 Logs are sent to an Axiom dataset as JSON, with the timestamp adjusted for Axiom's ingestion format.

所需配置:

  • 数据集名称 — Axiom 中目标数据集的名称
  • API 令牌 — 一个对该数据集具有导入权限的 Axiom API 令牌

步骤:

  1. 在 Axiom 控制台的 Datasets 下创建一个数据集。
  2. 生成一个具有摄取访问权限的 API 令牌(请参阅 Axiom 令牌文档)。
  3. 项目设置 > 日志排放 中创建排放器。
  4. 在 Axiom 控制台的 面板中查看即将发生的事件。

最后9 #

🌐 Last9

日志通过 Last9 的 OpenTelemetry 原生采集端点发送。凭证可以从 Last9 OTEL 集成面板获取。

🌐 Logs are sent to Last9 using its OpenTelemetry-native ingestion endpoint. Credentials are obtained from the Last9 OTEL integration panel.

所需配置:

  • 区域 — 你的 Last9 集群所在区域(美国西部 1 或亚太南部 1)
  • 用户名 — 来自 Last9 OTEL 集成面板
  • 密码 — 来自 Last9 OTEL 集成面板

步骤:

  1. 在 Last9 仪表板中,打开 OTEL 集成面板,然后记下你的地区、用户名和密码。
  2. 项目设置 > 日志排放 中创建排放器。

系统日志 #

🌐 Syslog

日志会通过 TCP 或 TLS 转发到远程 Syslog 接收器,遵循 RFC 5424

🌐 Logs are forwarded to a remote Syslog receiver using TCP or TLS, adhering to RFC 5424.

所需配置:

  • 主机 — Syslog 接收端的主机名或 IP 地址
  • 端口 — Syslog接收器的端口 (0–65535)
  • TLS — 启用通过 SSL/TLS 连接,而不是普通 TCP

可选配置:

  • 结构化数据 — 每个日志框架中都包含静态 RFC 5424 结构化数据(例如 [exampleSDID@32473 iut="3"]
  • 密码密钥 —— 用于 AES-256-GCM 加密日志内容的 Base64 编码 32 字节密钥

仅限 TLS 的选项:

  • CA 证书 —— 用于服务器验证的 PEM 编码 CA 证书(如果省略,则回退到系统 CA 打包包)
  • 客户端证书——用于双向 TLS(mTLS)的 PEM 编码客户端证书
  • 客户端密钥 — PEM 编码的客户端私钥(当提供客户端证书时必填)

额外资源 #

🌐 Additional resources