From 005654acfd0181a24d0a98d88dafd6c0b8dbd989 Mon Sep 17 00:00:00 2001 From: Luca Bello Date: Wed, 22 Nov 2023 14:00:20 +0100 Subject: [PATCH 1/2] add config option for metrics.global.scrape_timeout --- config.yaml | 4 ++++ src/grafana_agent.py | 3 +++ 2 files changed, 7 insertions(+) diff --git a/config.yaml b/config.yaml index 7a9f482..271cdc6 100644 --- a/config.yaml +++ b/config.yaml @@ -10,3 +10,7 @@ options: Loki). type: boolean default: false + scrape_timeout: + description: The global metrics scrape timeout. + type: string + default: "10s" diff --git a/src/grafana_agent.py b/src/grafana_agent.py index 8ea449e..6083b77 100644 --- a/src/grafana_agent.py +++ b/src/grafana_agent.py @@ -650,6 +650,9 @@ def _generate_config(self) -> Dict[str, Any]: "integrations": self._integrations_config, "metrics": { "wal_directory": "/tmp/agent/data", + "global": { + "scrape_timeout": self.model.config.get("global_scrape_timeout"), + }, "configs": [ { "name": "agent_scraper", From fe00923ddd6189fbb14dceddfa52bb0d1770a41a Mon Sep 17 00:00:00 2001 From: Luca Bello <36242061+lucabello@users.noreply.github.com> Date: Thu, 23 Nov 2023 08:53:09 +0100 Subject: [PATCH 2/2] Update config.yaml Co-authored-by: Leon <82407168+sed-i@users.noreply.github.com> --- config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config.yaml b/config.yaml index 271cdc6..06f157e 100644 --- a/config.yaml +++ b/config.yaml @@ -10,7 +10,7 @@ options: Loki). type: boolean default: false - scrape_timeout: - description: The global metrics scrape timeout. - type: string - default: "10s" + scrape-timeout-sec: + description: The global metrics scrape timeout (seconds). + type: int + default: 10