Documentation ¶
Index ¶
- Variables
- type MetricBuilder
- func (m *MetricBuilder) GetLabels(ev *formatters.EventMsg) []prompb.Label
- func (m *MetricBuilder) MetricName(measName, valueName string) string
- func (mb *MetricBuilder) MetricsFromEvent(ev *formatters.EventMsg, now time.Time) []*PromMetric
- func (m *MetricBuilder) TimeSeriesFromEvent(ev *formatters.EventMsg) []*NamedTimeSeries
- type NamedTimeSeries
- type PromMetric
Constants ¶
This section is empty.
Variables ¶
View Source
var (
MetricNameRegex = regexp.MustCompile(metricNameRegex)
)
Functions ¶
This section is empty.
Types ¶
type MetricBuilder ¶
type MetricBuilder struct { Prefix string AppendSubscriptionName bool StringsAsLabels bool OverrideTimestamps bool ExportTimestamps bool }
func (*MetricBuilder) GetLabels ¶
func (m *MetricBuilder) GetLabels(ev *formatters.EventMsg) []prompb.Label
func (*MetricBuilder) MetricName ¶
func (m *MetricBuilder) MetricName(measName, valueName string) string
MetricName generates the prometheus metric name based on the output plugin, the measurement name and the value name. it makes sure the name matches the regex "[^a-zA-Z0-9_]+"
func (*MetricBuilder) MetricsFromEvent ¶ added in v0.37.0
func (mb *MetricBuilder) MetricsFromEvent(ev *formatters.EventMsg, now time.Time) []*PromMetric
func (*MetricBuilder) TimeSeriesFromEvent ¶
func (m *MetricBuilder) TimeSeriesFromEvent(ev *formatters.EventMsg) []*NamedTimeSeries
type NamedTimeSeries ¶
type NamedTimeSeries struct { Name string TS *prompb.TimeSeries }
type PromMetric ¶ added in v0.37.0
type PromMetric struct { Name string Time *time.Time // AddedAt is used to expire metrics if the time field is not initialized // this happens when ExportTimestamp == false AddedAt time.Time // contains filtered or unexported fields }
func (*PromMetric) CalculateKey ¶ added in v0.37.0
func (p *PromMetric) CalculateKey() uint64
Metric
func (*PromMetric) Desc ¶ added in v0.37.0
func (p *PromMetric) Desc() *prometheus.Desc
Desc implements prometheus.Metric
func (*PromMetric) String ¶ added in v0.37.0
func (p *PromMetric) String() string
Click to show internal directories.
Click to hide internal directories.