Documentation ¶
Overview ¶
Package metricsout defines the implementation of the output adapter of the Prometheus metrics.
Index ¶
- Constants
- func RenderPrometheusMetricDescriptor(namespace string, metricName string, labels map[string]string) (string, error)
- type HistogramVecMetricValues
- type PrometheusCounterVectorAdapter
- type PrometheusGaugeAdapter
- func (p PrometheusGaugeAdapter) Add(options metricrecorder.GaugeVectorArbitraryValueOptions)
- func (p PrometheusGaugeAdapter) Dec(options metricrecorder.GaugeVectorOptions)
- func (p PrometheusGaugeAdapter) Inc(options metricrecorder.GaugeVectorOptions)
- func (p PrometheusGaugeAdapter) Set(options metricrecorder.GaugeVectorArbitraryValueOptions)
- func (p PrometheusGaugeAdapter) Sub(options metricrecorder.GaugeVectorArbitraryValueOptions)
- type PrometheusHistogramAdapter
- type PrometheusMetricsRecorderAdapter
- func (p PrometheusMetricsRecorderAdapter) NewCounterVector(options metricrecorder.NewCounterVectorAdapterOptions) (metricrecorder.CounterVectorAdapter, error)
- func (p PrometheusMetricsRecorderAdapter) NewGauge(options metricrecorder.NewGaugeAdapterOptions) (metricrecorder.GaugeVectorAdapter, error)
- func (p PrometheusMetricsRecorderAdapter) NewHistogramVector(options metricrecorder.NewHistogramAdapterOptions) (metricrecorder.HistogramVectorAdapter, error)
- func (p PrometheusMetricsRecorderAdapter) NewSummary(options metricrecorder.NewSummaryAdapterOptions) (metricrecorder.SummaryVectorAdapter, error)
- type PrometheusMetricsRecorderAdapterOptions
- type PrometheusNamespace
- type PrometheusSummaryAdapter
- type PrometheusTestServer
- func (prometheusServer PrometheusTestServer) GetCounterVectorMetricValue(prometheusAdapter metricrecorder.CounterVectorAdapter, ...) (string, error)
- func (prometheusServer PrometheusTestServer) GetGaugeMetricValue(prometheusAdapter metricrecorder.GaugeVectorAdapter, labels map[string]string) (string, error)
- func (prometheusServer PrometheusTestServer) GetHistogramVectorMetricValue(prometheusAdapter metricrecorder.HistogramVectorAdapter, ...) (*HistogramVecMetricValues, error)
- func (prometheusServer PrometheusTestServer) GetHistogramVectorMetricValueFor(namespace string, metricName string, labels map[string]string) (*HistogramVecMetricValues, error)
- func (prometheusServer PrometheusTestServer) GetSummaryMetricValue(prometheusAdapter metricrecorder.SummaryVectorAdapter, ...) (*SummaryMetricValues, error)
- func (prometheusServer *PrometheusTestServer) Init()
- func (prometheusServer *PrometheusTestServer) Reset()
- func (prometheusServer *PrometheusTestServer) Stop()
- type SummaryMetricValues
- type TestMetricsRecorderAdapter
Constants ¶
const DefaultTestMetricsNamespace = "test_metrics_ns"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type PrometheusCounterVectorAdapter ¶
type PrometheusCounterVectorAdapter struct {
// contains filtered or unexported fields
}
PrometheusCounterVectorAdapter implements CounterVectorAdapter.
func (PrometheusCounterVectorAdapter) Inc ¶
func (pc PrometheusCounterVectorAdapter) Inc(options metricrecorder.IncreaseCounterAdapterOptions)
Inc increases counter value
type PrometheusGaugeAdapter ¶
type PrometheusGaugeAdapter struct {
// contains filtered or unexported fields
}
PrometheusGaugeAdapter implements GaugeVectorAdapter.
func (PrometheusGaugeAdapter) Add ¶
func (p PrometheusGaugeAdapter) Add(options metricrecorder.GaugeVectorArbitraryValueOptions)
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 ¶
func (p PrometheusGaugeAdapter) Dec(options metricrecorder.GaugeVectorOptions)
Dec decrements the Gauge with given labels by 1. Use Sub to decrement it by arbitrary values
func (PrometheusGaugeAdapter) Inc ¶
func (p PrometheusGaugeAdapter) Inc(options metricrecorder.GaugeVectorOptions)
Inc increments the Gauge with given labels by 1. Use Add to increment it by arbitrary values
func (PrometheusGaugeAdapter) Set ¶
func (p PrometheusGaugeAdapter) Set(options metricrecorder.GaugeVectorArbitraryValueOptions)
Set sets the Gauge to an arbitrary value with given labels
func (PrometheusGaugeAdapter) Sub ¶
func (p PrometheusGaugeAdapter) Sub(options metricrecorder.GaugeVectorArbitraryValueOptions)
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 ¶
func (p PrometheusHistogramAdapter) Observe(options metricrecorder.ObserveHistogramVectorAdapterOptions)
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 ¶
func (p PrometheusMetricsRecorderAdapter) NewCounterVector(options metricrecorder.NewCounterVectorAdapterOptions) (metricrecorder.CounterVectorAdapter, error)
NewCounterVector creates a CounterVectorAdapter with the given NewCounterVectorAdapterOptions
func (PrometheusMetricsRecorderAdapter) NewGauge ¶
func (p PrometheusMetricsRecorderAdapter) NewGauge(options metricrecorder.NewGaugeAdapterOptions) (metricrecorder.GaugeVectorAdapter, error)
NewGauge creates a GaugeVectorAdapter with the given NewGaugeAdapterOptions
func (PrometheusMetricsRecorderAdapter) NewHistogramVector ¶
func (p PrometheusMetricsRecorderAdapter) NewHistogramVector(options metricrecorder.NewHistogramAdapterOptions) (metricrecorder.HistogramVectorAdapter, error)
NewHistogramVector creates a HistogramVectorAdapter with the given NewHistogramAdapterOptions
func (PrometheusMetricsRecorderAdapter) NewSummary ¶
func (p PrometheusMetricsRecorderAdapter) NewSummary(options metricrecorder.NewSummaryAdapterOptions) (metricrecorder.SummaryVectorAdapter, error)
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 ¶
func (pc PrometheusSummaryAdapter) Observe(options metricrecorder.ObserveSummaryAdapterOptions)
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 TestMetricsRecorderAdapter ¶
type TestMetricsRecorderAdapter struct {
PrometheusMetricsRecorderAdapter
}
TestMetricsRecorderAdapter implements MetricsRecorderAdapter.
func NewTestMetricsRecorderAdapter ¶
func NewTestMetricsRecorderAdapter() (*TestMetricsRecorderAdapter, error)
NewTestMetricsRecorderAdapter creates a new TestMetricsRecorderAdapter insatnce.