From 0a59be7136db02098b4c085350461fec8810b979 Mon Sep 17 00:00:00 2001 From: Bas van Dijk Date: Sun, 28 Jul 2019 12:07:52 +0200 Subject: thanos: 0.5.0 -> 0.6.0 --- nixos/modules/services/monitoring/thanos.nix | 54 ++++++++++++++++++---------- 1 file changed, 35 insertions(+), 19 deletions(-) (limited to 'nixos/modules/services') diff --git a/nixos/modules/services/monitoring/thanos.nix b/nixos/modules/services/monitoring/thanos.nix index 93e858c6607b..b41e99b76477 100644 --- a/nixos/modules/services/monitoring/thanos.nix +++ b/nixos/modules/services/monitoring/thanos.nix @@ -113,23 +113,39 @@ let ''; }; - gcloudtrace = { - - gcloudtrace.project = mkParam types.str '' - GCP project to send Google Cloud Trace tracings to. + tracing = cfg: { + tracing.config-file = { + toArgs = _opt: path: optionToArgs "tracing.config-file" path; + option = mkOption { + type = with types; nullOr str; + default = if cfg.tracing.config == null then null + else toString (toYAML "tracing.yaml" cfg.tracing.config); + defaultText = '' + if config.services.thanos..tracing.config == null then null + else toString (toYAML "tracing.yaml" config.services.thanos..tracing.config); + ''; + description = '' + Path to YAML file that contains tracing configuration. + ''; + }; + }; - If null, tracing will be disabled. - ''; + tracing.config = + { + toArgs = _opt: _attrs: []; + option = nullOpt types.attrs '' + Tracing configuration. - gcloudtrace.sample-factor = mkParamDef types.int 1 '' - How often we send traces 1/<sample-factor>. + When not null the attribute set gets converted to + a YAML file and stored in the Nix store. The option + will default to its path. - If 0 no trace will be sent periodically, unless - forced by baggage item. - ''; + If is set this option has no effect. + ''; + }; }; - common = params.log // params.gcloudtrace // { + common = cfg: params.log // params.tracing cfg // { http-address = mkParamDef types.str "0.0.0.0:10902" '' Listen host:port for HTTP endpoints. @@ -190,7 +206,7 @@ let }; }; - sidecar = params.common // params.objstore cfg.sidecar // { + sidecar = params.common cfg.sidecar // params.objstore cfg.sidecar // { prometheus.url = mkParamDef types.str "http://localhost:9090" '' URL at which to reach Prometheus's API. @@ -224,7 +240,7 @@ let }; - store = params.common // params.objstore cfg.store // { + store = params.common cfg.store // params.objstore cfg.store // { stateDir = mkStateDirParam "data-dir" "thanos-store" '' Data directory relative to /var/lib @@ -262,7 +278,7 @@ let ''; }; - query = params.common // { + query = params.common cfg.query // { grpc-client-tls-secure = mkFlagParam '' Use TLS when talking to the gRPC server @@ -385,7 +401,7 @@ let ''; }; - rule = params.common // params.objstore cfg.rule // { + rule = params.common cfg.rule // params.objstore cfg.rule // { labels = mkAttrsParam "label" '' Labels to be applied to all generated metrics. @@ -497,7 +513,7 @@ let ''; }; - compact = params.log // params.gcloudtrace // params.objstore cfg.compact // { + compact = params.log // params.tracing cfg.compact // params.objstore cfg.compact // { http-address = mkParamDef types.str "0.0.0.0:10902" '' Listen host:port for HTTP endpoints. @@ -553,7 +569,7 @@ let ''; }; - downsample = params.log // params.gcloudtrace // params.objstore cfg.downsample // { + downsample = params.log // params.tracing cfg.downsample // params.objstore cfg.downsample // { stateDir = mkStateDirParam "data-dir" "thanos-downsample" '' Data directory relative to /var/lib @@ -562,7 +578,7 @@ let }; - receive = params.common // params.objstore cfg.receive // { + receive = params.common cfg.receive // params.objstore cfg.receive // { remote-write.address = mkParamDef types.str "0.0.0.0:19291" '' Address to listen on for remote write requests. -- cgit 1.4.1