Documentation
¶
Overview ¶
Package reqlog records every API call and data-plane request as a structured entry (FR-CORE-061) and keeps the most recent ones in memory for the admin API (FR-CORE-045).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entry ¶
type Entry struct {
Time time.Time `json:"time"`
Service string `json:"service"`
Protocol string `json:"protocol"` // http, grpc, dns, postgres, tcp, udp
Method string `json:"method"`
// Resource is the resource acted on: the one whose permission an API
// call checked first, the answering DNS zone, the Cloud SQL instance or
// the Cloud NAT gateway.
Resource string `json:"resource,omitempty"`
Principal string `json:"principal,omitempty"`
// Status is protocol-specific: the HTTP status, gRPC code or DNS
// rcode; for connections (postgres, NAT) 0 when admitted and 1 when
// refused, with the reason in Code.
Status int `json:"status"`
Code string `json:"code,omitempty"`
LatencyMS float64 `json:"latencyMs"`
}
Entry is one logged request.
type Log ¶
type Log struct {
// contains filtered or unexported fields
}
Log is a bounded ring buffer of entries that also writes to a logger.