mirror of
https://github.com/netinvent/npbackup.git
synced 2025-09-11 23:45:29 +08:00
Merge oper and state metrics
This commit is contained in:
parent
d891d90876
commit
f5dba6409b
1 changed files with 1 additions and 5 deletions
|
@ -116,12 +116,8 @@ def metric_writer(
|
|||
_labels.append(f'{key.strip()}="{value.strip()}"')
|
||||
labels = ",".join(_labels)
|
||||
|
||||
if operation != "backup":
|
||||
metrics.append(
|
||||
f'npbackup_oper_state{{{labels},action="{operation}",repo="{repo_name}"}} {0 if restic_result else 1}'
|
||||
)
|
||||
metrics.append(
|
||||
f'npbackup_exec_state{{{labels},action="{operation}"}} {exec_state}'
|
||||
f'npbackup_exec_state{{{labels},action="{operation},repo_name="{repo_name}",timestamp="{int(datetime.now(timezone.utc).timestamp())}"}} {exec_state}'
|
||||
)
|
||||
logger.debug("Metrics computed:\n{}".format("\n".join(metrics)))
|
||||
if destination:
|
||||
|
|
Loading…
Add table
Reference in a new issue