Documentation ¶
Overview ¶
Package collector includes all individual collectors to gather and export system metrics.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( WorkspacesTotal = prometheus.NewDesc( prometheus.BuildFQName(namespace, workspacesSubsystem, "total"), "Total number of existing workspaces.", []string{}, nil, ) WorkspacesInfo = prometheus.NewDesc( prometheus.BuildFQName(namespace, workspacesSubsystem, "info"), "Information about existing workspaces", []string{"id", "name", "organization", "terraform_version", "created_at", "environment", "current_run", "current_run_status", "current_run_created_at"}, nil, ) )
Metric descriptors.
var ( // scrapers lists all possible collection methods. Scrapers = []Scraper{} )
Functions ¶
This section is empty.
Types ¶
type Exporter ¶
type Exporter struct {
// contains filtered or unexported fields
}
Exporter collects TF metrics. It implements the prometheus.Collector interface.
func (*Exporter) Collect ¶
func (e *Exporter) Collect(ch chan<- prometheus.Metric)
Collect implements the prometheus.Collector interface.
func (*Exporter) Describe ¶
func (e *Exporter) Describe(ch chan<- *prometheus.Desc)
Describe implements the prometheus.Collector interface.
type Metrics ¶
type Metrics struct { TotalScrapes prometheus.Counter ScrapeErrors *prometheus.CounterVec Error prometheus.Gauge }
Metrics represents exporter metrics which values can be carried between http requests.
type ScrapeWorkspaces ¶
type ScrapeWorkspaces struct{}
ScrapeWorkspaces scrapes metrics about the workspaces.
func (ScrapeWorkspaces) Help ¶
func (ScrapeWorkspaces) Help() string
Help describes the role of the Scraper.
func (ScrapeWorkspaces) Name ¶
func (ScrapeWorkspaces) Name() string
Name of the Scraper. Should be unique.
func (ScrapeWorkspaces) Scrape ¶
func (ScrapeWorkspaces) Scrape(ctx context.Context, config *setup.Config, ch chan<- prometheus.Metric) error
Scrape collects data from Terraform API and sends it over channel as prometheus metric.
func (ScrapeWorkspaces) Version ¶
func (ScrapeWorkspaces) Version() string
Version of Terraform Cloud/Enterprise API from which scraper is available.
type Scraper ¶
type Scraper interface { // Name of the Scraper. Should be unique. Name() string // Help describes the role of the Scraper. // Example: "Collect Workspaces" Help() string // Version of Terraform Cloud/Enterprise API from which scraper is available. Version() string // Scrape collects data from a particular terraform cloud/enterprise API and sends it over channel as prometheus metric. Scrape(ctx context.Context, config *setup.Config, ch chan<- prometheus.Metric) error }
Scraper is minimal interface that let's you add new prometheus metrics to tf_exporter.