Help us shape the future of Go! Take the 2026 Go Developer Survey

xevent

package
v0.1.60 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package xevent is the sql_xevent trace kind: a SQL Server Extended Events capture whose events are stored as xesession event rows.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Kind

Kind is the sql_xevent kind against real SQL Server connections.

func NewKind

func NewKind(capture Capture) *tracing.Handler[Params, xesession.EventRow]

NewKind is the sql_xevent kind over capture.

func NewKindFor

func NewKindFor[P Capturable](capture Capture) *tracing.Handler[P, xesession.EventRow]

NewKindFor is the sql_xevent kind over capture for a host's own params type: events masked, but never the session ids and users that only look sensitive.

Types

type Capturable

type Capturable interface {
	XEventOptions() (Options, error)
}

Capturable is a params type that maps itself onto the capture it opens. It is asked once as the capture starts, so options it takes from the clock, such as a drain's StartedAt, are the start's.

type Capture

type Capture struct {
	Open            func(ctx dbcontext.Context, connection string) (*sql.DB, func(), error)
	NewSession      xesession.XEFactory
	CurrentDatabase func(context.Context, *sql.DB) (string, error)
}

Capture is how the kind reaches SQL Server: Open leases a connection's client, NewSession creates the XE session on it, and CurrentDatabase names the database a capture naming none is scoped to.

type Options

type Options struct {
	Connection string
	Create     xetrace.CreateOptions
	Drain      xetrace.DrainOptions
}

Options are what a capture opens: the connection it captures on, the XE session it creates there, and how that session is drained.

type Params

type Params struct {
	Connection string `json:"connection" clicky:"required,title=Connection"`
	xeprovider.XEventCaptureOptions
}

Params are the SQL Server connection to capture on and the capture's options, as the sqlserver-xevent provider takes them.

func (Params) Validate

func (p Params) Validate() error

func (Params) XEventOptions

func (p Params) XEventOptions() (Options, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL