rename prometheus metric name to include service name
This commit is contained in:
parent
932a3e314b
commit
671129af3e
19
config.yaml
19
config.yaml
@ -1,6 +1,6 @@
|
||||
service:
|
||||
logging_level: $LOGGING_LEVEL_ROOT|DEBUG # Logging level for service logger
|
||||
prometheus_metric_name: $PROMETHEUS_METRIC_NAME|operation # Default operation prometheus metric name
|
||||
name: $SERVICE_NAME|research # Default service name for research service, used for prometheus metric name
|
||||
# target_file_extension: $TARGET_FILE_EXTENSION|"json.gz" # Extension for files to download from storage and process
|
||||
|
||||
# TODO: will become obsolete by below changes
|
||||
@ -14,6 +14,23 @@ service:
|
||||
input:
|
||||
subdir: ""
|
||||
extension: ORIGIN.pdf.gz
|
||||
output: # FIXME
|
||||
subdir: "conversion_new" # FIXME: currently operation string is sued for output dir
|
||||
extension: json.gz
|
||||
extraction:
|
||||
input:
|
||||
subdir: ""
|
||||
extension: ORIGIN.pdf.gz
|
||||
output: # FIXME
|
||||
subdir: "extraction_new" # FIXME: currently operation string is sued for output dir
|
||||
extension: json.gz
|
||||
table_parsing:
|
||||
input:
|
||||
subdir: "conversion_new"
|
||||
extension: json.gz
|
||||
output: # FIXME
|
||||
subdir: "table_new" # FIXME: currently operation string is sued for output dir
|
||||
extension: json.gz
|
||||
default:
|
||||
input:
|
||||
subdir: ""
|
||||
|
||||
@ -59,8 +59,9 @@ def __set_up_processing_server(operation2function: Dict[str, QueuedStreamFunctio
|
||||
}
|
||||
|
||||
def make_summary_instance(op: str):
|
||||
op = op.replace("_pickup", "") if op != "pickup" else CONFIG.service.prometheus_metric_name
|
||||
return Summary(f"redactmanager_{op}_seconds", f"Time spent on {op}.", registry=registry)
|
||||
op = op.replace("_pickup", "") if op != "pickup" else "default"
|
||||
service_name = CONFIG.service.name
|
||||
return Summary(f"redactmanager_{service_name}_{op}_seconds", f"Time spent on {op}.", registry=registry)
|
||||
|
||||
submit_operation2processor = {submit_suffix(op): prc for op, prc in operation2processor.items()}
|
||||
pickup_operation2processor = {pickup_suffix(op): prc for op, prc in operation2processor.items()}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user