22
22
# Initialize logger for this module
23
23
logger = get_logger (__name__ )
24
24
25
- _cache_lookup_counter = Counter ("gitingest_cache_lookup " , "Number of cache lookups" , [ "url" ] )
26
- _cache_hit_counter = Counter ("gitingest_cache_hit " , "Number of cache hits" , [ "url" ] )
27
- _cache_miss_counter = Counter ("gitingest_cache_miss " , "Number of cache misses" , [ "url" ] )
25
+ _s3_ingest_lookup_counter = Counter ("gitingest_s3_ingest_lookup " , "Number of S3 ingest file lookups" )
26
+ _s3_ingest_hit_counter = Counter ("gitingest_s3_ingest_hit " , "Number of S3 ingest file cache hits" )
27
+ _s3_ingest_miss_counter = Counter ("gitingest_s3_ingest_miss " , "Number of S3 ingest file cache misses" )
28
28
29
29
30
30
class S3UploadError (Exception ):
@@ -432,7 +432,7 @@ def check_s3_object_exists(s3_file_path: str) -> bool:
432
432
return False
433
433
434
434
logger .info ("Checking S3 object existence" , extra = {"s3_file_path" : s3_file_path })
435
- _cache_lookup_counter . labels ( url = s3_file_path ) .inc ()
435
+ _s3_ingest_lookup_counter .inc ()
436
436
try :
437
437
s3_client = create_s3_client ()
438
438
bucket_name = get_s3_bucket_name ()
@@ -451,7 +451,7 @@ def check_s3_object_exists(s3_file_path: str) -> bool:
451
451
"error_code" : error_code ,
452
452
},
453
453
)
454
- _cache_miss_counter . labels ( url = s3_file_path ) .inc ()
454
+ _s3_ingest_miss_counter .inc ()
455
455
return False
456
456
# Re-raise other errors (permissions, etc.)
457
457
raise
@@ -465,7 +465,7 @@ def check_s3_object_exists(s3_file_path: str) -> bool:
465
465
"exception" : str (exc ),
466
466
},
467
467
)
468
- _cache_miss_counter . labels ( url = s3_file_path ) .inc ()
468
+ _s3_ingest_miss_counter .inc ()
469
469
return False
470
470
else :
471
471
logger .info (
@@ -475,7 +475,7 @@ def check_s3_object_exists(s3_file_path: str) -> bool:
475
475
"bucket_name" : get_s3_bucket_name (),
476
476
},
477
477
)
478
- _cache_hit_counter . labels ( url = s3_file_path ) .inc ()
478
+ _s3_ingest_hit_counter .inc ()
479
479
return True
480
480
481
481
0 commit comments