prometheus

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2019 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(config Config) metrics.MetricsDB

Types

type Config

type Config struct {
	URL             string     `mapstructure:"url"`
	BearerTokenFile string     `mapstructure:"bearer-token-file"`
	TLSConfig       *TLSConfig `mapstructure:"tls-config"`
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig() Config

func (*Config) Validate

func (c *Config) Validate() error

type Data

type Data struct {
	ResultType ResultType    `json:"resultType"`
	Result     []interface{} `json:"result"`
}

type MatrixResult

type MatrixResult struct {
	Metric map[string]string `json:"metric"`
	Values []Value           `json:"values"`
}

type Response

type Response struct {
	Status    string `json:"status"`
	Data      Data   `json:"data"`
	ErrorType string `json:"errorType"`
	Error     string `json:"error"`
	// contains filtered or unexported fields
}

type ResultType

type ResultType string
var MatrixResultType ResultType = "matrix"
var ScalarResultType ResultType = "scalar"
var StringResultType ResultType = "string"
var VectorResultType ResultType = "vector"

type ScalarResult

type ScalarResult Value

type StringResult

type StringResult Value

type TLSConfig

type TLSConfig struct {
	// Path to CA certificate to validate API server certificate with.
	// CAFile string
	// Certificate and key files for client cert authentication to the server.
	// CertFile           string
	// KeyFile            string
	InsecureSkipVerify bool `mapstructure:"insecure-skip-verify"`
}

type Value

type Value []interface{}

type VectorResult

type VectorResult struct {
	Metric map[string]string `json:"metric"`
	Value  Value             `json:"value"`
}

Jump to

Keyboard shortcuts

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