Ingester deals with "in flight" chunks. Based on Prometheus 1.x MemorySeriesStorage.
| 289 | // Ingester deals with "in flight" chunks. Based on Prometheus 1.x |
| 290 | // MemorySeriesStorage. |
| 291 | type Ingester struct { |
| 292 | *services.BasicService |
| 293 | |
| 294 | cfg Config |
| 295 | |
| 296 | metrics *ingesterMetrics |
| 297 | validateMetrics *validation.ValidateMetrics |
| 298 | |
| 299 | logger log.Logger |
| 300 | |
| 301 | lifecycler *ring.Lifecycler |
| 302 | limits *validation.Overrides |
| 303 | limiter *Limiter |
| 304 | resourceBasedLimiter *limiter.ResourceBasedLimiter |
| 305 | subservicesWatcher *services.FailureWatcher |
| 306 | |
| 307 | stoppedMtx sync.RWMutex // protects stopped |
| 308 | stopped bool // protected by stoppedMtx |
| 309 | |
| 310 | // For storing metadata ingested. |
| 311 | usersMetadataMtx sync.RWMutex |
| 312 | usersMetadata map[string]*userMetricsMetadata |
| 313 | |
| 314 | // Prometheus block storage |
| 315 | TSDBState TSDBState |
| 316 | |
| 317 | // Rate of pushed samples. Only used by V2-ingester to limit global samples push rate. |
| 318 | ingestionRate *util_math.EwmaRate |
| 319 | inflightPushRequests atomic.Int64 |
| 320 | maxInflightPushRequests util_math.MaxTracker |
| 321 | |
| 322 | inflightQueryRequests atomic.Int64 |
| 323 | maxInflightQueryRequests util_math.MaxTracker |
| 324 | |
| 325 | matchersCache storecache.MatchersCache |
| 326 | expandedPostingsCacheFactory *cortex_tsdb.ExpandedPostingsCacheFactory |
| 327 | |
| 328 | activeQueriedSeriesService *ActiveQueriedSeriesService |
| 329 | } |
| 330 | |
| 331 | // Shipper interface is used to have an easy way to mock it in tests. |
| 332 | type Shipper interface { |
nothing calls this directly
no outgoing calls
no test coverage detected