MCPcopy Create free account
hub / github.com/cortexproject/cortex / NewValidateMetrics

Function NewValidateMetrics

pkg/util/validation/validate.go:106–189  ·  view source on GitHub ↗
(r prometheus.Registerer)

Source from the content-addressed store, hash-verified

104}
105
106func NewValidateMetrics(r prometheus.Registerer) *ValidateMetrics {
107 discardedSamples := prometheus.NewCounterVec(
108 prometheus.CounterOpts{
109 Name: "cortex_discarded_samples_total",
110 Help: "The total number of samples that were discarded.",
111 },
112 []string{discardReasonLabel, "user"},
113 )
114 registerCollector(r, discardedSamples)
115 discardedSamplesPerLabelSet := prometheus.NewCounterVec(
116 prometheus.CounterOpts{
117 Name: "cortex_discarded_samples_per_labelset_total",
118 Help: "The total number of samples that were discarded for each labelset.",
119 },
120 []string{discardReasonLabel, "user", "labelset"},
121 )
122 registerCollector(r, discardedSamplesPerLabelSet)
123 discardedExemplars := prometheus.NewCounterVec(
124 prometheus.CounterOpts{
125 Name: "cortex_discarded_exemplars_total",
126 Help: "The total number of exemplars that were discarded.",
127 },
128 []string{discardReasonLabel, "user"},
129 )
130 registerCollector(r, discardedExemplars)
131 discardedMetadata := prometheus.NewCounterVec(
132 prometheus.CounterOpts{
133 Name: "cortex_discarded_metadata_total",
134 Help: "The total number of metadata that were discarded.",
135 },
136 []string{discardReasonLabel, "user"},
137 )
138 registerCollector(r, discardedMetadata)
139 histogramSamplesReducedResolution := prometheus.NewCounterVec(
140 prometheus.CounterOpts{
141 Name: "cortex_reduced_resolution_histogram_samples_total",
142 Help: "The total number of histogram samples that had the resolution reduced.",
143 },
144 []string{"user"},
145 )
146 registerCollector(r, histogramSamplesReducedResolution)
147 labelSizeBytes := prometheus.NewHistogramVec(prometheus.HistogramOpts{
148 Name: "cortex_label_size_bytes",
149 Help: "The combined size in bytes of all labels and label values for a time series.",
150 NativeHistogramBucketFactor: 1.1,
151 NativeHistogramMaxBucketNumber: 100,
152 NativeHistogramMinResetDuration: 1 * time.Hour,
153 }, []string{"user"})
154 registerCollector(r, labelSizeBytes)
155 discardedSeries := prometheus.NewGaugeVec(
156 prometheus.GaugeOpts{
157 Name: "cortex_discarded_series",
158 Help: "The number of series that include discarded samples.",
159 },
160 []string{discardReasonLabel, "user"},
161 )
162 registerCollector(r, discardedSeries)
163 discardedSeriesPerLabelset := prometheus.NewGaugeVec(

Callers 12

NewFunction · 0.92
Test_UserMetricsMetadataFunction · 0.92
NewFunction · 0.92
TestValidateLabels_UTF8Function · 0.85
TestValidateLabelsFunction · 0.85
TestValidateExemplarsFunction · 0.85
TestValidateMetadataFunction · 0.85
TestValidateLabelOrderFunction · 0.85