metrics

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorResponse added in v0.1.19

type ErrorResponse struct {
	Code    int64  `json:"code"`
	Message string `json:"message"`
}

type IamContext

type IamContext interface {
	IamToken() (signed string, err error)
}

func CreateIamContext

func CreateIamContext(keyId string, serviceAccountId string, keyFileName string) IamContext

type IamContextImpl added in v0.1.19

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

func (*IamContextImpl) IamToken added in v0.1.20

func (this *IamContextImpl) IamToken() (iam string, err error)

type Metric

type Metric struct {
	Name       string            `json:"name"`
	Labels     map[string]string `json:"labels,omitempty"`
	MetricType string            `json:"type"`
	Timestamp  string            `json:"ts,omitempty"`
	Value      float64           `json:"value"`
	Timeseries []Point           `json:"timeseries,omitempty"`
}

func CreateMetric

func CreateMetric(name string, labels map[string]string, metricType MetricType, timestamp time.Time, value float64, points []Point) Metric

func CreateSimpleMetric

func CreateSimpleMetric(name string, metricType MetricType, value float64) Metric

type MetricType

type MetricType string
const (
	DGAUGE  MetricType = "DGAUGE"
	IGAUGE  MetricType = "IGAUGE"
	COUNTER MetricType = "COUNTER"
	RATE    MetricType = "RATE"
)

type Payload

type Payload struct {
	Timestamp string            `json:"ts"`
	Labels    map[string]string `json:"labels"`
	Metrics   []Metric          `json:"metrics"`
}

func CreatePayload

func CreatePayload(timestamp time.Time, labels map[string]string, metrics []Metric) Payload

type Point

type Point struct {
	Timestamp string  `json:"ts"`
	Value     float64 `json:"value"`
}

func CreatePoint

func CreatePoint(timestamp time.Time, value float64) Point

type Response

type Response struct {
	Write        int64  `json:"writtenMetricsCount"`
	ErrorMessage string `json:"errorMessage"`
}

type YandexMonitoringClient

type YandexMonitoringClient interface {
	Write(timestamp time.Time, labels map[string]string, metrics []Metric) (result int64, err error)
}

func MakeYandexMonitoringClientImpl

func MakeYandexMonitoringClientImpl(baseUrl string, folderId string, iamContext IamContext) YandexMonitoringClient

type YandexMonitoringClientImpl

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

func (*YandexMonitoringClientImpl) Write

func (this *YandexMonitoringClientImpl) Write(timestamp time.Time, labels map[string]string, metrics []Metric) (result int64, err error)

Jump to

Keyboard shortcuts

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