exporter

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2024 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeMetricName

func MakeMetricName(parts ...string) string

func SanitizeIntValue

func SanitizeIntValue(s string) (int64, error)

func SanitizeValue

func SanitizeValue(s string) (float64, error)

Types

type JSONFetcher

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

func NewJSONFetcher

func NewJSONFetcher(ctx context.Context, m config.Module, tplValues url.Values) *JSONFetcher

func (*JSONFetcher) FetchJSON

func (f *JSONFetcher) FetchJSON(endpoint string) ([]byte, error)

type JSONMetric

type JSONMetric struct {
	Desc                   *prometheus.Desc
	Type                   config.ScrapeType
	KeyJSONPath            string
	ValueJSONPath          string
	LabelsJSONPaths        []string
	ValueType              prometheus.ValueType
	EpochTimestampJSONPath string
}

func CreateMetricsList

func CreateMetricsList(c config.Module) ([]JSONMetric, error)

type JSONMetricCollector

type JSONMetricCollector struct {
	JSONMetrics []JSONMetric
	Data        []byte
}

func (JSONMetricCollector) Collect

func (mc JSONMetricCollector) Collect(ch chan<- prometheus.Metric)

func (JSONMetricCollector) Describe

func (mc JSONMetricCollector) Describe(ch chan<- *prometheus.Desc)

Jump to

Keyboard shortcuts

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