metricsout

package
v0.0.0-...-29e199f Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package metricsout defines the implementation of the output adapter of the Prometheus metrics.

Index

Constants

View Source
const DefaultTestMetricsNamespace = "test_metrics_ns"

Variables

This section is empty.

Functions

func RenderPrometheusMetricDescriptor

func RenderPrometheusMetricDescriptor(namespace string, metricName string, labels map[string]string) (string, error)

Types

type HistogramVecMetricValues

type HistogramVecMetricValues struct {
	Sum   string
	Count string
}

type PrometheusCounterVectorAdapter

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

PrometheusCounterVectorAdapter implements CounterVectorAdapter.

func (PrometheusCounterVectorAdapter) Inc

Inc increases counter value

type PrometheusGaugeAdapter

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

PrometheusGaugeAdapter implements GaugeVectorAdapter.

func (PrometheusGaugeAdapter) Add

Add adds the given value to the Gauge with provided labels The value can be negative, resulting in a decrease of the Gauge

func (PrometheusGaugeAdapter) Dec

Dec decrements the Gauge with given labels by 1. Use Sub to decrement it by arbitrary values

func (PrometheusGaugeAdapter) Inc

Inc increments the Gauge with given labels by 1. Use Add to increment it by arbitrary values

func (PrometheusGaugeAdapter) Set

Set sets the Gauge to an arbitrary value with given labels

func (PrometheusGaugeAdapter) Sub

Sub subtracts the given value from the Gauge with provided labels The value can be negative, resulting in an increase of the Gauge

type PrometheusHistogramAdapter

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

PrometheusHistogramAdapter implements HistogramVectorAdapter.

func (PrometheusHistogramAdapter) Observe

Observe increments the Histogram with given labels by 1

type PrometheusMetricsRecorderAdapter

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

PrometheusMetricsRecorderAdapter implements MetricsRecorderAdapter.

func ProvidePrometheusMetricsRecorderAdapter

func ProvidePrometheusMetricsRecorderAdapter(options PrometheusMetricsRecorderAdapterOptions) (*PrometheusMetricsRecorderAdapter, error)

ProvidePrometheusMetricsRecorderAdapter creates a PrometheusMetricsRecorderAdapter with the given PrometheusMetricsRecorderAdapterOptions

func (PrometheusMetricsRecorderAdapter) NewCounterVector

NewCounterVector creates a CounterVectorAdapter with the given NewCounterVectorAdapterOptions

func (PrometheusMetricsRecorderAdapter) NewGauge

NewGauge creates a GaugeVectorAdapter with the given NewGaugeAdapterOptions

func (PrometheusMetricsRecorderAdapter) NewHistogramVector

NewHistogramVector creates a HistogramVectorAdapter with the given NewHistogramAdapterOptions

func (PrometheusMetricsRecorderAdapter) NewSummary

NewSummary creates a SummaryVectorAdapter with the given NewSummaryAdapterOptions

type PrometheusMetricsRecorderAdapterOptions

type PrometheusMetricsRecorderAdapterOptions struct {
	Namespace *PrometheusNamespace
}

PrometheusMetricsRecorderAdapterOptions options to create a new PrometheusMetricsRecorderAdapter.

type PrometheusNamespace

type PrometheusNamespace string

PrometheusNamespace namespace to use in Prometheus for the Signare.

type PrometheusSummaryAdapter

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

PrometheusSummaryAdapter implements SummaryVectorAdapter.

func (PrometheusSummaryAdapter) Observe

Observe increments the Summary with given labels by 1

type PrometheusTestServer

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

PrometheusTestServer Prometheus server to use for testing.

func NewPrometheusTestServer

func NewPrometheusTestServer() *PrometheusTestServer

NewPrometheusTestServer creates a new PrometheusTestServer.

func (PrometheusTestServer) GetCounterVectorMetricValue

func (prometheusServer PrometheusTestServer) GetCounterVectorMetricValue(prometheusAdapter metricrecorder.CounterVectorAdapter, labels map[string]string) (string, error)

func (PrometheusTestServer) GetGaugeMetricValue

func (prometheusServer PrometheusTestServer) GetGaugeMetricValue(prometheusAdapter metricrecorder.GaugeVectorAdapter, labels map[string]string) (string, error)

func (PrometheusTestServer) GetHistogramVectorMetricValue

func (prometheusServer PrometheusTestServer) GetHistogramVectorMetricValue(prometheusAdapter metricrecorder.HistogramVectorAdapter, labels map[string]string) (*HistogramVecMetricValues, error)

func (PrometheusTestServer) GetHistogramVectorMetricValueFor

func (prometheusServer PrometheusTestServer) GetHistogramVectorMetricValueFor(namespace string, metricName string, labels map[string]string) (*HistogramVecMetricValues, error)

func (PrometheusTestServer) GetSummaryMetricValue

func (prometheusServer PrometheusTestServer) GetSummaryMetricValue(prometheusAdapter metricrecorder.SummaryVectorAdapter, labels map[string]string) (*SummaryMetricValues, error)

func (*PrometheusTestServer) Init

func (prometheusServer *PrometheusTestServer) Init()

func (*PrometheusTestServer) Reset

func (prometheusServer *PrometheusTestServer) Reset()

func (*PrometheusTestServer) Stop

func (prometheusServer *PrometheusTestServer) Stop()

type SummaryMetricValues

type SummaryMetricValues struct {
	Sum   string
	Count string
}

type TestMetricsRecorderAdapter

type TestMetricsRecorderAdapter struct {
	PrometheusMetricsRecorderAdapter
}

TestMetricsRecorderAdapter implements MetricsRecorderAdapter.

func NewTestMetricsRecorderAdapter

func NewTestMetricsRecorderAdapter() (*TestMetricsRecorderAdapter, error)

NewTestMetricsRecorderAdapter creates a new TestMetricsRecorderAdapter insatnce.

Jump to

Keyboard shortcuts

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