From 2572afac22e5364be0d8192ea7786d69295b5c71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= <40151420+ldericher@users.noreply.github.com> Date: Sat, 2 Sep 2023 16:30:54 +0000 Subject: [PATCH] "result" param for webhooks --- README.md | 6 +++--- kiwi_simple_metrics/metrics/_report.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index be7747b..4199891 100644 --- a/README.md +++ b/README.md @@ -28,13 +28,13 @@ metrics: image: yavook/kiwi-simple-metrics:0.1 environment: METRICS__LOG__ENABLED: "True" - METRICS__WEBHOOK__URL: "https://my.webhook.host/success?report={}" - METRICS__WEBHOOK__FAIL: "https://my.webhook.host/failure?report={}" + METRICS__WEBHOOK__URL: "https://my.webhook.host/success?report={result}" + METRICS__WEBHOOK__FAIL: "https://my.webhook.host/failure?report={result}" ``` - same metrics as above - logs reports to stdout -- triggers webhooks (`{}` is the placeholder for the result string) +- triggers webhooks (`{result}` is the placeholder for the result string) ## Configuration diff --git a/kiwi_simple_metrics/metrics/_report.py b/kiwi_simple_metrics/metrics/_report.py index 5cf4044..5d8bac4 100644 --- a/kiwi_simple_metrics/metrics/_report.py +++ b/kiwi_simple_metrics/metrics/_report.py @@ -126,7 +126,7 @@ class Report: requests.get( url=str(url).format( - urllib.parse.quote_plus(self.result) + result=urllib.parse.quote_plus(self.result) ), verify=not SETTINGS.webhook.insecure, )