about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBas van Dijk <v.dijk.bas@gmail.com>2019-07-28 12:07:52 +0200
committerBas van Dijk <v.dijk.bas@gmail.com>2019-07-28 13:28:27 +0200
commit0a59be7136db02098b4c085350461fec8810b979 (patch)
tree884986e8a69ec7934dc684ddbfe55d66ecb564c6
parent6a59dc35f6a4f54ec84dd5c7447e855fde3d4688 (diff)
downloadnixlib-0a59be7136db02098b4c085350461fec8810b979.tar
nixlib-0a59be7136db02098b4c085350461fec8810b979.tar.gz
nixlib-0a59be7136db02098b4c085350461fec8810b979.tar.bz2
nixlib-0a59be7136db02098b4c085350461fec8810b979.tar.lz
nixlib-0a59be7136db02098b4c085350461fec8810b979.tar.xz
nixlib-0a59be7136db02098b4c085350461fec8810b979.tar.zst
nixlib-0a59be7136db02098b4c085350461fec8810b979.zip
thanos: 0.5.0 -> 0.6.0
-rw-r--r--nixos/modules/services/monitoring/thanos.nix54
-rw-r--r--pkgs/servers/monitoring/thanos/default.nix6
2 files changed, 38 insertions, 22 deletions
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.<cmd>.tracing.config == null then null
+            else toString (toYAML "tracing.yaml" config.services.thanos.<cmd>.tracing.config);
+          '';
+          description = ''
+            Path to YAML file that contains tracing configuration.
+          '';
+        };
+      };
 
-        If <literal>null</literal>, 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 <literal>1/&lt;sample-factor&gt;</literal>.
+            When not <literal>null</literal> the attribute set gets converted to
+            a YAML file and stored in the Nix store. The option
+            <option>tracing.config-file</option> will default to its path.
 
-        If <literal>0</literal> no trace will be sent periodically, unless
-        forced by baggage item.
-      '';
+            If <option>tracing.config-file</option> 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 <literal>host:port</literal> 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 <literal>/var/lib</literal>
@@ -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 <literal>host:port</literal> 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 <literal>/var/lib</literal>
@@ -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.
diff --git a/pkgs/servers/monitoring/thanos/default.nix b/pkgs/servers/monitoring/thanos/default.nix
index 4bb7e8e037cd..28218b8f66d6 100644
--- a/pkgs/servers/monitoring/thanos/default.nix
+++ b/pkgs/servers/monitoring/thanos/default.nix
@@ -1,16 +1,16 @@
 { stdenv, buildGoModule, fetchFromGitHub }:
 buildGoModule rec {
   pname = "thanos";
-  version = "0.5.0";
+  version = "0.6.0";
 
   src = fetchFromGitHub {
     rev = "v${version}";
     owner = "improbable-eng";
     repo = "thanos";
-    sha256 = "0my0653mkb14m93s4x3nyf8khyljkvi5sq049lir8yqzqn7p1654";
+    sha256 = "0vcp7m8fsk4jyk49jh9wmbvkx5k03xw10f4lbsxfmwib1y5pz2x0";
   };
 
-  modSha256 = "1236cg00h8077fmvyddwjsnw85r69ac18b2chcpgzd85xdcaxavk";
+  modSha256 = "139b66jdryqv4s1hjbn9fzkyzn1160wr4z6a6wmmvm3f6p6wgjxp";
 
   subPackages = "cmd/thanos";