collector

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Skip insecure connection verify due to using self signed certificate on syncthing side.
	HttpClient = &http.Client{
		Transport: &http.Transport{
			TLSClientConfig: &tls.Config{
				InsecureSkipVerify: true,
			},
		},
	}
)

Functions

This section is empty.

Types

type DBStatusMetrics added in v0.3.0

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

DBStatusResponse defines collector struct.

func NewDBStatusReport added in v0.3.0

func NewDBStatusReport(logger log.Logger, client *http.Client, url *url.URL, token *string, foldersid *[]string) *DBStatusMetrics

NewDBStatusReport returns a new Collector exposing SVCResponse

func (*DBStatusMetrics) Collect added in v0.3.0

func (c *DBStatusMetrics) Collect(ch chan<- prometheus.Metric)

Collect collects Syncthing metrics from /rest/db/status.

func (*DBStatusMetrics) Describe added in v0.3.0

func (c *DBStatusMetrics) Describe(ch chan<- *prometheus.Desc)

Describe set Prometheus metrics descriptions.

type DBStatusResponse added in v0.3.0

type DBStatusResponse struct {
	Errors float64 `json:"errors"`

	GlobalBytes       float64 `json:"globalBytes"`
	GlobalDeleted     float64 `json:"globalDeleted"`
	GlobalDirectories float64 `json:"globalDirectories"`
	GlobalSymlinks    float64 `json:"globalSymlinks"`
	GlobalTotalItems  float64 `json:"globalTotalItems"`

	IgnorePatters bool `json:"ignorePatterns"`

	InSyncBytes float64 `json:"inSyncBytes"`
	InSyncFiles float64 `json:"inSyncFiles"`

	Invalid string `json:"invalid,omitempty"` // Deprecated, retains external API for now

	LocalBytes       float64 `json:"localBytes"`
	LocalDeleted     float64 `json:"localDeleted"`
	LocalDirectories float64 `json:"localDirectories"`
	LocalFiles       float64 `json:"localFiles"`
	LocalSymlinks    float64 `json:"localSymlinks"`
	LocalTotalItems  float64 `json:"localTotalItems"`

	NeedBytes       float64 `json:"needBytes"`
	NeedDeletes     float64 `json:"needDeletes"`
	NeedDirectories float64 `json:"needDirectories"`
	NeedFiles       float64 `json:"needFiles"`
	NeedSymlinks    float64 `json:"needSymlinks"`
	NeedTotalItems  float64 `json:"needTotalItems"`

	PullErrors float64 `json:"pullErrors"`
	Sequence   float64 `json:"sequence"`

	State        string  `json:"state"`
	StateChanged string  `json:"stateChanged"`
	Version      float64 `json:"version,omitempty"` // Deprecated, retains external API for now

}

type DBStatusResponseBoolMetrics added in v0.3.0

type DBStatusResponseBoolMetrics struct {
	Type  prometheus.ValueType
	Desc  *prometheus.Desc
	Value func(v bool) float64
}

DBStatusResponseBoolMetrics defines struct for boolean metrics

type DBStatusResponseNumericalMetrics added in v0.3.0

type DBStatusResponseNumericalMetrics struct {
	Type  prometheus.ValueType
	Desc  *prometheus.Desc
	Value float64
}

DBStatusResponseNumericalMetrics defines struct for numeric metrics

type SCResponse

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

SCResponse defines collector struct.

func NewSCReport

func NewSCReport(logger log.Logger, client *http.Client, url *url.URL, token *string) *SCResponse

NewSCReport returns a new Collector exposing SVCResponse

func (*SCResponse) Collect

func (c *SCResponse) Collect(ch chan<- prometheus.Metric)

Collect collects Syncthing metrics from /rest/system/connections.

func (*SCResponse) Describe

func (c *SCResponse) Describe(ch chan<- *prometheus.Desc)

Describe set Prometheus metrics descriptions.

type SCResponseBoolMetrics

type SCResponseBoolMetrics struct {
	Type  prometheus.ValueType
	Desc  *prometheus.Desc
	Value func(v bool) float64
}

SCResponseBoolMetrics defines struct for boolean metrics

type SCResponseNumericalMetrics

type SCResponseNumericalMetrics struct {
	Type  prometheus.ValueType
	Desc  *prometheus.Desc
	Value func(v int) float64
}

SCResponseNumericalMetrics defines struct for numeric metrics

type SCResponseTotalNumericalMetrics

type SCResponseTotalNumericalMetrics struct {
	Type  prometheus.ValueType
	Desc  *prometheus.Desc
	Value func(v int) float64
}

SCResponseTotalNumericalMetrics defines struct for total metrics

type SVCResponse

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

SVCResponse defines collector struct.

func NewSVCReport

func NewSVCReport(logger log.Logger, client *http.Client, url *url.URL, token *string) *SVCResponse

NewSVCReport returns a new Collector exposing SVCResponse

func (*SVCResponse) Collect

func (c *SVCResponse) Collect(ch chan<- prometheus.Metric)

Collect collects Syncthing metrics from /rest/svc/report.

func (*SVCResponse) Describe

func (c *SVCResponse) Describe(ch chan<- *prometheus.Desc)

Describe set Prometheus metrics descriptions.

type StatsDeviceResponse added in v0.2.4

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

SDResponse defines collector struct.

func NewStatsDeviceReport added in v0.2.4

func NewStatsDeviceReport(logger log.Logger, client *http.Client, url *url.URL, token *string) *StatsDeviceResponse

NewStatDeviceReport

func (*StatsDeviceResponse) Collect added in v0.2.4

func (c *StatsDeviceResponse) Collect(ch chan<- prometheus.Metric)

Collect collects Syncthing metrics from /rest/stats/device.

func (*StatsDeviceResponse) Describe added in v0.2.4

func (c *StatsDeviceResponse) Describe(ch chan<- *prometheus.Desc)

Describe set Prometheus metrics descriptions.

type StatsDeviceResponseNumericalMetrics added in v0.2.4

type StatsDeviceResponseNumericalMetrics struct {
	Type  prometheus.ValueType
	Desc  *prometheus.Desc
	Value func(v float64) float64
}

SDResponseNumericalMetrics defines struct for numeric metrics

type SystemConnectionsResponse

type SystemConnectionsResponse struct {
	CS    map[string]connectionParameters `json:"connections"`
	Total connectionParameters            `json:"total"`
}

SystemConnectionsResponse defines response struct for /rest/system/connections endpoint. Tested with Syncthing version 1.9.0.

Jump to

Keyboard shortcuts

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