prometheus

package
v0.0.0-...-2dd00e5 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() provider.Provider

New provider

Types

type Config

type Config struct {
	URL      string `hcl:"url"`
	Timeout  int    `hcl:"timeout,optional"`
	Interval int    `hcl:"interval,optional"`
	Query    string `hcl:"query"`
}

Config struct

func (Config) IntervalDuration

func (c Config) IntervalDuration() time.Duration

IntervalDuration return interval in second

func (Config) TimeoutDuration

func (c Config) TimeoutDuration() time.Duration

TimeoutDuration return timeout in second

type ErrorType

type ErrorType string
const (
	ErrorNone        ErrorType = ""
	ErrorTimeout     ErrorType = "timeout"
	ErrorCanceled    ErrorType = "canceled"
	ErrorExec        ErrorType = "execution"
	ErrorBadData     ErrorType = "bad_data"
	ErrorInternal    ErrorType = "internal"
	ErrorUnavailable ErrorType = "unavailable"
	ErrorNotFound    ErrorType = "not_found"
)

type Provider

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

Provider struct

func (*Provider) Info

func (p *Provider) Info() provider.Info

Info return provider info

func (*Provider) Start

func (p *Provider) Start(tile *config.Tile, messages bus.Writer) error

Start func

func (*Provider) Stop

func (p *Provider) Stop() error

Stop func

type QueryData

type QueryData struct {
	ResultType ValueType       `json:"resultType"`
	Result     json.RawMessage `json:"result"`
}

QueryData struct

type Response

type Response struct {
	Status    StatusType `json:"status"`
	Data      QueryData  `json:"data,omitempty"`
	ErrorType ErrorType  `json:"errorType,omitempty"`
	Error     string     `json:"error,omitempty"`
	Warnings  []string   `json:"warnings,omitempty"`
}

type ResultVector

type ResultVector struct {
	Metric json.RawMessage `json:"metric"`
	Value  []interface{}   `json:"value"`
}

type ResultVectorType

type ResultVectorType []ResultVector

type StatusType

type StatusType string
const (
	StatusTypeSuccess StatusType = "success"
	StatusTypeError   StatusType = "error"
)

type ValueType

type ValueType string

ValueType describes a type of a value.

const (
	ValueTypeNone   ValueType = "none"
	ValueTypeVector ValueType = "vector"
	ValueTypeScalar ValueType = "scalar"
	ValueTypeMatrix ValueType = "matrix"
	ValueTypeString ValueType = "string"
)

The valid value types.

Jump to

Keyboard shortcuts

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