sys

package
v0.0.0-...-fd59fc6 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultRequestTimeout  = 10 * time.Second
	DefaultRequestInterval = 300 * time.Millisecond
)
View Source
const (
	// ConnOpen filters on open clients.
	ConnOpen = ConnState(iota)
	// ConnClosed filters on closed clients.
	ConnClosed
	// ConnAll returns all clients.
	ConnAll
)

Variables

View Source
var (
	ErrValidation      = errors.New("validation error")
	ErrInvalidServerID = errors.New("sever with given ID does not exist")
)

Functions

This section is empty.

Types

type AccountDetail

type AccountDetail struct {
	Name string `json:"name"`
	Id   string `json:"id"`
	JetStreamStats
	Streams []StreamDetail `json:"stream_detail,omitempty"`
}

type ClusterOptsVarz

type ClusterOptsVarz struct {
	Name        string   `json:"name,omitempty"`
	Host        string   `json:"addr,omitempty"`
	Port        int      `json:"cluster_port,omitempty"`
	AuthTimeout float64  `json:"auth_timeout,omitempty"`
	URLs        []string `json:"urls,omitempty"`
	TLSTimeout  float64  `json:"tls_timeout,omitempty"`
	TLSRequired bool     `json:"tls_required,omitempty"`
	TLSVerify   bool     `json:"tls_verify,omitempty"`
}

ClusterOptsVarz contains monitoring cluster information

type ConnInfo

type ConnInfo struct {
	Cid            uint64         `json:"cid"`
	Kind           string         `json:"kind,omitempty"`
	Type           string         `json:"type,omitempty"`
	IP             string         `json:"ip"`
	Port           int            `json:"port"`
	Start          time.Time      `json:"start"`
	LastActivity   time.Time      `json:"last_activity"`
	Stop           *time.Time     `json:"stop,omitempty"`
	Reason         string         `json:"reason,omitempty"`
	RTT            string         `json:"rtt,omitempty"`
	Uptime         string         `json:"uptime"`
	Idle           string         `json:"idle"`
	Pending        int            `json:"pending_bytes"`
	InMsgs         int64          `json:"in_msgs"`
	OutMsgs        int64          `json:"out_msgs"`
	InBytes        int64          `json:"in_bytes"`
	OutBytes       int64          `json:"out_bytes"`
	NumSubs        uint32         `json:"subscriptions"`
	Name           string         `json:"name,omitempty"`
	Lang           string         `json:"lang,omitempty"`
	Version        string         `json:"version,omitempty"`
	TLSVersion     string         `json:"tls_version,omitempty"`
	TLSCipher      string         `json:"tls_cipher_suite,omitempty"`
	TLSPeerCerts   []*TLSPeerCert `json:"tls_peer_certs,omitempty"`
	AuthorizedUser string         `json:"authorized_user,omitempty"`
	Account        string         `json:"account,omitempty"`
	Subs           []string       `json:"subscriptions_list,omitempty"`
	SubsDetail     []SubDetail    `json:"subscriptions_list_detail,omitempty"`
	JWT            string         `json:"jwt,omitempty"`
	IssuerKey      string         `json:"issuer_key,omitempty"`
	NameTag        string         `json:"name_tag,omitempty"`
	Tags           jwt.TagList    `json:"tags,omitempty"`
	MQTTClient     string         `json:"mqtt_client,omitempty"` // This is the MQTT client id
}

ConnInfo has detailed information on a per connection basis.

type ConnState

type ConnState int

type Connz

type Connz struct {
	ID       string      `json:"server_id"`
	Now      time.Time   `json:"now"`
	NumConns int         `json:"num_connections"`
	Total    int         `json:"total"`
	Offset   int         `json:"offset"`
	Limit    int         `json:"limit"`
	Conns    []*ConnInfo `json:"connections"`
}

type ConnzEventOptions

type ConnzEventOptions struct {
	ConnzOptions
	EventFilterOptions
}

type ConnzOptions

type ConnzOptions struct {
	// Sort indicates how the results will be sorted. Check SortOpt for possible values.
	// Only the sort by connection ID (ByCid) is ascending, all others are descending.
	Sort SortOpt `json:"sort"`

	// Username indicates if user names should be included in the results.
	Username bool `json:"auth"`

	// Subscriptions indicates if subscriptions should be included in the results.
	Subscriptions bool `json:"subscriptions"`

	// SubscriptionsDetail indicates if subscription details should be included in the results
	SubscriptionsDetail bool `json:"subscriptions_detail"`

	// Offset is used for pagination. Connz() only returns connections starting at this
	// offset from the global results.
	Offset int `json:"offset"`

	// Limit is the maximum number of connections that should be returned by Connz().
	Limit int `json:"limit"`

	// Filter for this explicit client connection.
	CID uint64 `json:"cid"`

	// Filter for this explicit client connection based on the MQTT client ID
	MQTTClient string `json:"mqtt_client"`

	// Filter by connection state.
	State ConnState `json:"state"`

	// Filter by username.
	User string `json:"user"`

	// Filter by account.
	Account string `json:"acc"`

	// Filter by subject interest
	FilterSubject string `json:"filter_subject"`
}

type ConnzResp

type ConnzResp struct {
	Server ServerInfo `json:"server"`
	Connz  Connz      `json:"data"`
}

type DataStats

type DataStats struct {
	Msgs  int64 `json:"msgs"`
	Bytes int64 `json:"bytes"`
}

DataStats reports how may msg and bytes. Applicable for both sent and received.

type DenyRules

type DenyRules struct {
	Exports []string `json:"exports,omitempty"`
	Imports []string `json:"imports,omitempty"`
}

DenyRules Contains lists of subjects not allowed to be imported/exported

type EventFilterOptions

type EventFilterOptions struct {
	Name    string   `json:"server_name,omitempty"` // filter by server name
	Cluster string   `json:"cluster,omitempty"`     // filter by cluster name
	Host    string   `json:"host,omitempty"`        // filter by host name
	Tags    []string `json:"tags,omitempty"`        // filter by tags (must match all tags)
	Domain  string   `json:"domain,omitempty"`      // filter by JS domain
}

Common filter options for system requests STATSZ VARZ SUBSZ CONNZ ROUTEZ GATEWAYZ LEAFZ

type GatewayOptsVarz

type GatewayOptsVarz struct {
	Name           string                  `json:"name,omitempty"`
	Host           string                  `json:"host,omitempty"`
	Port           int                     `json:"port,omitempty"`
	AuthTimeout    float64                 `json:"auth_timeout,omitempty"`
	TLSTimeout     float64                 `json:"tls_timeout,omitempty"`
	TLSRequired    bool                    `json:"tls_required,omitempty"`
	TLSVerify      bool                    `json:"tls_verify,omitempty"`
	Advertise      string                  `json:"advertise,omitempty"`
	ConnectRetries int                     `json:"connect_retries,omitempty"`
	Gateways       []RemoteGatewayOptsVarz `json:"gateways,omitempty"`
	RejectUnknown  bool                    `json:"reject_unknown,omitempty"` // config got renamed to reject_unknown_cluster
}

GatewayOptsVarz contains monitoring gateway information

type GatewayStat

type GatewayStat struct {
	ID         uint64    `json:"gwid"`
	Name       string    `json:"name"`
	Sent       DataStats `json:"sent"`
	Received   DataStats `json:"received"`
	NumInbound int       `json:"inbound_connections"`
}

GatewayStat holds gateway statistics.

type HealthStatus

type HealthStatus int
const (
	StatusOK HealthStatus = iota
	StatusUnavailable
	StatusError
)

func (HealthStatus) MarshalJSON

func (hs HealthStatus) MarshalJSON() ([]byte, error)

func (HealthStatus) String

func (hs HealthStatus) String() string

func (*HealthStatus) UnmarshalJSON

func (hs *HealthStatus) UnmarshalJSON(data []byte) error

type Healthz

type Healthz struct {
	Status HealthStatus `json:"status"`
	Error  string       `json:"error,omitempty"`
}

type HealthzOptions

type HealthzOptions struct {
	JSEnabledOnly bool `json:"js-enabled-only,omitempty"`
	JSServerOnly  bool `json:"js-server-only,omitempty"`
}

HealthzOptions are options passed to Healthz

type HealthzResp

type HealthzResp struct {
	Server  ServerInfo `json:"server"`
	Healthz Healthz    `json:"data"`
}

type JSInfo

type JSInfo struct {
	ID       string          `json:"server_id"`
	Now      time.Time       `json:"now"`
	Disabled bool            `json:"disabled,omitempty"`
	Config   JetStreamConfig `json:"config,omitempty"`
	JetStreamStats
	Streams   int              `json:"streams"`
	Consumers int              `json:"consumers"`
	Messages  uint64           `json:"messages"`
	Bytes     uint64           `json:"bytes"`
	Meta      *MetaClusterInfo `json:"meta_cluster,omitempty"`

	// aggregate raft info
	AccountDetails []*AccountDetail `json:"account_details,omitempty"`
}

type JSZResp

type JSZResp struct {
	Server ServerInfo `json:"server"`
	JSInfo JSInfo     `json:"data"`
}

type JetStreamAPIStats

type JetStreamAPIStats struct {
	Total    uint64 `json:"total"`
	Errors   uint64 `json:"errors"`
	Inflight uint64 `json:"inflight,omitempty"`
}

type JetStreamConfig

type JetStreamConfig struct {
	MaxMemory  int64  `json:"max_memory"`
	MaxStore   int64  `json:"max_storage"`
	StoreDir   string `json:"store_dir,omitempty"`
	Domain     string `json:"domain,omitempty"`
	CompressOK bool   `json:"compress_ok,omitempty"`
	UniqueTag  string `json:"unique_tag,omitempty"`
}

JetStreamConfig determines this server's configuration. MaxMemory and MaxStore are in bytes.

type JetStreamStats

type JetStreamStats struct {
	Memory         uint64            `json:"memory"`
	Store          uint64            `json:"storage"`
	ReservedMemory uint64            `json:"reserved_memory"`
	ReservedStore  uint64            `json:"reserved_storage"`
	Accounts       int               `json:"accounts"`
	HAAssets       int               `json:"ha_assets"`
	API            JetStreamAPIStats `json:"api"`
}

Statistics about JetStream for this server.

type JetStreamVarz

type JetStreamVarz struct {
	Config *JetStreamConfig `json:"config,omitempty"`
	Stats  *JetStreamStats  `json:"stats,omitempty"`
	Meta   *MetaClusterInfo `json:"meta,omitempty"`
}

JetStreamVarz contains basic runtime information about jetstream

type JszEventOptions

type JszEventOptions struct {
	JszOptions
	EventFilterOptions
}

type JszOptions

type JszOptions struct {
	Account    string `json:"account,omitempty"`
	Accounts   bool   `json:"accounts,omitempty"`
	Streams    bool   `json:"streams,omitempty"`
	Consumer   bool   `json:"consumer,omitempty"`
	Config     bool   `json:"config,omitempty"`
	LeaderOnly bool   `json:"leader_only,omitempty"`
	Offset     int    `json:"offset,omitempty"`
	Limit      int    `json:"limit,omitempty"`
	RaftGroups bool   `json:"raft,omitempty"`
}

type LeafNodeOptsVarz

type LeafNodeOptsVarz struct {
	Host        string               `json:"host,omitempty"`
	Port        int                  `json:"port,omitempty"`
	AuthTimeout float64              `json:"auth_timeout,omitempty"`
	TLSTimeout  float64              `json:"tls_timeout,omitempty"`
	TLSRequired bool                 `json:"tls_required,omitempty"`
	TLSVerify   bool                 `json:"tls_verify,omitempty"`
	Remotes     []RemoteLeafOptsVarz `json:"remotes,omitempty"`
}

LeafNodeOptsVarz contains monitoring leaf node information

type MQTTOptsVarz

type MQTTOptsVarz struct {
	Host           string        `json:"host,omitempty"`
	Port           int           `json:"port,omitempty"`
	NoAuthUser     string        `json:"no_auth_user,omitempty"`
	AuthTimeout    float64       `json:"auth_timeout,omitempty"`
	TLSMap         bool          `json:"tls_map,omitempty"`
	TLSTimeout     float64       `json:"tls_timeout,omitempty"`
	TLSPinnedCerts []string      `json:"tls_pinned_certs,omitempty"`
	JsDomain       string        `json:"js_domain,omitempty"`
	AckWait        time.Duration `json:"ack_wait,omitempty"`
	MaxAckPending  uint16        `json:"max_ack_pending,omitempty"`
}

MQTTOptsVarz contains monitoring MQTT information

type MetaClusterInfo

type MetaClusterInfo struct {
	Name     string      `json:"name,omitempty"`
	Leader   string      `json:"leader,omitempty"`
	Peer     string      `json:"peer,omitempty"`
	Replicas []*PeerInfo `json:"replicas,omitempty"`
	Size     int         `json:"cluster_size"`
}

MetaClusterInfo shows information about the meta group.

type PeerInfo

type PeerInfo struct {
	Name    string        `json:"name"`
	Current bool          `json:"current"`
	Offline bool          `json:"offline,omitempty"`
	Active  time.Duration `json:"active"`
	Lag     uint64        `json:"lag,omitempty"`
	Peer    string        `json:"peer"`
}

PeerInfo shows information about all the peers in the cluster that are supporting the stream or consumer.

type RaftGroupDetail

type RaftGroupDetail struct {
	Name      string `json:"name"`
	RaftGroup string `json:"raft_group,omitempty"`
}

type RemoteGatewayOptsVarz

type RemoteGatewayOptsVarz struct {
	Name       string   `json:"name"`
	TLSTimeout float64  `json:"tls_timeout,omitempty"`
	URLs       []string `json:"urls,omitempty"`
}

RemoteGatewayOptsVarz contains monitoring remote gateway information

type RemoteLeafOptsVarz

type RemoteLeafOptsVarz struct {
	LocalAccount string     `json:"local_account,omitempty"`
	TLSTimeout   float64    `json:"tls_timeout,omitempty"`
	URLs         []string   `json:"urls,omitempty"`
	Deny         *DenyRules `json:"deny,omitempty"`
}

RemoteLeafOptsVarz contains monitoring remote leaf node information

type RequestManyOpt

type RequestManyOpt func(*requestManyOpts) error

func WithRequestManyCount

func WithRequestManyCount(count int) RequestManyOpt

func WithRequestManyMaxInterval

func WithRequestManyMaxInterval(interval time.Duration) RequestManyOpt

func WithRequestManyMaxWait

func WithRequestManyMaxWait(maxWait time.Duration) RequestManyOpt

type RouteStat

type RouteStat struct {
	ID       uint64    `json:"rid"`
	Name     string    `json:"name,omitempty"`
	Sent     DataStats `json:"sent"`
	Received DataStats `json:"received"`
	Pending  int       `json:"pending"`
}

RouteStat holds route statistics.

type ServerInfo

type ServerInfo struct {
	Name      string    `json:"name"`
	Host      string    `json:"host"`
	ID        string    `json:"id"`
	Cluster   string    `json:"cluster,omitempty"`
	Domain    string    `json:"domain,omitempty"`
	Version   string    `json:"ver"`
	Tags      []string  `json:"tags,omitempty"`
	Seq       uint64    `json:"seq"`
	JetStream bool      `json:"jetstream"`
	Time      time.Time `json:"time"`
}

ServerInfo identifies remote servers.

type ServerStats

type ServerStats struct {
	Start            time.Time      `json:"start"`
	Mem              int64          `json:"mem"`
	Cores            int            `json:"cores"`
	CPU              float64        `json:"cpu"`
	Connections      int            `json:"connections"`
	TotalConnections uint64         `json:"total_connections"`
	ActiveAccounts   int            `json:"active_accounts"`
	NumSubs          uint32         `json:"subscriptions"`
	Sent             DataStats      `json:"sent"`
	Received         DataStats      `json:"received"`
	SlowConsumers    int64          `json:"slow_consumers"`
	Routes           []*RouteStat   `json:"routes,omitempty"`
	Gateways         []*GatewayStat `json:"gateways,omitempty"`
	ActiveServers    int            `json:"active_servers,omitempty"`
	JetStream        *JetStreamVarz `json:"jetstream,omitempty"`
}

ServerStats hold various statistics that we will periodically send out.

type ServerStatszResp

type ServerStatszResp struct {
	Server ServerInfo  `json:"server"`
	Statsz ServerStats `json:"statsz"`
}

type SortOpt

type SortOpt string
const (
	ByCid      SortOpt = "cid"        // By connection ID
	ByStart    SortOpt = "start"      // By connection start time, same as CID
	BySubs     SortOpt = "subs"       // By number of subscriptions
	ByPending  SortOpt = "pending"    // By amount of data in bytes waiting to be sent to client
	ByOutMsgs  SortOpt = "msgs_to"    // By number of messages sent
	ByInMsgs   SortOpt = "msgs_from"  // By number of messages received
	ByOutBytes SortOpt = "bytes_to"   // By amount of bytes sent
	ByInBytes  SortOpt = "bytes_from" // By amount of bytes received
	ByLast     SortOpt = "last"       // By the last activity
	ByIdle     SortOpt = "idle"       // By the amount of inactivity
	ByUptime   SortOpt = "uptime"     // By the amount of time connections exist
	ByStop     SortOpt = "stop"       // By the stop time for a closed connection
	ByReason   SortOpt = "reason"     // By the reason for a closed connection
)

Possible sort options

type StatszEventOptions

type StatszEventOptions struct {
	EventFilterOptions
}

StatszEventOptions are options passed to Statsz

type StreamDetail

type StreamDetail struct {
	Name               string                   `json:"name"`
	Created            time.Time                `json:"created"`
	Cluster            *nats.ClusterInfo        `json:"cluster,omitempty"`
	Config             *nats.StreamConfig       `json:"config,omitempty"`
	State              nats.StreamState         `json:"state,omitempty"`
	Consumer           []*nats.ConsumerInfo     `json:"consumer_detail,omitempty"`
	Mirror             *nats.StreamSourceInfo   `json:"mirror,omitempty"`
	Sources            []*nats.StreamSourceInfo `json:"sources,omitempty"`
	RaftGroup          string                   `json:"stream_raft_group,omitempty"`
	ConsumerRaftGroups []*RaftGroupDetail       `json:"consumer_raft_groups,omitempty"`
}

type SubDetail

type SubDetail struct {
	Account string `json:"account,omitempty"`
	Subject string `json:"subject"`
	Queue   string `json:"qgroup,omitempty"`
	Sid     string `json:"sid"`
	Msgs    int64  `json:"msgs"`
	Max     int64  `json:"max,omitempty"`
	Cid     uint64 `json:"cid"`
}

type SublistStats

type SublistStats struct {
	NumSubs      uint32  `json:"num_subscriptions"`
	NumCache     uint32  `json:"num_cache"`
	NumInserts   uint64  `json:"num_inserts"`
	NumRemoves   uint64  `json:"num_removes"`
	NumMatches   uint64  `json:"num_matches"`
	CacheHitRate float64 `json:"cache_hit_rate"`
	MaxFanout    uint32  `json:"max_fanout"`
	AvgFanout    float64 `json:"avg_fanout"`
}

type Subsz

type Subsz struct {
	ID  string    `json:"server_id"`
	Now time.Time `json:"now"`
	*SublistStats
	Total  int         `json:"total"`
	Offset int         `json:"offset"`
	Limit  int         `json:"limit"`
	Subs   []SubDetail `json:"subscriptions_list,omitempty"`
}

type SubszOptions

type SubszOptions struct {
	// Offset is used for pagination. Subsz() only returns connections starting at this
	// offset from the global results.
	Offset int `json:"offset"`

	// Limit is the maximum number of subscriptions that should be returned by Subsz().
	Limit int `json:"limit"`

	// Subscriptions indicates if subscription details should be included in the results.
	Subscriptions bool `json:"subscriptions"`

	// Filter based on this account name.
	Account string `json:"account,omitempty"`

	// Test the list against this subject. Needs to be literal since it signifies a publish subject.
	// We will only return subscriptions that would match if a message was sent to this subject.
	Test string `json:"test,omitempty"`
}

SubszOptions are the options passed to Subsz.

type SubszResp

type SubszResp struct {
	Server ServerInfo `json:"server"`
	Subsz  Subsz      `json:"data"`
}

type SysClientOpt

type SysClientOpt func(*sysClientOpts) error

func ServerCount

func ServerCount(count int) SysClientOpt

func SysMultiRequestInterval

func SysMultiRequestInterval(initialTimeout, interval time.Duration) SysClientOpt

func SysRequestTimeout

func SysRequestTimeout(timeout time.Duration) SysClientOpt

type System

type System struct {
	// contains filtered or unexported fields
}

System can be used to request monitoring data from the server

func NewSysClient

func NewSysClient(nc *nats.Conn, opts ...SysClientOpt) (*System, error)

func (*System) Connz

func (s *System) Connz(id string, opts ConnzEventOptions) (*ConnzResp, error)

Connz returns server connection details

func (*System) ConnzPing

func (s *System) ConnzPing(opts ConnzEventOptions) ([]ConnzResp, error)

func (*System) Healthz

func (s *System) Healthz(id string, opts HealthzOptions) (*HealthzResp, error)

Healthz checks server health status

func (*System) HealthzPing

func (s *System) HealthzPing(opts HealthzOptions) ([]HealthzResp, error)

func (*System) Jsz

func (s *System) Jsz(id string, opts JszEventOptions) (*JSZResp, error)

Jsz returns server jetstream details

func (*System) JszPing

func (s *System) JszPing(opts JszEventOptions) ([]JSZResp, error)

func (*System) RequestMany

func (s *System) RequestMany(subject string, data []byte, opts ...RequestManyOpt) ([]*nats.Msg, error)

func (*System) ServerStatsz

func (s *System) ServerStatsz(id string, opts StatszEventOptions) (*ServerStatszResp, error)

ServerStatsz returns server statistics for the Statsz structs

func (*System) ServerStatszPing

func (s *System) ServerStatszPing(opts StatszEventOptions) ([]ServerStatszResp, error)

func (*System) ServerSubsz

func (s *System) ServerSubsz(id string, opts SubszOptions) (*SubszResp, error)

ServerSubsz returns server subscriptions data

func (*System) ServerSubszPing

func (s *System) ServerSubszPing(opts SubszOptions) ([]SubszResp, error)

func (*System) Varz

func (s *System) Varz(id string, opts VarzEventOptions) (*VarzResp, error)

Varz returns general server information

func (*System) VarzPing

func (s *System) VarzPing(opts VarzEventOptions) ([]VarzResp, error)

type TLSPeerCert

type TLSPeerCert struct {
	Subject          string `json:"subject,omitempty"`
	SubjectPKISha256 string `json:"spki_sha256,omitempty"`
	CertSha256       string `json:"cert_sha256,omitempty"`
}

TLSPeerCert contains basic information about a TLS peer certificate

type Varz

type Varz struct {
	ID                    string                `json:"server_id"`
	Name                  string                `json:"server_name"`
	Version               string                `json:"version"`
	Proto                 int                   `json:"proto"`
	GitCommit             string                `json:"git_commit,omitempty"`
	GoVersion             string                `json:"go"`
	Host                  string                `json:"host"`
	Port                  int                   `json:"port"`
	AuthRequired          bool                  `json:"auth_required,omitempty"`
	TLSRequired           bool                  `json:"tls_required,omitempty"`
	TLSVerify             bool                  `json:"tls_verify,omitempty"`
	IP                    string                `json:"ip,omitempty"`
	ClientConnectURLs     []string              `json:"connect_urls,omitempty"`
	WSConnectURLs         []string              `json:"ws_connect_urls,omitempty"`
	MaxConn               int                   `json:"max_connections"`
	MaxSubs               int                   `json:"max_subscriptions,omitempty"`
	PingInterval          time.Duration         `json:"ping_interval"`
	MaxPingsOut           int                   `json:"ping_max"`
	HTTPHost              string                `json:"http_host"`
	HTTPPort              int                   `json:"http_port"`
	HTTPBasePath          string                `json:"http_base_path"`
	HTTPSPort             int                   `json:"https_port"`
	AuthTimeout           float64               `json:"auth_timeout"`
	MaxControlLine        int32                 `json:"max_control_line"`
	MaxPayload            int                   `json:"max_payload"`
	MaxPending            int64                 `json:"max_pending"`
	Cluster               ClusterOptsVarz       `json:"cluster,omitempty"`
	Gateway               GatewayOptsVarz       `json:"gateway,omitempty"`
	LeafNode              LeafNodeOptsVarz      `json:"leaf,omitempty"`
	MQTT                  MQTTOptsVarz          `json:"mqtt,omitempty"`
	Websocket             WebsocketOptsVarz     `json:"websocket,omitempty"`
	JetStream             JetStreamVarz         `json:"jetstream,omitempty"`
	TLSTimeout            float64               `json:"tls_timeout"`
	WriteDeadline         time.Duration         `json:"write_deadline"`
	Start                 time.Time             `json:"start"`
	Now                   time.Time             `json:"now"`
	Uptime                string                `json:"uptime"`
	Mem                   int64                 `json:"mem"`
	Cores                 int                   `json:"cores"`
	MaxProcs              int                   `json:"gomaxprocs"`
	CPU                   float64               `json:"cpu"`
	Connections           int                   `json:"connections"`
	TotalConnections      uint64                `json:"total_connections"`
	Routes                int                   `json:"routes"`
	Remotes               int                   `json:"remotes"`
	Leafs                 int                   `json:"leafnodes"`
	InMsgs                int64                 `json:"in_msgs"`
	OutMsgs               int64                 `json:"out_msgs"`
	InBytes               int64                 `json:"in_bytes"`
	OutBytes              int64                 `json:"out_bytes"`
	SlowConsumers         int64                 `json:"slow_consumers"`
	Subscriptions         uint32                `json:"subscriptions"`
	HTTPReqStats          map[string]uint64     `json:"http_req_stats"`
	ConfigLoadTime        time.Time             `json:"config_load_time"`
	Tags                  jwt.TagList           `json:"tags,omitempty"`
	TrustedOperatorsJwt   []string              `json:"trusted_operators_jwt,omitempty"`
	TrustedOperatorsClaim []*jwt.OperatorClaims `json:"trusted_operators_claim,omitempty"`
	SystemAccount         string                `json:"system_account,omitempty"`
	PinnedAccountFail     uint64                `json:"pinned_account_fails,omitempty"`
}

VarzResp is a server response from VARZ endpoint, containing general information about the server.

type VarzEventOptions

type VarzEventOptions struct {
	EventFilterOptions
}

In the context of system events, VarzEventOptions are options passed to Varz

type VarzResp

type VarzResp struct {
	Server ServerInfo `json:"server"`
	Varz   Varz       `json:"data"`
}

type WebsocketOptsVarz

type WebsocketOptsVarz struct {
	Host             string        `json:"host,omitempty"`
	Port             int           `json:"port,omitempty"`
	Advertise        string        `json:"advertise,omitempty"`
	NoAuthUser       string        `json:"no_auth_user,omitempty"`
	JWTCookie        string        `json:"jwt_cookie,omitempty"`
	HandshakeTimeout time.Duration `json:"handshake_timeout,omitempty"`
	AuthTimeout      float64       `json:"auth_timeout,omitempty"`
	NoTLS            bool          `json:"no_tls,omitempty"`
	TLSMap           bool          `json:"tls_map,omitempty"`
	TLSPinnedCerts   []string      `json:"tls_pinned_certs,omitempty"`
	SameOrigin       bool          `json:"same_origin,omitempty"`
	AllowedOrigins   []string      `json:"allowed_origins,omitempty"`
	Compression      bool          `json:"compression,omitempty"`
}

WebsocketOptsVarz contains monitoring websocket information

Jump to

Keyboard shortcuts

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