Skip to content
Observability

日志来源和字段

每个事件都是 ClickHouse logs 表中的一行。过滤 source 列来选择一个服务。下面的表格列出了它的字段;字段不一定在每个事件中都有值。

🌐 Each event is a row in the ClickHouse logs table. Filter the source column to select a service. The tables below list its fields; a field is not necessarily populated on every event.

id、timestamp、event_message、severity_text 和 source 是顶层列。服务字段在 log_attributes 中都是字符串值,即使原始事件中包含数字或布尔值。直接使用 ClickHouse 查询字段 列。有关类型转换和字段查找,请查看 使用 SQL 查询日志。

来源 #

🌐 Sources

source事件
edge_logs通过 API 网关的 HTTP 请求,包括 REST 和 GraphQL
postgres_logs数据库活动、语句和错误
postgrest_logsPostgREST 服务器日志
auth_logs认证服务器:登录、JWT、OAuth、邮箱
auth_audit_logs认证审计事件
storage_logs存储 API:上传和对象访问
realtime_logs实时服务器:通道、在线状态、广播
function_edge_logsEdge Function 调用的 HTTP 请求和响应
function_logsEdge Function 内部的 console 输出
supavisor_logs共享连接池:池化和超时
pgbouncer_logs专用连接池
pg_upgrade_logs数据库版本升级

对于 postgres_logs,语句文本和错误详情可以出现在 event_message。缺少结构化字段并不意味着事件没有细节。

🌐 For postgres_logs, statement text and error details can appear in event_message. A missing structured field does not mean the event has no detail.

捕获的 HTTP 头 #

🌐 Captured HTTP headers

API 网关日志只会记录下面的这些头信息。其他头信息仍然会送到应用和客户端,但不会出现在这些日志里。

🌐 API Gateway logs capture only the headers below. Other headers still reach the application and client but are omitted from these logs.

请求头:

🌐 Request headers:

  • accept
  • cf-connecting-ip
  • cf-ipcountry
  • host
  • user-agent
  • x-forwarded-proto
  • referer
  • content-length
  • x-real-ip
  • x-client-info
  • x-forwarded-user-agent
  • range
  • prefer

响应头:

🌐 Response headers:

  • cf-cache-status
  • cf-ray
  • content-location
  • content-range
  • content-type
  • content-length
  • date
  • transfer-encoding
  • x-kong-proxy-latency
  • x-kong-upstream-latency
  • sb-gateway-mode
  • sb-gateway-version

捕获限制 #

🌐 Capture limits

  • 托管的 Postgres 事件超过 100,000 个字符,Edge Function 日志信息超过 10,000 个字符的会被截断。
  • 内部 Supabase 服务连接事件不会记录在托管的 Postgres 日志中。
  • 一个 Edge Function 调用使用 function_edge_logs;它的控制台输出使用 function_logs。
  • 对于 API 负载均衡器 流量,log_attributes['load_balancer_redirect_identifier'] 用来识别上游数据库。

按来源分类的字段 #

🌐 Fields by source

来源: edge_logs

event_messagestring
idstring
identifierstring
schemaidentifier
clickhouselog_attributes['identifier']
load_balancer_redirect_identifierstring
schemametadata.load_balancer_redirect_identifier
clickhouselog_attributes['load_balancer_redirect_identifier']
request.cf.asnnumber
schemametadata.request.cf.asn
clickhouselog_attributes['request.cf.asn']
request.cf.asOrganizationstring
schemametadata.request.cf.asOrganization
clickhouselog_attributes['request.cf.asOrganization']
request.cf.botManagement.corporateProxyboolean
schemametadata.request.cf.botManagement.corporateProxy
clickhouselog_attributes['request.cf.botManagement.corporateProxy']
request.cf.botManagement.detectionIdsnumber[]
schemametadata.request.cf.botManagement.detectionIds
clickhouselog_attributes['request.cf.botManagement.detectionIds']
request.cf.botManagement.ja3Hashstring
schemametadata.request.cf.botManagement.ja3Hash
clickhouselog_attributes['request.cf.botManagement.ja3Hash']
request.cf.botManagement.scorenumber
schemametadata.request.cf.botManagement.score
clickhouselog_attributes['request.cf.botManagement.score']
request.cf.botManagement.staticResourceboolean
schemametadata.request.cf.botManagement.staticResource
clickhouselog_attributes['request.cf.botManagement.staticResource']
request.cf.botManagement.verifiedBotboolean
schemametadata.request.cf.botManagement.verifiedBot
clickhouselog_attributes['request.cf.botManagement.verifiedBot']
request.cf.citystring
schemametadata.request.cf.city
clickhouselog_attributes['request.cf.city']
request.cf.clientTcpRttnumber
schemametadata.request.cf.clientTcpRtt
clickhouselog_attributes['request.cf.clientTcpRtt']
request.cf.clientTrustScorenumber
schemametadata.request.cf.clientTrustScore
clickhouselog_attributes['request.cf.clientTrustScore']
request.cf.colostring
schemametadata.request.cf.colo
clickhouselog_attributes['request.cf.colo']
request.cf.continentstring
schemametadata.request.cf.continent
clickhouselog_attributes['request.cf.continent']
request.cf.countrystring
schemametadata.request.cf.country
clickhouselog_attributes['request.cf.country']
request.cf.edgeRequestKeepAliveStatusnumber
schemametadata.request.cf.edgeRequestKeepAliveStatus
clickhouselog_attributes['request.cf.edgeRequestKeepAliveStatus']
request.cf.httpProtocolstring
schemametadata.request.cf.httpProtocol
clickhouselog_attributes['request.cf.httpProtocol']
request.cf.latitudestring
schemametadata.request.cf.latitude
clickhouselog_attributes['request.cf.latitude']
request.cf.longitudestring
schemametadata.request.cf.longitude
clickhouselog_attributes['request.cf.longitude']
request.cf.metroCodestring
schemametadata.request.cf.metroCode
clickhouselog_attributes['request.cf.metroCode']
request.cf.postalCodestring
schemametadata.request.cf.postalCode
clickhouselog_attributes['request.cf.postalCode']
request.cf.regionstring
schemametadata.request.cf.region
clickhouselog_attributes['request.cf.region']
request.cf.timezonestring
schemametadata.request.cf.timezone
clickhouselog_attributes['request.cf.timezone']
request.cf.tlsCipherstring
schemametadata.request.cf.tlsCipher
clickhouselog_attributes['request.cf.tlsCipher']
request.cf.tlsClientAuth.certPresentedstring
schemametadata.request.cf.tlsClientAuth.certPresented
clickhouselog_attributes['request.cf.tlsClientAuth.certPresented']
request.cf.tlsClientAuth.certRevokedstring
schemametadata.request.cf.tlsClientAuth.certRevoked
clickhouselog_attributes['request.cf.tlsClientAuth.certRevoked']
request.cf.tlsClientAuth.certVerifiedstring
schemametadata.request.cf.tlsClientAuth.certVerified
clickhouselog_attributes['request.cf.tlsClientAuth.certVerified']
request.cf.tlsExportedAuthenticator.clientFinishedstring
schemametadata.request.cf.tlsExportedAuthenticator.clientFinished
clickhouselog_attributes['request.cf.tlsExportedAuthenticator.clientFinished']
request.cf.tlsExportedAuthenticator.clientHandshakestring
schemametadata.request.cf.tlsExportedAuthenticator.clientHandshake
clickhouselog_attributes['request.cf.tlsExportedAuthenticator.clientHandshake']
request.cf.tlsExportedAuthenticator.serverFinishedstring
schemametadata.request.cf.tlsExportedAuthenticator.serverFinished
clickhouselog_attributes['request.cf.tlsExportedAuthenticator.serverFinished']
request.cf.tlsExportedAuthenticator.serverHandshakestring
schemametadata.request.cf.tlsExportedAuthenticator.serverHandshake
clickhouselog_attributes['request.cf.tlsExportedAuthenticator.serverHandshake']
request.cf.tlsVersionstring
schemametadata.request.cf.tlsVersion
clickhouselog_attributes['request.cf.tlsVersion']
request.headers.cf_connecting_ipstring
schemametadata.request.headers.cf_connecting_ip
clickhouselog_attributes['request.headers.cf_connecting_ip']
request.headers.cf_ipcountrystring
schemametadata.request.headers.cf_ipcountry
clickhouselog_attributes['request.headers.cf_ipcountry']
request.headers.cf_raystring
schemametadata.request.headers.cf_ray
clickhouselog_attributes['request.headers.cf_ray']
request.headers.hoststring
schemametadata.request.headers.host
clickhouselog_attributes['request.headers.host']
request.headers.refererstring
schemametadata.request.headers.referer
clickhouselog_attributes['request.headers.referer']
request.headers.x_client_infostring
schemametadata.request.headers.x_client_info
clickhouselog_attributes['request.headers.x_client_info']
request.headers.x_forwarded_protostring
schemametadata.request.headers.x_forwarded_proto
clickhouselog_attributes['request.headers.x_forwarded_proto']
request.headers.x_real_ipstring
schemametadata.request.headers.x_real_ip
clickhouselog_attributes['request.headers.x_real_ip']
request.hoststring
schemametadata.request.host
clickhouselog_attributes['request.host']
request.methodstring
schemametadata.request.method
clickhouselog_attributes['request.method']
request.pathstring
schemametadata.request.path
clickhouselog_attributes['request.path']
request.protocolstring
schemametadata.request.protocol
clickhouselog_attributes['request.protocol']
request.searchstring
schemametadata.request.search
clickhouselog_attributes['request.search']
request.urlstring
schemametadata.request.url
clickhouselog_attributes['request.url']
response.headers.cf_cache_statusstring
schemametadata.response.headers.cf_cache_status
clickhouselog_attributes['response.headers.cf_cache_status']
response.headers.cf_raystring
schemametadata.response.headers.cf_ray
clickhouselog_attributes['response.headers.cf_ray']
response.headers.content_locationstring
schemametadata.response.headers.content_location
clickhouselog_attributes['response.headers.content_location']
response.headers.content_rangestring
schemametadata.response.headers.content_range
clickhouselog_attributes['response.headers.content_range']
response.headers.content_typestring
schemametadata.response.headers.content_type
clickhouselog_attributes['response.headers.content_type']
response.headers.datestring
schemametadata.response.headers.date
clickhouselog_attributes['response.headers.date']
response.headers.sb_gateway_versionstring
schemametadata.response.headers.sb_gateway_version
clickhouselog_attributes['response.headers.sb_gateway_version']
response.headers.transfer_encodingstring
schemametadata.response.headers.transfer_encoding
clickhouselog_attributes['response.headers.transfer_encoding']
response.headers.x_kong_proxy_latencystring
schemametadata.response.headers.x_kong_proxy_latency
clickhouselog_attributes['response.headers.x_kong_proxy_latency']
response.origin_timenumber
schemametadata.response.origin_time
clickhouselog_attributes['response.origin_time']
response.status_codenumber
schemametadata.response.status_code
clickhouselog_attributes['response.status_code']
severity_textString
sourceString
timestampdatetime