collector

package
v0.0.0-...-6840799 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Location

type Location struct {
	Location  string
	Latitude  float64
	Longitude float64
}

type OpenweatherCollector

type OpenweatherCollector struct {
	ApiKey      string
	DegreesUnit string
	Language    string
	Locations   []Location
	// contains filtered or unexported fields
}

OpenweatherCollector Define a struct for your collector that contains pointers to prometheus descriptors for each metric you wish to expose. Note you can also include fields of other types if they provide utility, but we just won't be exposing them as metrics.

func NewOpenweatherCollector

func NewOpenweatherCollector(degreesUnit string, language string, apikey string, locations string) *OpenweatherCollector

NewOpenweatherCollector You must create a constructor for your collector that initializes every descriptor and returns a pointer to the collector

func (*OpenweatherCollector) Collect

func (collector *OpenweatherCollector) Collect(ch chan<- prometheus.Metric)

Collect implements required collect function for all prometheus collectors

func (*OpenweatherCollector) Describe

func (collector *OpenweatherCollector) Describe(ch chan<- *prometheus.Desc)

Describe Each and every collector must implement the Describe function. It essentially writes all descriptors to the prometheus desc channel.

Jump to

Keyboard shortcuts

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