Documentation
¶
Overview ¶
Package sqlv1 provides the normalized database slow-query log record v1.
Index ¶
Constants ¶
View Source
const ( SchemaVersion = "logschema.sql.query/v1" Kind = "sql.query" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Fingerprint ¶
type Fingerprint = corev1.Fingerprint
Fingerprint is the shared versioned fingerprint representation.
type Query ¶
type Query struct {
SchemaVersion string `json:"schema_version"`
Kind string `json:"kind"`
TimeUnixNano *corev1.DecimalInt64 `json:"time_unix_nano"`
ObservedTimeUnixNano *corev1.DecimalInt64 `json:"observed_time_unix_nano"`
DurationNano corev1.DecimalUint64 `json:"duration_nano"`
Source corev1.Source `json:"source"`
Resource corev1.Resource `json:"resource"`
TraceContext *corev1.TraceContext `json:"trace_context"`
Data QueryData `json:"data"`
}
func NewQuery ¶
func NewQuery( durationNano corev1.DecimalUint64, source corev1.Source, data QueryData, ) (Query, error)
NewQuery creates and validates a SQL query record with canonical metadata.
func (Query) MarshalJSON ¶
MarshalJSON validates and encodes a SQL query record.
func (*Query) UnmarshalJSON ¶
type QueryData ¶
type QueryData struct {
DBSystem string `json:"db_system"`
DatabaseName *string `json:"database_name"`
Operation *string `json:"operation"`
QueryText *string `json:"query_text"`
QuerySummary *string `json:"query_summary"`
Fingerprint Fingerprint `json:"fingerprint"`
LockDurationNano *corev1.DecimalUint64 `json:"lock_duration_nano"`
RowsSent *corev1.DecimalUint64 `json:"rows_sent"`
RowsExamined *corev1.DecimalUint64 `json:"rows_examined"`
RowsAffected *corev1.DecimalUint64 `json:"rows_affected"`
BytesSent *corev1.DecimalUint64 `json:"bytes_sent"`
Attributes corev1.Attributes `json:"attributes"`
}
Click to show internal directories.
Click to hide internal directories.