From 44ecd2d49c0549494538822f9d54d97d349485bc Mon Sep 17 00:00:00 2001 From: yo Date: Mon, 13 Jan 2025 20:16:06 +0100 Subject: [PATCH] Update README, set timeout as default 10 in configuration sample --- README.md | 6 ++++++ config.sample.yaml | 13 +++---------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index fed9076..79b6488 100644 --- a/README.md +++ b/README.md @@ -40,3 +40,9 @@ Sending POST on /reload : curl -XPOST http://my-nodegopher-host:8080/reload {"message":"configuration successfully reloaded"} ``` + +Reloading a badly formated configuration will produce an error and keep the old configuration running. +``` +% curl -XPOST 127.1:8080/reload +{"error":"Unable to load new configuration, keeping old one. See logs."} +``` diff --git a/config.sample.yaml b/config.sample.yaml index daa597b..788f889 100644 --- a/config.sample.yaml +++ b/config.sample.yaml @@ -1,4 +1,4 @@ -# Formatting metrics in main & secondarystat. Supported: "english", "french", "german", "ukrainian", "chinese", "arabic" +# Formatting metrics in main & secondarystat. Supported: "english", "french", "german", "ukrainian", "chinese", "arabic". Default is english. language: 'english' # datasource describe a way to get prometheus metrics. @@ -7,51 +7,44 @@ language: 'english' # - address: the address of prometheus. # - query: prometheus query. Same as typed in prometheus graph page. # - type: type of query. "query" will get instant value, "query_range" will get all samples for the grafana period. Result will be averaged. -# - timeout: query timeout in seconds. +# - timeout: query timeout in seconds. default is 10. datasources: - name: prom_samples_per_sec type: query address: 'http://prometheus.local.lan:9090' query: 'rate(prometheus_tsdb_head_samples_appended_total{type="float"}[10m])' - timeout: 10 + timeout: 15 - name: node_cpu_metric # Simple query, return an instant metric type: query address: 'http://prometheus.local.lan:9090' query: 'sum(rate(node_cpu_seconds_total{instance="router01.local.lan:9100",job="node",mode!~"idle"}[30s]))*100' - timeout: 10 - name: node_cpu_metric_over_80 type: query address: 'http://prometheus.local.lan:9090' # Return 1 if cpu rate > 80% query: '(sum(rate(node_cpu_seconds_total{instance="router01.local.lan:9100",job="node",mode!~"idle"}[30s]))*100) > bool 80' - timeout: 10 - name: router01_net_down_rate # Range query. Return all metrics from a time range. Result will be averaged from these metrics. Time range will be provided by Grafana. type: query_range address: 'http://prometheus.local.lan:9090' query: 'rate(node_network_receive_bytes_total{device="igb0", instance="router01.local.lan:9100", job="node"}[30s])' - timeout: 10 - name: router01_net_up_rate type: query_range address: 'http://prometheus.local.lan:9090' query: 'rate(node_network_transmit_bytes_total{device="igb0", instance="router01.local.lan:9100", job="node"}[30s])' - timeout: 10 - name: router01_lan_down_rate type: query_range address: 'http://prometheus.local.lan:9090' query: 'rate(node_network_receive_bytes_total{device="ix3", instance="router01.local.lan:9100", job="node"}[30s])' - timeout: 10 - name: router01_lan_up_rate type: query_range address: 'http://prometheus.local.lan:9090' query: 'rate(node_network_transmit_bytes_total{device="ix3", instance="router01.local.lan:9100", job="node"}[30s])' - timeout: 10 - name: router01_net_down_rate_perten type: query address: 'http://prometheus.local.lan:9090' query: 'rate(node_network_receive_bytes_total{device="igb0", instance="router01.local.lan:9100", job="node"}[30s])/62500000*10' - timeout: 10 # graphs identifies context for a nodegraph. You can have many contexts, and your grafana query will mention this context name. # For this example named "internet", grafana URL will be :