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

Function newIngesterMetrics

pkg/ingester/metrics.go:84–359  ·  view source on GitHub ↗
(r prometheus.Registerer,
	createMetricsConflictingWithTSDB bool,
	activeSeriesEnabled bool,
	activeQueriedSeriesEnabled bool,
	instanceLimitsFn func() *InstanceLimits,
	ingestionRate *util_math.EwmaRate,
	inflightPushRequests *util_math.MaxTracker,
	maxInflightQueryRequests *util_math.MaxTracker,
	postingsCacheEnabled bool,
	regexMatcherLimitsEnabled bool,
)

Source from the content-addressed store, hash-verified

82}
83
84func newIngesterMetrics(r prometheus.Registerer,
85 createMetricsConflictingWithTSDB bool,
86 activeSeriesEnabled bool,
87 activeQueriedSeriesEnabled bool,
88 instanceLimitsFn func() *InstanceLimits,
89 ingestionRate *util_math.EwmaRate,
90 inflightPushRequests *util_math.MaxTracker,
91 maxInflightQueryRequests *util_math.MaxTracker,
92 postingsCacheEnabled bool,
93 regexMatcherLimitsEnabled bool,
94) *ingesterMetrics {
95 const (
96 instanceLimits = "cortex_ingester_instance_limits"
97 instanceLimitsHelp = "Instance limits used by this ingester." // Must be same for all registrations.
98 limitLabel = "limit"
99 )
100
101 m := &ingesterMetrics{
102 ingestedSamples: promauto.With(r).NewCounter(prometheus.CounterOpts{
103 Name: "cortex_ingester_ingested_samples_total",
104 Help: "The total number of samples ingested.",
105 }),
106 ingestedHistograms: promauto.With(r).NewCounter(prometheus.CounterOpts{
107 Name: "cortex_ingester_ingested_native_histograms_total",
108 Help: "The total number of native histograms ingested.",
109 }),
110 ingestedExemplars: promauto.With(r).NewCounter(prometheus.CounterOpts{
111 Name: "cortex_ingester_ingested_exemplars_total",
112 Help: "The total number of exemplars ingested.",
113 }),
114 ingestedMetadata: promauto.With(r).NewCounter(prometheus.CounterOpts{
115 Name: "cortex_ingester_ingested_metadata_total",
116 Help: "The total number of metadata ingested.",
117 }),
118 ingestedSamplesFail: promauto.With(r).NewCounter(prometheus.CounterOpts{
119 Name: "cortex_ingester_ingested_samples_failures_total",
120 Help: "The total number of samples that errored on ingestion.",
121 }),
122 ingestedHistogramsFail: promauto.With(r).NewCounter(prometheus.CounterOpts{
123 Name: "cortex_ingester_ingested_native_histograms_failures_total",
124 Help: "The total number of native histograms that errored on ingestion.",
125 }),
126 ingestedExemplarsFail: promauto.With(r).NewCounter(prometheus.CounterOpts{
127 Name: "cortex_ingester_ingested_exemplars_failures_total",
128 Help: "The total number of exemplars that errored on ingestion.",
129 }),
130 ingestedMetadataFail: promauto.With(r).NewCounter(prometheus.CounterOpts{
131 Name: "cortex_ingester_ingested_metadata_failures_total",
132 Help: "The total number of metadata that errored on ingestion.",
133 }),
134 ingestedHistogramBuckets: promauto.With(r).NewHistogramVec(prometheus.HistogramOpts{
135 Name: "cortex_ingester_ingested_histogram_buckets",
136 Help: "The number of ingested native histogram buckets per user.",
137 NativeHistogramBucketFactor: 1.1,
138 NativeHistogramMaxBucketNumber: 100,
139 NativeHistogramMinResetDuration: 1,
140 Buckets: prometheus.ExponentialBuckets(1, 2, 10), // 1 to 512 buckets
141 }, []string{"user"}),

Callers 6

Test_UserMetricsMetadataFunction · 0.85
TestIngesterMetricsFunction · 0.85
NewFunction · 0.85
NewForFlusherFunction · 0.85

Calls 3

NewPostingCacheMetricsFunction · 0.92
RateMethod · 0.80
LoadMethod · 0.80