|
25 | 25 |
|
26 | 26 | log = logging.getLogger(__name__)
|
27 | 27 |
|
28 |
| -INGEST_SUCCEEDED = Counter( |
29 |
| - "ingest_succeeded_total", |
| 28 | +INGESTIONS_SUCCEEDED = Counter( |
| 29 | + "ingestfile_ingestions_succeeded_total", |
30 | 30 | "Successful ingestions",
|
31 | 31 | ["ingestor"],
|
32 | 32 | )
|
33 |
| -INGEST_FAILED = Counter( |
34 |
| - "ingest_failed_total", |
| 33 | +INGESTIONS_FAILED = Counter( |
| 34 | + "ingestfile_ingestions_failed_total", |
35 | 35 | "Failed ingestions",
|
36 | 36 | ["ingestor"],
|
37 | 37 | )
|
38 |
| -INGEST_DURATION = Histogram( |
39 |
| - "ingest_duration_seconds", |
| 38 | +INGESTION_DURATION = Histogram( |
| 39 | + "ingestfile_ingestion_duration_seconds", |
40 | 40 | "Ingest duration by ingestor",
|
41 | 41 | ["ingestor"],
|
42 | 42 | # The bucket sizes are a rough guess right now, we might want to adjust
|
43 | 43 | # them later based on observed durations
|
44 | 44 | buckets=[
|
45 |
| - 0.005 |
| 45 | + 0.005, |
46 | 46 | 0.01,
|
47 | 47 | 0.025,
|
48 | 48 | 0.05,
|
|
57 | 57 | 15 * 60,
|
58 | 58 | ],
|
59 | 59 | )
|
60 |
| -INGEST_INGESTED_BYTES = Counter( |
61 |
| - "ingest_ingested_bytes_total", |
| 60 | +INGESTED_BYTES = Counter( |
| 61 | + "ingestfile_ingested_bytes_total", |
62 | 62 | "Total number of bytes ingested",
|
63 | 63 | ["ingestor"],
|
64 | 64 | )
|
@@ -205,20 +205,20 @@ def ingest(self, file_path, entity, **kwargs):
|
205 | 205 | self.delegate(ingestor_class, file_path, entity)
|
206 | 206 | duration = max(0, default_timer() - start_time)
|
207 | 207 |
|
208 |
| - INGEST_SUCCEEDED.labels(ingestor_name).inc() |
209 |
| - INGEST_DURATION.labels(ingestor_name).observe(duration) |
| 208 | + INGESTIONS_SUCCEEDED.labels(ingestor_name).inc() |
| 209 | + INGESTION_DURATION.labels(ingestor_name).observe(duration) |
210 | 210 |
|
211 | 211 | if file_size is not None:
|
212 |
| - INGEST_INGESTED_BYTES.labels(ingestor_name).inc(file_size) |
| 212 | + INGESTED_BYTES.labels(ingestor_name).inc(file_size) |
213 | 213 |
|
214 | 214 | entity.set("processingStatus", self.STATUS_SUCCESS)
|
215 | 215 | except ProcessingException as pexc:
|
216 | 216 | log.exception("[%r] Failed to process: %s", entity, pexc)
|
217 | 217 |
|
218 | 218 | if ingestor_name:
|
219 |
| - INGEST_FAILED.labels(ingestor_name).inc() |
| 219 | + INGESTIONS_FAILED.labels(ingestor_name).inc() |
220 | 220 | else:
|
221 |
| - INGEST_FAILED.labels(None).inc() |
| 221 | + INGESTIONS_FAILED.labels(None).inc() |
222 | 222 |
|
223 | 223 | entity.set("processingError", stringify(pexc))
|
224 | 224 | capture_exception(pexc)
|
|
0 commit comments