collector

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package collector includes all individual collectors.

Index

Constants

This section is empty.

Variables

View Source
var ErrNoData = errors.New("collector returned no data")

ErrNoData indicates the collector found no data to collect, but had no other error.

Functions

func DisableDefaultCollectors

func DisableDefaultCollectors()

DisableDefaultCollectors sets the collector state to false for all collectors which have not been explicitly enabled on the command line.

func IsNoDataError

func IsNoDataError(err error) bool

Types

type Collector

type Collector interface {
	// Get new metrics and expose them via prometheus registry.
	Update(ch chan<- prometheus.Metric) error
}

Collector is the interface a collector has to implement.

type FabricLink struct {
	Cost        float64 `json:"cost"`
	DestLatency float64 `json:"destLatency"`
	DestRouter  struct {
		Name string `json:"name"`
	} `json:"destRouter"`
	Down          bool    `json:"down"`
	ID            string  `json:"id"`
	Protocol      string  `json:"protocol"`
	SourceLatency float64 `json:"sourceLatency"`
	SourceRouter  struct {
		Name string `json:"name"`
	} `json:"sourceRouter"`
	State      string  `json:"state"`
	StaticCost float64 `json:"staticCost"`
}

FabricLink represent the meaningful chracteristics of a Ziti Fabric Link for this exporter

type FabricLinks struct {
	Data []FabricLink `json:"data"`
	Meta MetaData     `json:"meta"`
}

type Identities

type Identities struct {
	Data []Identity `json:"data"`
	Meta MetaData   `json:"meta"`
}

type Identity

type Identity struct {
	CreatedAt               string   `json:"createdAt"`
	UpdatedAt               string   `json:"updatedAt"`
	Disabled                bool     `json:"disabled"`
	HasAPISession           bool     `json:"hasApiSession"`
	HasEdgeRouterConnection bool     `json:"hasEdgeRouterConnection"`
	Name                    string   `json:"name"`
	RoleAttributes          []string `json:"roleAttributes"`
	SdkInfo                 struct {
		Type    string `json:"type"`
		Version string `json:"version"`
	} `json:"sdkInfo"`
	TypeID string `json:"typeId"`
}

Identity represent the meaningful chracteristics of a Ziti Identity for this exporter

type LoginData

type LoginData struct {
	CreatedAt string `json:"createdAt"`
	UpdatedAt string `json:"updatedAt"`
	ExpiresAt string `json:"expiresAt"`
	Token     string `json:"token"`
}

LoginData represent the meaningful chracteristics of a Ziti Authentication endpoint

type LoginOptions

type LoginOptions struct {
	api.Options
	Username                   string
	Password                   string
	Host                       string
	HostReadyEdgeManagementAPI string
	HostReadyFabricAPI         string
	Token                      string
	Logger                     log.Logger
	CaCert                     string
	ReadOnly                   bool
	Yes                        bool
	IgnoreConfig               bool
	ClientCert                 string
	ClientKey                  string
	ExtJwt                     string
	IdentTypeFilter            []string
}

LoginOptions are the flags for login commands

func (*LoginOptions) ConfigureCerts

func (o *LoginOptions) ConfigureCerts(host string, ctrlURL *url.URL) error
func (o *LoginOptions) RunFabricLinks() (FabricLinks, error)

RunFabricLinks implements this command

func (*LoginOptions) RunIdentities

func (o *LoginOptions) RunIdentities() (Identities, error)

RunIdentities implements this command

func (*LoginOptions) RunLogin

func (o *LoginOptions) RunLogin() error

RunLogin implements this command

func (*LoginOptions) RunRouters

func (o *LoginOptions) RunRouters() (Routers, error)

RunRouters implements this command

func (*LoginOptions) WriteCert

func (o *LoginOptions) WriteCert(id string, cert []byte) (string, error)

type LoginSession

type LoginSession struct {
	Data LoginData `json:"data"`
}

type MetaData

type MetaData struct {
	Pagination struct {
		TotalCount int `json:"totalCount"`
	} `json:"pagination"`
}

MetaData represent the pagination part of a Ziti Identity call

type OpenZitiCollector

type OpenZitiCollector struct {
	Collectors map[string]Collector
	// contains filtered or unexported fields
}

OpenZitiCollector implements the prometheus.Collector interface.

func NewOpenZitiCollector

func NewOpenZitiCollector(logger log.Logger, options *LoginOptions, filters ...string) (*OpenZitiCollector, error)

NewOpenZitiCollector creates a new OpenZitiCollector.

func (OpenZitiCollector) Collect

func (n OpenZitiCollector) Collect(ch chan<- prometheus.Metric)

Collect implements the prometheus.Collector interface.

func (OpenZitiCollector) Describe

func (n OpenZitiCollector) Describe(ch chan<- *prometheus.Desc)

Describe implements the prometheus.Collector interface.

type Router

type Router struct {
	Disabled          bool     `json:"disabled"`
	Hostname          string   `json:"hostname"`
	IsOnline          bool     `json:"isOnline"`
	Name              string   `json:"name"`
	NoTraversal       bool     `json:"noTraversal"`
	SyncStatus        string   `json:"syncStatus"`
	IsTunnelerEnabled bool     `json:"isTunnelerEnabled"`
	IsVerified        bool     `json:"isVerified"`
	RoleAttributes    []string `json:"roleAttributes"`
	VersionInfo       struct {
		Version string `json:"version"`
	} `json:"versionInfo"`
}

Router represent the meaningful chracteristics of a Ziti Router for this exporter

type Routers

type Routers struct {
	Data []Router `json:"data"`
	Meta MetaData `json:"meta"`
}

Jump to

Keyboard shortcuts

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